最近的文章
bestcoder #56 div 2 C Clarke and puzzle (nim游戏 树状数组)
比赛的时候没过.还以为是树状数组写残了. 但实际上是有自己不知道的东西. 这种博弈叫 nim游戏 所以这是一个二维的nim游戏. **nim游戏的性质是xor 和为0必败,否则必胜. xor和也有前缀和性质,所以可以用树状数组维护.
best coder #56 div 2 A Clarke and minecraft(贪心)
贪心..尽量把一样的材料放在一起... 然后写蠢了..妈蛋... 详情见代码
codeforces #320 div 2A - Raising Bacteria (位运算)
x的二进制表示中1的个数即为答案.
原因是,每天晚上糖果数量翻倍,相当于左移1位,这时候二进制表示中1的数量不变
codeforces #319 div 2 E C. Points on Plane (分块)
初识分快.
引一段题解:
Let’s split rectangle 106 × 106 by vertical lines into 1000 rectangles 103 × 106. Let’s number them from left to right. We’re going to pass through points rectangle by rectangle. Inside the rectangle we’re going to pass the points in increasing order of y-coordinate if the number of rectangle is even and in decreasing if it’s odd.