作业帮 > 英语 > 作业

ACM 比赛 运算超时

来源:学生作业帮 编辑:大师作文网作业帮 分类:英语作业 时间:2024/09/23 01:37:38
ACM 比赛 运算超时
Description
Long long ago,there is a great king.To defend his country,he built many castles numbered from 1 to N.In the i-th castle which is co-prime with N,he apportion a general,if hostile country want to kill the general,he will lose one unit.He wants you to help him count number of unit he need.
Two numbers are co-prime if their great common divisor is 1.
Input
The first line contains a single integer T (2
ACM 比赛 运算超时
#include
#include
int p[100001], phi[100001];
int main() {
memset(p,0,sizeof(p));
for (int i=2;i