题目链接
题意:有一连串的数字,两个人轮流取一个数,当谁取走数后,剩下的数的和不能被3整除,则这个人输了,求出先手是否能胜。
思路:当数只有一个时,先后必胜。当数大于两个时,先判断先手取完数后,剩下的数是否能被3整除,如果可以的话,接下去两个人轮流取的数都必须是3的整数倍。计算3的整数倍的个数就可以了。
代码:
#include
#include
#includ...
分类:
其他好文 时间:
2014-09-15 17:51:29
阅读次数:
187
Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
分类:
其他好文 时间:
2014-09-15 17:13:09
阅读次数:
223
属性/方法名: 说明:[基本属性] URL:String; 指定媒体位置,本机或网络地址uiMode:String; 播放器界面模式,可为Full, Mini, None, InvisibleplayState:integer; 播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,....
The Bonus Salary!Time Limit: 2000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:376264-bit integer IO format:%lld Java class na...
分类:
其他好文 时间:
2014-09-14 23:29:47
阅读次数:
379
Kaka's Matrix TravelsTime Limit: 1000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:342264-bit integer IO format:%lld Java clas...
分类:
其他好文 时间:
2014-09-14 20:39:27
阅读次数:
242
查看Mat文档时里面是这么描述Shallow Heap的:Shallowheap is the memory consumed by one object. An object needs 32 or 64 bits(depending on the OS architecture) per reference, 4 bytes per Integer, 8 bytesper Long, etc....
分类:
编程语言 时间:
2014-09-14 16:45:47
阅读次数:
204
题目:
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the...
分类:
其他好文 时间:
2014-09-14 11:22:47
阅读次数:
181
享元模式 String、Character、Integer、Long、Boolean 都使用了享元模式;这里没有浮点型注意: 两个Integer对象数字超过127后,自动装箱后不会被缓存,再次装箱同样大于127的数字时* 两个>=127的整数对象(Integer,Long)是不相等的 pu...
分类:
其他好文 时间:
2014-09-14 01:16:56
阅读次数:
246
Bone Collector IITime Limit: 2000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:263964-bit integer IO format:%I64d Java class n...
分类:
其他好文 时间:
2014-09-13 22:45:36
阅读次数:
211
Minimum CostTime Limit: 4000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:251664-bit integer IO format:%lld Java class name:Ma...
分类:
其他好文 时间:
2014-09-13 21:20:15
阅读次数:
275