-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Primary_Task.cpp
More file actions
50 lines (47 loc) · 1.16 KB
/
A_Primary_Task.cpp
File metadata and controls
50 lines (47 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<bits/stdc++.h>
using namespace std;
#define sr(a) sort(a.begin(),a.end())
#define srd(a) sort(a.begin(),a.end(),greater<int>())
#define ll long long
#define MOD 10e7;
int main(){
ios_base:: sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
cin>>tc;
while(tc--){
string a;
cin>>a;
if(a[0] == '1' && a[1] == '0'){
int fl = 0,w = 0;
if(a[2] == '0'){
cout<<"NO"<<endl;
continue;;
}
if( a[2] == '1'){
fl = 0;
if(a.size() > 3){
cout<<"YES"<<endl;
continue;
}
else{
cout<<"NO"<<endl;
continue;
}
}
for(int i = 2+w; i< a.size();i++){
if(a[i] != '0'){
fl = 1;
break;
}
}
if(fl)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
}