摘要: 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。 I 阅读全文
posted @ 2020-04-19 00:48 XXXSANS 阅读(180) 评论(0) 推荐(0) 编辑
摘要: There are many secret openings in the floor which are covered by a big heavy stone. When the stone is lifted up, a special mechanism detects this and 阅读全文
posted @ 2020-04-19 00:10 XXXSANS 阅读(91) 评论(0) 推荐(0) 编辑
摘要: lowbit(x)=x&-x 功能:找到x的二进制数的最后一个1 原理:负数的补码,补码是原码取反+1 例如:x=6=00000110,-x=11111010,x&-x=10=2 阅读全文
posted @ 2020-04-18 22:12 XXXSANS 阅读(247) 评论(0) 推荐(0) 编辑
摘要: You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number 阅读全文
posted @ 2020-04-18 15:03 XXXSANS 阅读(410) 评论(0) 推荐(1) 编辑
摘要: Shaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. The master of Shaoli 阅读全文
posted @ 2020-04-18 13:56 XXXSANS 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 两者完全等等价。指针成员运算时,由于.比*级别度高,如果直接写成*a.b就相当于*(a.b)了,这是错误的,所以只好用括号提高*的优先回级(*a).b。很明显,这么写很繁琐,于是就用a->b代替(*a).b了,唯一的目答的就是简化 有的时候看不懂的时候转换一下会比较好看 例: ((RCC_TypeD 阅读全文
posted @ 2020-04-18 12:21 XXXSANS 阅读(861) 评论(0) 推荐(0) 编辑
摘要: There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees 阅读全文
posted @ 2020-04-17 20:39 XXXSANS 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否 阅读全文
posted @ 2020-04-17 20:17 XXXSANS 阅读(325) 评论(0) 推荐(0) 编辑
摘要: The objective of the program you are going to produce is to evaluate boolean expressions as the one shown next: Expression: ( V | V ) & F & ( F | V )w 阅读全文
posted @ 2020-04-17 11:27 XXXSANS 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cell 阅读全文
posted @ 2020-04-17 10:04 XXXSANS 阅读(115) 评论(0) 推荐(0) 编辑