摘要: There is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into is the one signed with 0. Then he will get into the hole every m holes. For example, m=2 and n=6, the wolf wil 阅读全文
posted @ 2013-11-28 21:32 蓝色记忆2013 阅读(202) 评论(0) 推荐(0)
摘要: Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数CN(Case number,1#includeusing namespace std;int sushu(int i)//用来判断i是否是素数{ for(int j=2;j>T; while(T--) { cin>>n; sum=n; fo... 阅读全文
posted @ 2013-11-28 20:15 蓝色记忆2013 阅读(132) 评论(0) 推荐(0)