麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

【POJ 2484 A Funny Game】+ 博弈

2019-11-11 05:03:52
字體:
來源:轉載
供稿:網友

A Funny Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5487 Accepted: 3444

Description Alice and Bob decide to play a funny game. At the beginning of the game they pick n(1 <= n <= 106) coins in a circle, as Figure 1 shows. A move consists in removing one or two adjacent coins, leaving all other coins untouched. At least one coin must be removed. Players alternate moves with Alice starting. The player that removes the last coin wins. (The last player to move wins. If you can’t move, you lose.)

Figure 1

Note: For n > 3, we use c1, c2, …, cn to denote the coins clockwise and if Alice remove c2, then c1 and c3 are NOT adjacent! (Because there is an empty place between c1 and c3.)

Suppose that both Alice and Bob do their best in the game. You are to write a PRogram to determine who will finally win the game.

Input There are several test cases. Each test case has only one line, which contains a positive integer n (1 <= n <= 106). There are no blank lines between cases. A line with a single 0 terminates the input.

Output For each test case, if Alice win the game,output “Alice”, otherwise output “Bob”.

Sample Input

1 2 3 0

Sample Output

Alice Alice Bob

3,4先手必敗,大于4當先手取后,后手都可以將剩下的分成完全相同的兩份,先手必敗

AC代碼 :

#include<cstdio>int main(){ int N; while(scanf("%d",&N) != EOF && N){ if(N <= 2) printf("Alice/n"); else printf("Bob/n"); } return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 久久精品99国产国产精 | 久久人人爽人人爽人人片av高清 | 日日摸夜夜骑 | 中文字幕在线观看精品 | 成人免费福利视频 | 久久艹精品 | 国产一区二区三区精品在线观看 | 欧美国产一级片 | 在线视频 日韩 | 免费视频xxxx | 国产精品99久久久久久久vr | 关键词| 成人毛片视频免费看 | 线观看免费完整aaa 一二区成人影院电影网 | 在线看一区二区三区 | 中文字幕国产一区 | 国产一区二区久久精品 | 久久精品99国产国产精 | 色欧美视频 | 一级毛片真人免费播放视频 | 免费毛片a线观看 | 午夜色片 | 欧美一区二区三区久久精品视 | 久久网站热最新地址4 | 久久亚洲春色中文字幕久久 | av在线免费观看网 | a黄在线观看 | 国产99视频精品免视看9 | 国产免费一级淫片a级中文 99国产精品自拍 | 亚洲一区二区网址 | 欧美日韩视频网站 | 国产免费视频一区二区裸体 | 日韩电影一区二区三区 | 中文字幕在线亚洲精品 | 欧美国产一区二区三区 | 九九热在线视频免费观看 | 日本中文字幕网址 | 99国产精品国产免费观看 | sese在线视频 | av在线免费看片 | 成人午夜视频在线观看免费 |