编程介的小学生 2017-01-14 08:19 采纳率: 20.5%
浏览 964
已采纳

Stone Game

问题描述 :

  Alice and Bob are playing a game. It is played in 1*N grids. Each grid can be occupied by one stone. Alice has K white stones on the left (numbered 1 to K from left to right), and Bob has K black stones on the right (numbered 1 to K from right to left). They take turns to move their own stones, and Alice moves first. In each move, the player must choose one stone to move to the nearest empty grid forward (Alice moves to the right, Bob moves to the left). If one player cannot find any stone to move, he wins.
  Now Alice asks you to find a winning strategy of the game. Can you help him?

输入:

  There are multiple test cases. In each case, there is one line containing two integers N, K.

Technical Specification
  3 <= N <= 1,000,000, 1 < K*2 < N

输出:

  There are multiple test cases. In each case, there is one line containing two integers N, K.

Technical Specification
  3 <= N <= 1,000,000, 1 < K*2 < N

样例输入:

3 1
4 1
样例输出:

Case 1: Bob
Case 2: Alice 1

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-01-21 16:44
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?