Problem 1912 --Problem E: Relatives

1912: Problem E: Relatives

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $108$ 正确数量 $68$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Problem E: Relatives

Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a = xy and b = xz.

There are several test cases. For each test case, standard input contains a line with n <= 1,000,000,000. A line containing 0 follows the last case.

For each test case there should be single line of output answering the question posed above.

7
12
0
6
4

推荐代码 查看1912 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 淡意的温柔 589264 2020-05-31 14:44:38
内存最少[$944 $KB] 刘璋@计算机科学与技术172 256068 2018-05-31 09:25:42
第一AC AOJ大管家 84427 2017-04-27 15:29:06
第一挑战 AOJ大管家 84427 2017-04-27 15:29:06

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛
1149 2017-2018-2《C语言程序设计II》课下练习@2017计算机科学与技术123 2018-03-06 12:00:00 请登录