标签:public 商业 font 两种 ble 一个人 nbsp return 授权
巴什博奕,n%(m+1)!=0时,先手总是会赢的
来自 <https://leetcode-cn.com/problems/nim-game/comments/>
class Solution {
public:
bool canWinNim(int n) {
return n%4!=0;// 速度更快的是位运算 (n&3)!=0;
}
};
作者:vailing
链接:https://leetcode-cn.com/problems/nim-game/solution/shu-xue-gui-lei-fa-zheng-ming-by-vailing/
来源:力扣(LeetCode)
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
标签:public 商业 font 两种 ble 一个人 nbsp return 授权
原文地址:https://www.cnblogs.com/xukaiae86/p/12047322.html