F
来源:互联网 发布:做淘宝美工怎么样 编辑:程序博客网 时间:2024/05/16 19:34
题目链接:点击打开链接
题目大意:
给定 n 堆石子,让两个人依次取,后者只能在前者取过的那堆石子上取,取得最后一枚石子的人为胜利者;
不管放多少石子,后者只有在 n 是偶数且每堆石子只有一枚是赢得胜利,否则就是前者胜利;
#include <cstdio> #include <iostream> #include <string> #include <cstring> #include <algorithm> #include <iomanip> #include <cmath> #include <vector> using namespace std; typedef long long ll; int main() { int T; cin>>T; while(T--){ int n; cin>>n; int flag=0; for(int i=0;i<n;i++){ int a; cin>>a; if(a==1) flag++; } if(flag==n&&n%2==0) cout<<"piloop"<<endl; else cout<<"poopi"<<endl; } return 0; }
阅读全文
0 0
- f
- f
- f
- f
- f
- F#
- f
- F
- f
- f
- f
- f
- f
- f
- F
- f
- f
- F
- Kotlin——继承
- 喷水装置(一)
- 喷水装置(二)
- poj 1741 点分治
- 天气预报实时显示系统设计
- F
- 【HDU-2037】 今年暑假不AC
- Jackson常用方法以及jacksonUtil工具类和回顾JSON数据格式回顾
- 深入浅出ARKit
- 访问修饰符protected
- MIT《计算机科学数学》Chaper02-The Well Ordering Principle
- 在beeline中插入数据是提示权限不足
- react-native-vector-icons的使用
- 25年、博士、C\/C++程序员的告白:多年来代码依然存在bug