-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Primary_Task.cpp
More file actions
53 lines (37 loc) · 1.13 KB
/
A_Primary_Task.cpp
File metadata and controls
53 lines (37 loc) · 1.13 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
51
52
53
# include <iostream>
# define ll long long
#include <bits/stdc++.h>
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
using namespace std ;
unsigned ll dist(ll x ,ll y , ll x1 , ll y1 ){
unsigned ll ditx = (x1 -x)*(x1 -x);
unsigned ll dity = ( y1 - y)*( y1 - y);
unsigned ll ans = ditx + dity;
return ans;
}
int main (){
FAST
ll t; cin >> t; while (t--){
string ss ;cin >> ss;
if(ss.size() < 3 || ( ss[0] != '1' || ss[1] != '0' )){
cout << "NO\n";
}else {
if(ss.size() > 3){
ll fl = 0;
for(ll i =2;i<ss.size();i++){
if(ss[i] == '0')fl =1;
else break;
}
if(fl ){
cout << "NO\n";
} else
{ cout << "YES\n";}
}else {
if(ss[2] == '0' || ss[2] == '1' ) cout << "NO\n"; else cout << "YES\n";
}
}
}
}