题目链接:http://codeforces.com/gym/101128/my

如果可以,就看这个人的代码吧,我还不是很懂唉:http://blog.csdn.net/loy_184548/article/details/52137706

题目大意:(md做了半天,原来是题目意思理解错了)

游戏规则:

  1. 给出n堆纸牌,可任意选择其中一堆,记为x
  2. 在x的顶部可取走[0,k]张纸牌,该堆纸牌至少留下一张
  3. x剩下来的纸牌中,记顶部的纸牌值为y,则移除最顶部的y张纸牌(即该堆至少还剩下y张纸牌才是合法)

然后1->3不断循环做即可。

思路:

定义sg(i)表示目前位置在i,消除k个以后,剩下的sg值。

代码来自上面那个人的

http://blog.csdn.net/loy_184548/article/details/52137706

GYM 101128 G.Game of Cards(博弈论) 或者 UVALIVE 7278的更多相关文章

  1. POJ 1511 Invitation Cards / UVA 721 Invitation Cards / SPOJ Invitation / UVAlive Invitation Cards / SCU 1132 Invitation Cards / ZOJ 2008 Invitation Cards / HDU 1535 (图论,最短路径)

    POJ 1511 Invitation Cards / UVA 721 Invitation Cards / SPOJ Invitation / UVAlive Invitation Cards / ...

  2. Codeforces Gym 100513G G. FacePalm Accounting

    G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513 ...

  3. Codeforces Gym 100637G G. #TheDress 暴力

    G. #TheDress Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/G ...

  4. Codeforces Gym 100513G G. FacePalm Accounting 暴力

    G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513 ...

  5. Gym - 101147G G - The Galactic Olympics —— 组合数学 - 第二类斯特林数

    题目链接:http://codeforces.com/gym/101147/problem/G G. The Galactic Olympics time limit per test 2.0 s m ...

  6. Gym 100952 G. The jar of divisors

    http://codeforces.com/gym/100952/problem/G G. The jar of divisors time limit per test 2 seconds memo ...

  7. Codeforces Gym 100203G G - Good elements 标记暴力

    G - Good elementsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  8. Codeforces Gym 100203G G - Good elements 暴力

    G - Good elementsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  9. Codeforces Gym 101142 G Gangsters in Central City (lca+dfs序+树状数组+set)

    题意: 树的根节点为水源,编号为 1 .给定编号为 2, 3, 4, …, n 的点的父节点.已知只有叶子节点都是房子. 有 q 个操作,每个操作可以是下列两者之一: + v ,表示编号为 v 的房子 ...

随机推荐

  1. Java 通过先序中序序列生成二叉树

    题目 二叉树的前序以及后续序列,以空格间隔每个元素,重构二叉树,最后输出二叉树的三种遍历方式的序列以验证. 输入: 1 2 3 4 5 6 7 8 9 10 3 2 5 4 1 7 8 6 10 9 ...

  2. Traffic Steering for Service Function Chaining

    Introduction 目前通过vlan标签来把流量引向对应的sfc 以前的sfc静态(SFs相邻组成SFC),有了sdn之后具有动态性.(SFs不需要彼此相邻.将流量动态地导向所需的SFs.) 流 ...

  3. BundleCollection学习(一)

    工作中有同事提到了mvc4提供了css,js压缩功能.类BundleCollection所以搜集资料记录学习下. 学习中………… MVC中用 BundleCollection 压缩CSS时图片路径问题 ...

  4. B-2阶段组员分数分配

    组名: 新蜂 组长: 武志远 组员: 宫成荣 谢孝淼 杨柳 李峤 项目名称: java俄罗斯方块 武 武 武 武 杨 宫 宫 杨 宫 谢 李 杨 李 谢 李 谢 李 谢 杨 宫 扬 谢 宫 李 武 评 ...

  5. Robot 模拟操作键盘 实现复制粘贴功能;

    1.代码逻辑 : a.封装一个粘贴的方法体:setAndctrlVClipboardData(String string);参数string是需要粘贴的内容 : b.声明一个StringSelecti ...

  6. Kafka集群无法外网访问问题解决攻略

    Kafka无法集群外网访问问题解决方法  讲解本地消费者和生产者无法使用远程Kafka服务器的处理办法 服务搭建好Kafka服务后,机本.测试 OK,外面机器却无法访问,很是怪异. 环境说明:  Ka ...

  7. python3.6 SSL module is not available

    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail ...

  8. websocket服务器+客户端

    <?php $demo = new ws('192.168.90.47',12345); $demo->run(); class ws { //当前服务端主连接 private $curr ...

  9. 在MFC中显示cmd命令行

    添加函数 void InitConsoleWindow1() { ; FILE* fp; AllocConsole(); nCrt = _open_osfhandle((long)GetStdHand ...

  10. Vue2.0 render:h => h(App)

    new Vue({ router, store, //components: { App } vue1.0的写法 render: h => h(App) vue2.0的写法 }).$mount( ...