摘要:
As you know, the game of "Nim" is played with n piles of stones, where the i-th pile initially contains ai stones. Two players alternate the turns. Du 阅读全文
摘要:
XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its val 阅读全文
摘要:
相传,在远古时期,位于西方大陆的 Magic Land 上,人们已经掌握了用魔法矿石炼制法杖的技术。那时人们就认识到,一个法杖的法力取决于使用的矿石。一般地,矿石越多则法力越强,但物极必反:有时,人们为了获取更强的法力而使用了很多矿石,却在炼制过程中发现魔法矿石全部消失了,从而无法炼制出法杖,这个现 阅读全文
摘要:
One day Silence is interested in revolving the digits of a positive integer. In the revolving operation, he can put several last digits to the front o 阅读全文
摘要:
Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strin 阅读全文
摘要:
Alice are given an array A[1..N]A[1..N] with NN numbers. Now Alice want to build an array BB by a parameter KK as following rules: Initially, the arra 阅读全文
摘要:
Bob intends to color the nodes of a tree with a pen. The tree consists of NN nodes. These nodes are numbered 1,2,...,N1,2,...,N. The root of the tree 阅读全文
摘要:
Alice is interesting in computation geometry problem recently. She found a interesting problem and solved it easily. Now she will give this problem to 阅读全文
摘要:
题意:T组样例,给次给出一个N节点的点权树,以及M,问连通块的点权和sum的情况,输出sum=1到M,用0或者1表示。 思路:背包,N^2,由于是无向的连通块,所以可以用分治优化到NlgN。 然后背包可以用bitset优化。注意不要想着背包合并背包,背包只能合并单点。 阅读全文
摘要:
You are given a string ss. You should answer nn queries. The ii-th query consists of integer kiki and string mimi. The answer for this query is the mi 阅读全文