HUD 1729 Stone Game(SG)
来源:互联网 发布:要不要回老家 知乎 编辑:程序博客网 时间:2024/05/29 11:12
hdu 1729
思路:
当
#include <iostream>#include <algorithm>#include <cstdio>#include <cmath>#include <cstring>#include <cstdlib>using namespace std;int sg(int s, int c){ int q = (int)(sqrt(s * 1.0)); while (q * q + q >= s) { q--; } if (c > q) { return s - c; } else { return sg(q, c); }}int main(){ int n; int cas = 0; while (~scanf("%d", &n) && n) { printf("Case %d:\n", ++cas); int ans = 0; while (n--) { int s, c; scanf("%d%d", &s, &c); ans = ans ^ sg(s, c); } if (ans) { printf("Yes\n"); } else { printf("No\n"); } }}
0 0
- HUD 1729 Stone Game(SG)
- HDU 1729 Stone Game (SG函数)
- HDU 1729 Stone Game 【博弈论,SG函数】
- hdu 1729 Stone Game(SG函数)
- sg函数 hdu 1729 Stone Game
- hdoj 1729 Stone Game(sg函数)
- HDU 1729 Stone Game (sg函数)
- HDU 1729 Stone Game(SG函数)
- hdu1729 Stone Game sg
- hdu Stone Game SG函数
- HDU1729 Stone Game (SG函数)
- hdu1729 Stone Game-sg函数
- HDU 1729 Stone Game(SG函数变形)
- HDU 1729 Stone Game(思维 & SG函数)
- HDU 1729 Stone Game(博弈 + SG函数)
- uva1378 - A Funny Stone Game SG函数
- 【lightOJ】 Again Stone Game (博弈,SG函数)
- [UVA1378] A Funny Stone Game && SG函数
- 【入门】Android自定义属性
- codevs2743 黑白棋游戏
- VK Cup 2016 - Round 1 B. Bear and Forgotten Tree 3
- CORS(跨域资源共享) 的配置
- 学习Python,学习Pygame(二)
- HUD 1729 Stone Game(SG)
- ssh连接慢
- 点击背景颜色效果
- PyQt5应用与实践
- jQuery插件tablesorter 表格排序 自定义排序addParser()
- Android 开发规范1.0
- day12 面试题:JSP中的四个域对象
- Angular JS
- 安装coreseek可能遇见的问题