摘要: 棋盘染色题目描述: 有一个5×5的棋盘,上面有一些格子被染成了黑色,其他的格子都是白色,你的任务的对棋盘一些格子进行染色,使得所有的黑色格子能连成一块,并且你染色的格子数目要最少。读入一个初始棋盘的状态,输出最少需要对多少个格子进行染色,才能使得所有的黑色格子都连成一块。(注:连接... 阅读全文
posted @ 2016-08-17 15:08 抽空的太阳 阅读(196) 评论(0) 推荐(0)
摘要: #include using namespace std;const int maxn=1000000;int n,j,a[maxn],c[maxn],len;int find(int l,int r,int x){ if(l==r) return l; int mid... 阅读全文
posted @ 2016-08-16 20:04 抽空的太阳 阅读(113) 评论(0) 推荐(0)
摘要: 2k进制数设r是个2k进制数,并满足以下条件: (1)r至少是个2位的2k进制数。 (2)作为2k进制数,除最后一位外,r的每一位严格小于它右边相邻的那一位。 (3)将r转换为2进制数q后,则q的总位数不超过w。 在这里,正整数k(1≤k≤9)和w(k≤30000)是事先给定的。 ... 阅读全文
posted @ 2016-08-15 21:31 抽空的太阳 阅读(256) 评论(0) 推荐(0)
摘要: 聪明的质监员来源: NOIP2011 day2 T2 题目描述: 小 T 是一名质量监督员,最近负责检验一批矿产的质量。这批矿产共有n 个矿石,从1到n 逐一编号,每个矿石都有自己的重量wi 以及价值vi。检验矿产的流程是:见图 若这批矿产的检验结果与所给标准值S 相差太多,就... 阅读全文
posted @ 2016-08-15 08:48 抽空的太阳 阅读(122) 评论(0) 推荐(0)
摘要: EqsDescription: Consider equations having the following form: a1x13+ a2x23+ a3x33+ a4x43+ a5x53=0 The coefficients are given integers from ... 阅读全文
posted @ 2016-08-12 18:25 抽空的太阳 阅读(257) 评论(0) 推荐(0)
摘要: Mobile phonesDescription: Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is d... 阅读全文
posted @ 2016-08-12 17:53 抽空的太阳 阅读(155) 评论(0) 推荐(0)
摘要: int lowbit(int x){ return x & (-x);}void modify(int x,int add)//一维{ while(x0;i-=lowbit(i)) for(int j=y;j>0;j-=lowbit(j)) ... 阅读全文
posted @ 2016-08-12 17:05 抽空的太阳 阅读(69) 评论(0) 推荐(0)
摘要: Apple TreeDescription: There is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple ... 阅读全文
posted @ 2016-08-12 16:05 抽空的太阳 阅读(245) 评论(0) 推荐(0)
摘要: Balanced LineupDescription: For the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer Joh... 阅读全文
posted @ 2016-08-12 15:26 抽空的太阳 阅读(128) 评论(0) 推荐(0)
摘要: 一起去打CS题目描述: 早就和lyk约好了去打cs,一直没找着时间,终于今天我家没人,他家也没人,总算可以出去了。但是偏偏天公不作美,某某人非要留那么多题要做。没办法只能尽快做完然后抓紧时间吧…… 为了尽量节省时间,我俩决定分开做所有题吧(嘿嘿,稍微耍一下滑~~)。... 阅读全文
posted @ 2016-08-11 20:06 抽空的太阳 阅读(147) 评论(0) 推荐(0)