#include<bits/stdc++.h>
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;
int main(){
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
int t;
cin >> t;
vector<pii> v(n);
for(auto & i : v)
cin >> i.ff >> i.ss;
map<pii,int> mp;
for(int i = 0; i < n; i++){
mp[{v[i].ff,v[i].ss}] = i;
}
vector<int> pai(n);
iota(all(pai),0);
int dx[]{1,0,-1,0}, dy[]{0,1,0,-1};
int dx2[]{-1,-1,-1,0,1,1,1,0}, dy2[]{-1,0,1,1,1,0,-1,-1};
auto find =[&](int id, auto f) -> int {
if(pai[id] == id)
return id;
return pai[id] = f(pai[id],f);
};
int cmp = n;
auto onion =[&](int a, int b) -> void {
a = find(a,find);
b = find(b,find);
if(a != b){
pai[a] = b;
cmp--;
}
};
vector<int> deg(n);
for(int i = 0; i < n; i++){
for(int j = 0; j < 8; j++){
int xi = v[i].ff+dx2[j], yi = v[i].ss+dy2[j];
if(mp.count({xi,yi})){
onion(i,mp[{xi,yi}]);
deg[i]++;
// cout << i << "++\n";
// cout << mp[{xi,yi}] << "++\n";
}
}
}
if(cmp > 1){
cout << "NO\n";
return 0;
}
t = n;
for(int i = 0; i < n; i++){
for(int j = 0; j < 8; j++){
int xi = v[i].ff+dx2[j], yi = v[i].ss+dy2[j];
if(!mp.count({xi,yi})){
mp[{xi,yi}] = t++;
v.push_back({xi,yi});
}
}
}
pai = vector<int>(t);
iota(all(pai),0);
for(int i = n; i < t; i++){
for(int j = 0; j < 4; j++){
int xi = v[i].ff+dx[j], yi = v[i].ss+dy[j];
if(mp.count({xi,yi}) && mp[{xi,yi}] >= n){
onion(i,mp[{xi,yi}]);
}
}
}
vector<int> check(n);
priority_queue<int> pq;
set<pii> passed;
vector<int> reached(n);
auto dfs =[&](int x, int y, auto dfs) -> void {
passed.insert({x,y});
for(int i = 0; i < 4; i++){
int xi = x+dx[i], yi = y+dy[i];
if(!passed.count({xi,yi}) && mp.count({xi,yi})){
int curval = mp[{xi,yi}];
if(curval >= n){
dfs(xi,yi,dfs);
} else {
if(!check[curval]){
check[curval] = 1;
reached[curval] = 1;
pq.push(curval);
}
}
}
}
};
int mn = 0;
for(int i = 1; i < n; i++){
mn = min(mn,i,[&](int a, int b){
return v[a].ff < v[b].ff;
});
}
dfs(v[mn].ff-1,v[mn].ss,dfs);
vector<int> resp;
while(!pq.empty()){
int cur = pq.top();
pq.pop();
if(check[cur] == 2)
continue;
if(deg[cur]>=2){//check comp
bool failed = 0;
for(int i = 1; i < 4; i+=2){
int leftx = v[cur].ff+dx2[i], lefty = v[cur].ss+dy2[i];
int rightx = v[cur].ff+dx2[i+4], righty = v[cur].ss+dy2[i+4];
int k = i+1;
int sum = 0;
while(k != i+4){
int xi = v[cur].ff+dx2[k], yi = v[cur].ss+dy2[k];
sum+=mp[{xi,yi}] < n && check[mp[{xi,yi}]] < 2;
k++;
}
if(sum < deg[cur] && sum > 0 && find(mp[{leftx,lefty}],find) == find(mp[{rightx,righty}],find)){
failed = 1;
break;
}
}
for(int i = 1; i < 8; i+=2){
int xi = v[cur].ff+dx2[i], yi = v[cur].ss+dy2[i];
int nxi = v[cur].ff+dx2[(i+1)%8], nyi = v[cur].ss+dy2[(i+1)%8];
int nnxi = v[cur].ff+dx2[(i+2)%8], nnyi = v[cur].ss+dy2[(i+2)%8];
if(find(mp[{xi,yi}],find) == find(mp[{nnxi,nnyi}],find) && mp[{nxi,nyi}] < n && check[mp[{nxi,nyi}]] < 2){
failed = 1;
break;
}
}
if(failed){
check[cur] = 0;
continue;
}
}
check[cur] = 2;
resp.push_back(cur);
//cout << "push " << cur << '\n';
dfs(v[cur].ff,v[cur].ss,dfs);
for(int i = 0; i < 8; i++){
int xi = v[cur].ff+dx2[i], yi = v[cur].ss+dy2[i];
if(mp[{xi,yi}] < n){
deg[mp[{xi,yi}]]--;
if(!check[mp[{xi,yi}]] && reached[mp[{xi,yi}]])
pq.push(mp[{xi,yi}]), check[mp[{xi,yi}]] = 1;
}
}
for(int i = 0; i < 4; i++){
int xi = v[cur].ff+dx[i], yi = v[cur].ss+dy[i];
if(mp[{xi,yi}] >= n || check[mp[{xi,yi}]] == 2){
onion(cur,mp[{xi,yi}]);
}
}
}
reverse(all(resp));
if(resp.size() == n){
cout << "YES\n";
for(int i : resp)
cout << i + 1 << '\n';
} else cout << "NO\n";
}
Compilation message
skyscrapers.cpp: In function 'int main()':
skyscrapers.cpp:199:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
199 | if(resp.size() == n){
| ~~~~~~~~~~~~^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
ans=YES N=1 |
2 |
Correct |
1 ms |
320 KB |
ans=YES N=4 |
3 |
Correct |
1 ms |
324 KB |
ans=NO N=4 |
4 |
Correct |
1 ms |
316 KB |
ans=YES N=5 |
5 |
Correct |
1 ms |
284 KB |
ans=YES N=9 |
6 |
Correct |
1 ms |
212 KB |
ans=YES N=5 |
7 |
Correct |
1 ms |
212 KB |
ans=NO N=9 |
8 |
Correct |
1 ms |
212 KB |
ans=NO N=10 |
9 |
Correct |
1 ms |
212 KB |
ans=YES N=10 |
10 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
11 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
12 |
Correct |
0 ms |
212 KB |
ans=YES N=9 |
13 |
Correct |
0 ms |
316 KB |
ans=YES N=9 |
14 |
Correct |
0 ms |
212 KB |
ans=YES N=8 |
15 |
Correct |
1 ms |
320 KB |
ans=YES N=8 |
16 |
Correct |
1 ms |
212 KB |
ans=NO N=2 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
ans=YES N=1 |
2 |
Correct |
1 ms |
320 KB |
ans=YES N=4 |
3 |
Correct |
1 ms |
324 KB |
ans=NO N=4 |
4 |
Correct |
1 ms |
316 KB |
ans=YES N=5 |
5 |
Correct |
1 ms |
284 KB |
ans=YES N=9 |
6 |
Correct |
1 ms |
212 KB |
ans=YES N=5 |
7 |
Correct |
1 ms |
212 KB |
ans=NO N=9 |
8 |
Correct |
1 ms |
212 KB |
ans=NO N=10 |
9 |
Correct |
1 ms |
212 KB |
ans=YES N=10 |
10 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
11 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
12 |
Correct |
0 ms |
212 KB |
ans=YES N=9 |
13 |
Correct |
0 ms |
316 KB |
ans=YES N=9 |
14 |
Correct |
0 ms |
212 KB |
ans=YES N=8 |
15 |
Correct |
1 ms |
320 KB |
ans=YES N=8 |
16 |
Correct |
1 ms |
212 KB |
ans=NO N=2 |
17 |
Correct |
1 ms |
212 KB |
ans=YES N=17 |
18 |
Correct |
1 ms |
328 KB |
ans=YES N=25 |
19 |
Correct |
1 ms |
340 KB |
ans=YES N=100 |
20 |
Correct |
2 ms |
340 KB |
ans=YES N=185 |
21 |
Correct |
1 ms |
212 KB |
ans=NO N=174 |
22 |
Correct |
1 ms |
340 KB |
ans=YES N=90 |
23 |
Correct |
1 ms |
340 KB |
ans=YES N=63 |
24 |
Correct |
1 ms |
340 KB |
ans=YES N=87 |
25 |
Correct |
2 ms |
340 KB |
ans=YES N=183 |
26 |
Correct |
2 ms |
340 KB |
ans=YES N=188 |
27 |
Correct |
2 ms |
340 KB |
ans=YES N=183 |
28 |
Correct |
2 ms |
340 KB |
ans=YES N=189 |
29 |
Correct |
2 ms |
340 KB |
ans=YES N=200 |
30 |
Correct |
2 ms |
324 KB |
ans=YES N=190 |
31 |
Correct |
2 ms |
340 KB |
ans=YES N=187 |
32 |
Correct |
2 ms |
340 KB |
ans=YES N=187 |
33 |
Correct |
2 ms |
340 KB |
ans=YES N=182 |
34 |
Correct |
2 ms |
340 KB |
ans=YES N=184 |
35 |
Correct |
2 ms |
468 KB |
ans=YES N=188 |
36 |
Correct |
2 ms |
340 KB |
ans=YES N=181 |
37 |
Correct |
2 ms |
452 KB |
ans=YES N=188 |
38 |
Correct |
2 ms |
468 KB |
ans=YES N=191 |
39 |
Correct |
1 ms |
316 KB |
ans=YES N=196 |
40 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
41 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
42 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
43 |
Correct |
2 ms |
340 KB |
ans=YES N=195 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
ans=YES N=1 |
2 |
Correct |
1 ms |
320 KB |
ans=YES N=4 |
3 |
Correct |
1 ms |
324 KB |
ans=NO N=4 |
4 |
Correct |
1 ms |
316 KB |
ans=YES N=5 |
5 |
Correct |
1 ms |
284 KB |
ans=YES N=9 |
6 |
Correct |
1 ms |
212 KB |
ans=YES N=5 |
7 |
Correct |
1 ms |
212 KB |
ans=NO N=9 |
8 |
Correct |
1 ms |
212 KB |
ans=NO N=10 |
9 |
Correct |
1 ms |
212 KB |
ans=YES N=10 |
10 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
11 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
12 |
Correct |
0 ms |
212 KB |
ans=YES N=9 |
13 |
Correct |
0 ms |
316 KB |
ans=YES N=9 |
14 |
Correct |
0 ms |
212 KB |
ans=YES N=8 |
15 |
Correct |
1 ms |
320 KB |
ans=YES N=8 |
16 |
Correct |
1 ms |
212 KB |
ans=NO N=2 |
17 |
Correct |
1 ms |
212 KB |
ans=YES N=17 |
18 |
Correct |
1 ms |
328 KB |
ans=YES N=25 |
19 |
Correct |
1 ms |
340 KB |
ans=YES N=100 |
20 |
Correct |
2 ms |
340 KB |
ans=YES N=185 |
21 |
Correct |
1 ms |
212 KB |
ans=NO N=174 |
22 |
Correct |
1 ms |
340 KB |
ans=YES N=90 |
23 |
Correct |
1 ms |
340 KB |
ans=YES N=63 |
24 |
Correct |
1 ms |
340 KB |
ans=YES N=87 |
25 |
Correct |
2 ms |
340 KB |
ans=YES N=183 |
26 |
Correct |
2 ms |
340 KB |
ans=YES N=188 |
27 |
Correct |
2 ms |
340 KB |
ans=YES N=183 |
28 |
Correct |
2 ms |
340 KB |
ans=YES N=189 |
29 |
Correct |
2 ms |
340 KB |
ans=YES N=200 |
30 |
Correct |
2 ms |
324 KB |
ans=YES N=190 |
31 |
Correct |
2 ms |
340 KB |
ans=YES N=187 |
32 |
Correct |
2 ms |
340 KB |
ans=YES N=187 |
33 |
Correct |
2 ms |
340 KB |
ans=YES N=182 |
34 |
Correct |
2 ms |
340 KB |
ans=YES N=184 |
35 |
Correct |
2 ms |
468 KB |
ans=YES N=188 |
36 |
Correct |
2 ms |
340 KB |
ans=YES N=181 |
37 |
Correct |
2 ms |
452 KB |
ans=YES N=188 |
38 |
Correct |
2 ms |
468 KB |
ans=YES N=191 |
39 |
Correct |
1 ms |
316 KB |
ans=YES N=196 |
40 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
41 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
42 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
43 |
Correct |
2 ms |
340 KB |
ans=YES N=195 |
44 |
Correct |
3 ms |
468 KB |
ans=NO N=1934 |
45 |
Correct |
3 ms |
468 KB |
ans=NO N=1965 |
46 |
Correct |
15 ms |
596 KB |
ans=YES N=1824 |
47 |
Correct |
15 ms |
724 KB |
ans=YES N=1981 |
48 |
Correct |
13 ms |
596 KB |
ans=YES N=1814 |
49 |
Correct |
14 ms |
724 KB |
ans=YES N=1854 |
50 |
Correct |
14 ms |
596 KB |
ans=YES N=1831 |
51 |
Correct |
15 ms |
716 KB |
ans=YES N=2000 |
52 |
Correct |
14 ms |
856 KB |
ans=YES N=1847 |
53 |
Correct |
15 ms |
936 KB |
ans=YES N=1819 |
54 |
Correct |
15 ms |
724 KB |
ans=YES N=1986 |
55 |
Correct |
19 ms |
1100 KB |
ans=YES N=2000 |
56 |
Correct |
19 ms |
1392 KB |
ans=YES N=1834 |
57 |
Correct |
19 ms |
1336 KB |
ans=YES N=1860 |
58 |
Correct |
20 ms |
1320 KB |
ans=YES N=1898 |
59 |
Correct |
18 ms |
1244 KB |
ans=YES N=1832 |
60 |
Correct |
24 ms |
2168 KB |
ans=YES N=1929 |
61 |
Correct |
16 ms |
868 KB |
ans=YES N=1919 |
62 |
Correct |
19 ms |
1400 KB |
ans=YES N=1882 |
63 |
Correct |
25 ms |
2316 KB |
ans=YES N=1922 |
64 |
Correct |
16 ms |
980 KB |
ans=YES N=1989 |
65 |
Correct |
13 ms |
1272 KB |
ans=YES N=1978 |
66 |
Correct |
16 ms |
1444 KB |
ans=YES N=1867 |
67 |
Correct |
18 ms |
1096 KB |
ans=YES N=1942 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
468 KB |
ans=NO N=1934 |
2 |
Correct |
3 ms |
460 KB |
ans=NO N=1965 |
3 |
Correct |
14 ms |
628 KB |
ans=YES N=1824 |
4 |
Correct |
14 ms |
720 KB |
ans=YES N=1981 |
5 |
Correct |
13 ms |
636 KB |
ans=YES N=1814 |
6 |
Correct |
15 ms |
724 KB |
ans=YES N=1854 |
7 |
Correct |
14 ms |
596 KB |
ans=YES N=1831 |
8 |
Correct |
15 ms |
756 KB |
ans=YES N=2000 |
9 |
Correct |
15 ms |
856 KB |
ans=YES N=1847 |
10 |
Correct |
17 ms |
852 KB |
ans=YES N=1819 |
11 |
Correct |
16 ms |
692 KB |
ans=YES N=1986 |
12 |
Correct |
19 ms |
1160 KB |
ans=YES N=2000 |
13 |
Correct |
18 ms |
1344 KB |
ans=YES N=1834 |
14 |
Correct |
19 ms |
1396 KB |
ans=YES N=1860 |
15 |
Correct |
20 ms |
1364 KB |
ans=YES N=1898 |
16 |
Correct |
18 ms |
1312 KB |
ans=YES N=1832 |
17 |
Correct |
22 ms |
2216 KB |
ans=YES N=1929 |
18 |
Correct |
16 ms |
872 KB |
ans=YES N=1919 |
19 |
Correct |
19 ms |
1408 KB |
ans=YES N=1882 |
20 |
Correct |
22 ms |
2296 KB |
ans=YES N=1922 |
21 |
Correct |
16 ms |
976 KB |
ans=YES N=1989 |
22 |
Correct |
15 ms |
1288 KB |
ans=YES N=1978 |
23 |
Correct |
16 ms |
1428 KB |
ans=YES N=1867 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
ans=YES N=1 |
2 |
Correct |
1 ms |
320 KB |
ans=YES N=4 |
3 |
Correct |
1 ms |
324 KB |
ans=NO N=4 |
4 |
Correct |
1 ms |
316 KB |
ans=YES N=5 |
5 |
Correct |
1 ms |
284 KB |
ans=YES N=9 |
6 |
Correct |
1 ms |
212 KB |
ans=YES N=5 |
7 |
Correct |
1 ms |
212 KB |
ans=NO N=9 |
8 |
Correct |
1 ms |
212 KB |
ans=NO N=10 |
9 |
Correct |
1 ms |
212 KB |
ans=YES N=10 |
10 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
11 |
Correct |
0 ms |
212 KB |
ans=YES N=10 |
12 |
Correct |
0 ms |
212 KB |
ans=YES N=9 |
13 |
Correct |
0 ms |
316 KB |
ans=YES N=9 |
14 |
Correct |
0 ms |
212 KB |
ans=YES N=8 |
15 |
Correct |
1 ms |
320 KB |
ans=YES N=8 |
16 |
Correct |
1 ms |
212 KB |
ans=NO N=2 |
17 |
Correct |
1 ms |
212 KB |
ans=YES N=17 |
18 |
Correct |
1 ms |
328 KB |
ans=YES N=25 |
19 |
Correct |
1 ms |
340 KB |
ans=YES N=100 |
20 |
Correct |
2 ms |
340 KB |
ans=YES N=185 |
21 |
Correct |
1 ms |
212 KB |
ans=NO N=174 |
22 |
Correct |
1 ms |
340 KB |
ans=YES N=90 |
23 |
Correct |
1 ms |
340 KB |
ans=YES N=63 |
24 |
Correct |
1 ms |
340 KB |
ans=YES N=87 |
25 |
Correct |
2 ms |
340 KB |
ans=YES N=183 |
26 |
Correct |
2 ms |
340 KB |
ans=YES N=188 |
27 |
Correct |
2 ms |
340 KB |
ans=YES N=183 |
28 |
Correct |
2 ms |
340 KB |
ans=YES N=189 |
29 |
Correct |
2 ms |
340 KB |
ans=YES N=200 |
30 |
Correct |
2 ms |
324 KB |
ans=YES N=190 |
31 |
Correct |
2 ms |
340 KB |
ans=YES N=187 |
32 |
Correct |
2 ms |
340 KB |
ans=YES N=187 |
33 |
Correct |
2 ms |
340 KB |
ans=YES N=182 |
34 |
Correct |
2 ms |
340 KB |
ans=YES N=184 |
35 |
Correct |
2 ms |
468 KB |
ans=YES N=188 |
36 |
Correct |
2 ms |
340 KB |
ans=YES N=181 |
37 |
Correct |
2 ms |
452 KB |
ans=YES N=188 |
38 |
Correct |
2 ms |
468 KB |
ans=YES N=191 |
39 |
Correct |
1 ms |
316 KB |
ans=YES N=196 |
40 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
41 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
42 |
Correct |
1 ms |
340 KB |
ans=YES N=196 |
43 |
Correct |
2 ms |
340 KB |
ans=YES N=195 |
44 |
Correct |
3 ms |
468 KB |
ans=NO N=1934 |
45 |
Correct |
3 ms |
468 KB |
ans=NO N=1965 |
46 |
Correct |
15 ms |
596 KB |
ans=YES N=1824 |
47 |
Correct |
15 ms |
724 KB |
ans=YES N=1981 |
48 |
Correct |
13 ms |
596 KB |
ans=YES N=1814 |
49 |
Correct |
14 ms |
724 KB |
ans=YES N=1854 |
50 |
Correct |
14 ms |
596 KB |
ans=YES N=1831 |
51 |
Correct |
15 ms |
716 KB |
ans=YES N=2000 |
52 |
Correct |
14 ms |
856 KB |
ans=YES N=1847 |
53 |
Correct |
15 ms |
936 KB |
ans=YES N=1819 |
54 |
Correct |
15 ms |
724 KB |
ans=YES N=1986 |
55 |
Correct |
19 ms |
1100 KB |
ans=YES N=2000 |
56 |
Correct |
19 ms |
1392 KB |
ans=YES N=1834 |
57 |
Correct |
19 ms |
1336 KB |
ans=YES N=1860 |
58 |
Correct |
20 ms |
1320 KB |
ans=YES N=1898 |
59 |
Correct |
18 ms |
1244 KB |
ans=YES N=1832 |
60 |
Correct |
24 ms |
2168 KB |
ans=YES N=1929 |
61 |
Correct |
16 ms |
868 KB |
ans=YES N=1919 |
62 |
Correct |
19 ms |
1400 KB |
ans=YES N=1882 |
63 |
Correct |
25 ms |
2316 KB |
ans=YES N=1922 |
64 |
Correct |
16 ms |
980 KB |
ans=YES N=1989 |
65 |
Correct |
13 ms |
1272 KB |
ans=YES N=1978 |
66 |
Correct |
16 ms |
1444 KB |
ans=YES N=1867 |
67 |
Correct |
18 ms |
1096 KB |
ans=YES N=1942 |
68 |
Correct |
133 ms |
5940 KB |
ans=NO N=66151 |
69 |
Correct |
104 ms |
5808 KB |
ans=NO N=64333 |
70 |
Correct |
675 ms |
11468 KB |
ans=YES N=69316 |
71 |
Correct |
641 ms |
11228 KB |
ans=YES N=66695 |
72 |
Correct |
736 ms |
11556 KB |
ans=YES N=68436 |
73 |
Correct |
690 ms |
11680 KB |
ans=YES N=70000 |
74 |
Correct |
675 ms |
11864 KB |
ans=YES N=68501 |
75 |
Correct |
719 ms |
12364 KB |
ans=YES N=70000 |
76 |
Correct |
675 ms |
13160 KB |
ans=YES N=65009 |
77 |
Correct |
916 ms |
22172 KB |
ans=YES N=67007 |
78 |
Correct |
1014 ms |
28948 KB |
ans=YES N=66357 |
79 |
Correct |
1085 ms |
35924 KB |
ans=YES N=65430 |
80 |
Correct |
1106 ms |
30540 KB |
ans=YES N=65790 |
81 |
Correct |
1073 ms |
27740 KB |
ans=YES N=66020 |
82 |
Correct |
991 ms |
24248 KB |
ans=YES N=65809 |
83 |
Correct |
832 ms |
16196 KB |
ans=YES N=65651 |
84 |
Correct |
1462 ms |
40792 KB |
ans=YES N=68040 |
85 |
Correct |
1123 ms |
38476 KB |
ans=YES N=66570 |
86 |
Correct |
669 ms |
12216 KB |
ans=YES N=65421 |
87 |
Correct |
760 ms |
15784 KB |
ans=YES N=68351 |
88 |
Correct |
665 ms |
10988 KB |
ans=YES N=67027 |
89 |
Correct |
627 ms |
19988 KB |
ans=YES N=68879 |
90 |
Correct |
723 ms |
14452 KB |
ans=YES N=67256 |
91 |
Correct |
1721 ms |
24904 KB |
ans=YES N=148315 |
92 |
Correct |
243 ms |
12724 KB |
ans=NO N=142745 |
93 |
Correct |
178 ms |
14908 KB |
ans=NO N=148443 |
94 |
Correct |
1677 ms |
25392 KB |
ans=YES N=148328 |
95 |
Correct |
1740 ms |
25632 KB |
ans=YES N=147855 |
96 |
Correct |
1724 ms |
25936 KB |
ans=YES N=150000 |
97 |
Correct |
1747 ms |
25016 KB |
ans=YES N=144725 |
98 |
Correct |
1866 ms |
25880 KB |
ans=YES N=149445 |
99 |
Correct |
1665 ms |
25472 KB |
ans=YES N=144455 |
100 |
Correct |
1657 ms |
25036 KB |
ans=YES N=143487 |
101 |
Correct |
1705 ms |
26156 KB |
ans=YES N=149688 |
102 |
Correct |
2461 ms |
50092 KB |
ans=YES N=141481 |
103 |
Correct |
3050 ms |
95344 KB |
ans=YES N=147430 |
104 |
Correct |
2161 ms |
38708 KB |
ans=YES N=142247 |
105 |
Correct |
2527 ms |
47112 KB |
ans=YES N=149941 |
106 |
Correct |
2791 ms |
92124 KB |
ans=YES N=141635 |
107 |
Correct |
2847 ms |
65740 KB |
ans=YES N=142896 |
108 |
Correct |
3111 ms |
71636 KB |
ans=YES N=142069 |
109 |
Correct |
1892 ms |
30212 KB |
ans=YES N=142378 |
110 |
Correct |
2425 ms |
87968 KB |
ans=YES N=150000 |
111 |
Correct |
3078 ms |
130112 KB |
ans=YES N=141452 |
112 |
Correct |
2605 ms |
148124 KB |
ans=YES N=134453 |
113 |
Correct |
2377 ms |
156176 KB |
ans=YES N=144172 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
140 ms |
6004 KB |
ans=NO N=66151 |
2 |
Correct |
101 ms |
5836 KB |
ans=NO N=64333 |
3 |
Correct |
671 ms |
11432 KB |
ans=YES N=69316 |
4 |
Correct |
641 ms |
11176 KB |
ans=YES N=66695 |
5 |
Correct |
647 ms |
11568 KB |
ans=YES N=68436 |
6 |
Correct |
689 ms |
11736 KB |
ans=YES N=70000 |
7 |
Correct |
707 ms |
11784 KB |
ans=YES N=68501 |
8 |
Correct |
696 ms |
12292 KB |
ans=YES N=70000 |
9 |
Correct |
655 ms |
13140 KB |
ans=YES N=65009 |
10 |
Correct |
886 ms |
22200 KB |
ans=YES N=67007 |
11 |
Correct |
1094 ms |
29056 KB |
ans=YES N=66357 |
12 |
Correct |
1167 ms |
35932 KB |
ans=YES N=65430 |
13 |
Correct |
1169 ms |
30448 KB |
ans=YES N=65790 |
14 |
Correct |
1037 ms |
27836 KB |
ans=YES N=66020 |
15 |
Correct |
1016 ms |
24340 KB |
ans=YES N=65809 |
16 |
Correct |
785 ms |
16080 KB |
ans=YES N=65651 |
17 |
Correct |
1272 ms |
40764 KB |
ans=YES N=68040 |
18 |
Correct |
1162 ms |
38428 KB |
ans=YES N=66570 |
19 |
Correct |
701 ms |
12252 KB |
ans=YES N=65421 |
20 |
Correct |
762 ms |
15788 KB |
ans=YES N=68351 |
21 |
Correct |
659 ms |
11028 KB |
ans=YES N=67027 |
22 |
Correct |
654 ms |
20104 KB |
ans=YES N=68879 |
23 |
Correct |
753 ms |
14468 KB |
ans=YES N=67256 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
468 KB |
ans=NO N=1934 |
2 |
Correct |
3 ms |
460 KB |
ans=NO N=1965 |
3 |
Correct |
14 ms |
628 KB |
ans=YES N=1824 |
4 |
Correct |
14 ms |
720 KB |
ans=YES N=1981 |
5 |
Correct |
13 ms |
636 KB |
ans=YES N=1814 |
6 |
Correct |
15 ms |
724 KB |
ans=YES N=1854 |
7 |
Correct |
14 ms |
596 KB |
ans=YES N=1831 |
8 |
Correct |
15 ms |
756 KB |
ans=YES N=2000 |
9 |
Correct |
15 ms |
856 KB |
ans=YES N=1847 |
10 |
Correct |
17 ms |
852 KB |
ans=YES N=1819 |
11 |
Correct |
16 ms |
692 KB |
ans=YES N=1986 |
12 |
Correct |
19 ms |
1160 KB |
ans=YES N=2000 |
13 |
Correct |
18 ms |
1344 KB |
ans=YES N=1834 |
14 |
Correct |
19 ms |
1396 KB |
ans=YES N=1860 |
15 |
Correct |
20 ms |
1364 KB |
ans=YES N=1898 |
16 |
Correct |
18 ms |
1312 KB |
ans=YES N=1832 |
17 |
Correct |
22 ms |
2216 KB |
ans=YES N=1929 |
18 |
Correct |
16 ms |
872 KB |
ans=YES N=1919 |
19 |
Correct |
19 ms |
1408 KB |
ans=YES N=1882 |
20 |
Correct |
22 ms |
2296 KB |
ans=YES N=1922 |
21 |
Correct |
16 ms |
976 KB |
ans=YES N=1989 |
22 |
Correct |
15 ms |
1288 KB |
ans=YES N=1978 |
23 |
Correct |
16 ms |
1428 KB |
ans=YES N=1867 |
24 |
Correct |
140 ms |
6004 KB |
ans=NO N=66151 |
25 |
Correct |
101 ms |
5836 KB |
ans=NO N=64333 |
26 |
Correct |
671 ms |
11432 KB |
ans=YES N=69316 |
27 |
Correct |
641 ms |
11176 KB |
ans=YES N=66695 |
28 |
Correct |
647 ms |
11568 KB |
ans=YES N=68436 |
29 |
Correct |
689 ms |
11736 KB |
ans=YES N=70000 |
30 |
Correct |
707 ms |
11784 KB |
ans=YES N=68501 |
31 |
Correct |
696 ms |
12292 KB |
ans=YES N=70000 |
32 |
Correct |
655 ms |
13140 KB |
ans=YES N=65009 |
33 |
Correct |
886 ms |
22200 KB |
ans=YES N=67007 |
34 |
Correct |
1094 ms |
29056 KB |
ans=YES N=66357 |
35 |
Correct |
1167 ms |
35932 KB |
ans=YES N=65430 |
36 |
Correct |
1169 ms |
30448 KB |
ans=YES N=65790 |
37 |
Correct |
1037 ms |
27836 KB |
ans=YES N=66020 |
38 |
Correct |
1016 ms |
24340 KB |
ans=YES N=65809 |
39 |
Correct |
785 ms |
16080 KB |
ans=YES N=65651 |
40 |
Correct |
1272 ms |
40764 KB |
ans=YES N=68040 |
41 |
Correct |
1162 ms |
38428 KB |
ans=YES N=66570 |
42 |
Correct |
701 ms |
12252 KB |
ans=YES N=65421 |
43 |
Correct |
762 ms |
15788 KB |
ans=YES N=68351 |
44 |
Correct |
659 ms |
11028 KB |
ans=YES N=67027 |
45 |
Correct |
654 ms |
20104 KB |
ans=YES N=68879 |
46 |
Correct |
753 ms |
14468 KB |
ans=YES N=67256 |
47 |
Correct |
1752 ms |
24864 KB |
ans=YES N=148315 |
48 |
Correct |
232 ms |
12620 KB |
ans=NO N=142745 |
49 |
Correct |
188 ms |
14920 KB |
ans=NO N=148443 |
50 |
Correct |
1741 ms |
25460 KB |
ans=YES N=148328 |
51 |
Correct |
1735 ms |
25652 KB |
ans=YES N=147855 |
52 |
Correct |
1952 ms |
26060 KB |
ans=YES N=150000 |
53 |
Correct |
1698 ms |
25048 KB |
ans=YES N=144725 |
54 |
Correct |
1881 ms |
25752 KB |
ans=YES N=149445 |
55 |
Correct |
1664 ms |
25508 KB |
ans=YES N=144455 |
56 |
Correct |
1722 ms |
24972 KB |
ans=YES N=143487 |
57 |
Correct |
1751 ms |
26160 KB |
ans=YES N=149688 |
58 |
Correct |
2465 ms |
50196 KB |
ans=YES N=141481 |
59 |
Correct |
3009 ms |
95360 KB |
ans=YES N=147430 |
60 |
Correct |
2131 ms |
38720 KB |
ans=YES N=142247 |
61 |
Correct |
2477 ms |
47164 KB |
ans=YES N=149941 |
62 |
Correct |
2824 ms |
92016 KB |
ans=YES N=141635 |
63 |
Correct |
2890 ms |
65708 KB |
ans=YES N=142896 |
64 |
Correct |
2979 ms |
71660 KB |
ans=YES N=142069 |
65 |
Correct |
1820 ms |
30268 KB |
ans=YES N=142378 |
66 |
Correct |
2611 ms |
87972 KB |
ans=YES N=150000 |
67 |
Correct |
2995 ms |
130016 KB |
ans=YES N=141452 |
68 |
Correct |
2597 ms |
148092 KB |
ans=YES N=134453 |
69 |
Correct |
2432 ms |
156104 KB |
ans=YES N=144172 |