# 11107: 【原1107】二哥的赌博

### 题目描述

author: Qiming Chen 原OJ链接：https://acm.sjtu.edu.cn/OnlineJudge-old/problem/1107

## Output Format

m行,每行一个单词 "yes" 或者 "no",表示这一局二哥是否能够获胜.

m<=2,000

n<=10,000,000

## Sample Input 1

``````1
1
``````

## Sample Output 1

``````yes
``````

## Sample Input 2

``````2
1
2
``````

## Sample Output 2

``````yes
yes
``````

## Sample Input 3

``````1
0
``````

## Sample Output 3

``````no
``````

## FineArtz's solution

``````/* 二哥的赌博 */
#include <iostream>
using namespace std;

int main(){
int m;
cin >> m;
while (m--){
int t;
cin >> t;
if (t == 0)
cout << "no" << endl;
else
cout << "yes" << endl;
}
return 0;
}
``````

## ligongzzz's solution

``````#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

int m;
cin >> m;

vector<int> mdata(m);

int maxn = 0;
for (int i = 0; i < m; ++i) {
cin >> mdata[i];
maxn = mdata[i] > maxn ? mdata[i] : maxn;
}

vector<bool> isNum(maxn + 1, true);
vector<int> cnt(maxn + 1, 0);
for (int i = 2; i <= maxn; ++i) {
if (!isNum[i]) {
cnt[i] = cnt[i - 1];
continue;
}
for (int j = 2 * i; j <= maxn; j += i)
isNum[i] = false;
cnt[i] = cnt[i - 1] + 1;
}

for (auto p : mdata) {

}

return 0;
}
``````

## WashSwang's solution

``````#include <iostream>
using namespace std;
int m,n;
int main() {
cin>>m;
for (int i=0;i<m;++i)
{
cin>>n;
if (n!=0) cout<<"yes"<<endl;
else cout<<"no"<<endl;
}
return 0;
}
``````