摘要: CupTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3533Accepted Submission(s): 1136Problem DescriptionThe WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height?T 阅读全文
posted @ 2014-04-08 22:31 heaventouch 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Calculation 2Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1923Accepted Submission(s): 812Problem DescriptionGiven a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said 阅读全文
posted @ 2014-04-08 19:34 heaventouch 阅读(175) 评论(0) 推荐(0) 编辑
摘要: GCD AgainTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2257Accepted Submission(s): 908Problem DescriptionDo you have spent some time to think and try to solve those unsolved problem after one ACM contest?No? Oh, you must do this when you want to 阅读全文
posted @ 2014-04-08 12:15 heaventouch 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 欧拉函数 1 /* 2 欧拉函数: 3 小于或等于n的正整数中,与n互质的数的数目 4 */ 5 #include 6 #define N 3000005 7 __int64 ans[N]; 8 void init() //打表法 9 {10 for(int i=1;i1) ret*=n-1;29 return ret;30 } 31 int main(void)32 {33 int n;34 while(scanf("%d",&n)!=EOF)35 {36 printf("%d\n",euler(n));37... 阅读全文
posted @ 2014-04-08 12:07 heaventouch 阅读(649) 评论(0) 推荐(0) 编辑
摘要: The Euler functionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3333Accepted Submission(s): 1368Problem DescriptionThe Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smalle 阅读全文
posted @ 2014-04-08 09:53 heaventouch 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 找新朋友Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6952Accepted Submission(s): 3612Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数CN(Case 阅读全文
posted @ 2014-04-08 09:32 heaventouch 阅读(208) 评论(0) 推荐(0) 编辑