摘要: 题目链接:http://acm.hit.edu.cn/hoj/problem/view?id=1867每次更新时判断是否素数,如果从非素数变成素数就Update(x, 1),如果从素数变成非素数就Update(x, -1)。 1 /*HIT 1867 2 经理的烦恼 3 */ 4 #include 5 #include 6 const int N=1000009; 7 8 int a[N],c[N],n,m,C; 9 int prime(int num)10 {11 int i;12 if(num0)37 {38 s += c[num];39 ... 阅读全文
posted @ 2014-03-08 09:24 霖‘ 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Mobile phonesTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 13774Accepted: 6393DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and columns numbe 阅读全文
posted @ 2014-03-07 21:23 霖‘ 阅读(280) 评论(0) 推荐(0) 编辑