1920. Divide The Stones
2011-05-15 17:16
381 查看
1 /*奇数个偶数就是Alice胜利
2 *偶数个偶数就是Bob胜利
3 *奇数个偶数最后都可以转化为1,1的形式
4 *偶数个偶数最后转化为1,2的形式
5 *
6 */
7
8 #include <iostream>
9 #include <stdio.h>
10 using namespace std;
11 int main()
12 {
13 int t;
14 scanf("%d",&t);
15 while(t--)
16 {
17 int n;
18 scanf("%d",&n);
19 int ans=0;
20 while(n--)
21 {
22 int tem;
23 scanf("%d",&tem);
24 // cout<<tem<<endl;
25 if(tem%2==0)
26 ans++;
27 }
28 // cout<<ans<<endl;
29 if(ans%2==1)
30 printf("Alice\n");
31 else
32 printf("Bob\n");
33 }
34 }
2 *偶数个偶数就是Bob胜利
3 *奇数个偶数最后都可以转化为1,1的形式
4 *偶数个偶数最后转化为1,2的形式
5 *
6 */
7
8 #include <iostream>
9 #include <stdio.h>
10 using namespace std;
11 int main()
12 {
13 int t;
14 scanf("%d",&t);
15 while(t--)
16 {
17 int n;
18 scanf("%d",&n);
19 int ans=0;
20 while(n--)
21 {
22 int tem;
23 scanf("%d",&tem);
24 // cout<<tem<<endl;
25 if(tem%2==0)
26 ans++;
27 }
28 // cout<<ans<<endl;
29 if(ans%2==1)
30 printf("Alice\n");
31 else
32 printf("Bob\n");
33 }
34 }
相关文章推荐
- Sicily 1920 Divide The Stones
- 1920. Divide The Stones
- 2016 Multi-University Training Contest 5 1003 Divide the Sequence (贪心)
- hdu 5783 Divide the Sequence 贪心
- hdu 5783 Divide the Sequence 贪心
- HDU 5783 Divide the Sequence
- 分治法——主定理(Divide and Conquer - The Master Theorem)
- UVa 10256 The Great Divide,判断两个凸包是否相离
- codeforces 266A Stones on the Table(模拟水题)
- hdu 5783 Divide the Sequence
- 1087. The Time to Take Stones
- 【HDU】5783 Divide the Sequence
- HDU 5783 Divide the Sequence 思维题
- GYM 100090 H.Game with the Stones(博弈论)
- HDU - 5783 Divide the Sequence
- UVA 10256 The Great Divide 凸包 .
- Codeforces Round #163 (Div. 2) A. Stones on the Table
- UVa 10256 - The Great Divide 判断凸包相交
- Stones on the Table
- Ural 1087|The Time to Take Stones|博弈论|动态规划