# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1059759 |
2024-08-15T07:55:29 Z |
pcc |
Fountain Parks (IOI21_parks) |
C++17 |
|
756 ms |
105676 KB |
#include "parks.h"
#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,sse4")
#define pii pair<int,int>
#define fs first
#define sc second
#define _all(T) T.begin(),T.end()
const int mxn = 2e5+10;
int N;
int S;
struct DSU{
int dsu[mxn];
DSU(){
iota(dsu,dsu+mxn,0);
}
int root(int k){
return k == dsu[k]?k:dsu[k] = root(dsu[k]);
}
void onion(int a,int b){
dsu[root(a)] = root(b);
}
};
DSU dsu;
vector<int> ans[4];
void addans(int s,int e,int x,int y){
dsu.onion(s,e);
ans[0].push_back(s);
ans[1].push_back(e);
ans[2].push_back(x);
ans[3].push_back(y);
return;
}
map<pii,int> mp;
vector<pii> edges;
vector<pii> all;
void check(int a,int b){
if(dsu.root(a) == dsu.root(b))return;
edges.push_back(pii(a,b));
dsu.onion(a,b);
return;
}
vector<int> lef[mxn],rig[mxn*2];
int mx[mxn],my[mxn*2];
int deg[mxn*6];
bitset<mxn> done;
void dfs(int now){
if(mx[now] != -1)return;
int tar = -1;
for(auto nxt:lef[now]){
if(my[nxt] == -1){
if(tar == -1)tar = nxt;
else if(tar != -1&°[nxt]>deg[tar])tar = nxt;
}
}
assert(tar != -1);
mx[now] = tar;
my[tar] = now;
for(auto nxt:rig[mx[now]]){
if(mx[nxt] == -1)dfs(nxt);
}
return;
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
S = clock();
if (x.size() == 1) {
build({}, {}, {}, {});
return 1;
}
N = x.size();
for(int i = 0;i<N;i++){
pii pos = pii(x[i],y[i]);
if(mp.find(pii(pos.fs,pos.sc-2)) != mp.end())check(mp[pii(pos.fs,pos.sc-2)],i);
if(mp.find(pii(pos.fs,pos.sc+2)) != mp.end())check(mp[pii(pos.fs,pos.sc+2)],i);
mp[pos] = i;
}
for(int i = 0;i<N;i++){
pii pos = pii(x[i],y[i]);
if(mp.find(pii(pos.fs-2,pos.sc)) != mp.end())check(mp[pii(pos.fs-2,pos.sc)],i);
if(mp.find(pii(pos.fs+2,pos.sc)) != mp.end())check(mp[pii(pos.fs+2,pos.sc)],i);
mp[pos] = i;
}
if(edges.size() != N-1)return 0;
for(int i = 0;i<edges.size();i++){
auto [s,e] = edges[i];
if(x[s]>x[e])swap(s,e);
if(x[s] == x[e]&&y[s]>y[e])swap(s,e);
if(x[s] == x[e]){
all.push_back(pii(x[s]-1,(y[s]+y[e])>>1));
all.push_back(pii(x[s]+1,(y[s]+y[e])>>1));
}
else if(y[s] == y[e]){
all.push_back(pii((x[s]+x[e])>>1,y[s]-1));
all.push_back(pii((x[s]+x[e])>>1,y[s]+1));
}
}
//cerr<<"EDGES: ";for(auto [s,e]:edges)cerr<<s<<' '<<e<<endl;
sort(all.begin(),all.end());all.erase(unique(all.begin(),all.end()),all.end());
for(int i = 0;i<edges.size();i++){
auto [s,e] = edges[i];
if(x[s] == x[e]){
int p = lower_bound(_all(all),pii(x[s]-1,(y[s]+y[e])>>1))-all.begin();
rig[p].push_back(i);
deg[p]++;
lef[i].push_back(p);
p = lower_bound(_all(all),pii(x[s]+1,(y[s]+y[e])>>1))-all.begin();
rig[p].push_back(i);
deg[p]++;
lef[i].push_back(p);
}
else if(y[s] == y[e]){
int p = lower_bound(_all(all),pii((x[s]+x[e])>>1,y[s]-1))-all.begin();
deg[p]++;
rig[p].push_back(i);
lef[i].push_back(p);
p = lower_bound(_all(all),pii((x[s]+x[e])>>1,y[s]+1))-all.begin();
rig[p].push_back(i);
deg[p]++;
lef[i].push_back(p);
}
}
queue<int> q;
for(int i = 0;i<all.size();i++){
if(deg[i] == 1)q.push(i);
}
memset(mx,-1,sizeof(mx));
memset(my,-1,sizeof(my));
while(!q.empty()){
auto now = q.front();
q.pop();
int tar = -1;
for(auto nxt:rig[now]){
if(mx[nxt] == -1)tar = nxt;
}
if(tar == -1)continue;
mx[tar] = now;
my[now] = tar;
for(auto nxt:lef[tar]){
deg[nxt]--;
if(deg[nxt] == 1)q.push(nxt);
}
}
for(int i = 0;i<all.size();i++){
if(my[i] != -1)continue;
if(deg[i] == 3){
int tar = -1;
vector<int> v;
map<int,int> mp;
for(auto &j:rig[i]){
if(mx[j] != -1)continue;
auto &[s,e]=edges[j];
mp[s]++;
mp[e]++;
if(x[s]>x[e]||(x[s] == x[e]&&y[s]>y[e]))swap(s,e);
v.push_back(j);
}
pii pos = pii(-1,-1);
for(auto &j:mp){
if(j.sc>1){
if(pos.fs == -1)pos.fs = j.fs;
else pos.sc = j.fs;
}
}
if(v.size() != 3)exit(0);
assert(v.size() == 3);
for(auto &j:v){
auto now = edges[j];
if(now.fs == pos.fs&&now.sc == pos.sc)tar = j;
else if(now.fs == pos.sc&&now.sc == pos.fs)tar = j;
}
if(tar == -1)exit(0);
assert(tar != -1);
mx[tar] = i;
my[i] = tar;
for(auto &j:rig[i]){
if(mx[j] == -1)dfs(j);
}
}
}
for(int i = 0;i<edges.size();i++){
if(mx[i] != -1)continue;
dfs(i);
}
for(int i = 0;i<edges.size();i++){
if(mx[i] == -1)return 0;
int tar = mx[i];
addans(edges[i].fs,edges[i].sc,all[tar].fs,all[tar].sc);
}
build(ans[0],ans[1],ans[2],ans[3]);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:97:18: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
97 | if(edges.size() != N-1)return 0;
| ~~~~~~~~~~~~~^~~~~~
parks.cpp:98:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
98 | for(int i = 0;i<edges.size();i++){
| ~^~~~~~~~~~~~~
parks.cpp:113:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
113 | for(int i = 0;i<edges.size();i++){
| ~^~~~~~~~~~~~~
parks.cpp:138:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
138 | for(int i = 0;i<all.size();i++){
| ~^~~~~~~~~~~
parks.cpp:161:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
161 | for(int i = 0;i<all.size();i++){
| ~^~~~~~~~~~~
parks.cpp:199:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
199 | for(int i = 0;i<edges.size();i++){
| ~^~~~~~~~~~~~~
parks.cpp:205:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
205 | for(int i = 0;i<edges.size();i++){
| ~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
15196 KB |
Output is correct |
2 |
Correct |
7 ms |
17500 KB |
Output is correct |
3 |
Correct |
6 ms |
15192 KB |
Output is correct |
4 |
Correct |
7 ms |
17620 KB |
Output is correct |
5 |
Correct |
7 ms |
17500 KB |
Output is correct |
6 |
Correct |
6 ms |
15196 KB |
Output is correct |
7 |
Correct |
6 ms |
15196 KB |
Output is correct |
8 |
Correct |
6 ms |
15192 KB |
Output is correct |
9 |
Correct |
204 ms |
45228 KB |
Output is correct |
10 |
Correct |
18 ms |
20444 KB |
Output is correct |
11 |
Correct |
76 ms |
33144 KB |
Output is correct |
12 |
Correct |
25 ms |
21980 KB |
Output is correct |
13 |
Correct |
39 ms |
19480 KB |
Output is correct |
14 |
Correct |
6 ms |
15196 KB |
Output is correct |
15 |
Correct |
7 ms |
15448 KB |
Output is correct |
16 |
Correct |
212 ms |
45372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
15196 KB |
Output is correct |
2 |
Correct |
7 ms |
17500 KB |
Output is correct |
3 |
Correct |
6 ms |
15192 KB |
Output is correct |
4 |
Correct |
7 ms |
17620 KB |
Output is correct |
5 |
Correct |
7 ms |
17500 KB |
Output is correct |
6 |
Correct |
6 ms |
15196 KB |
Output is correct |
7 |
Correct |
6 ms |
15196 KB |
Output is correct |
8 |
Correct |
6 ms |
15192 KB |
Output is correct |
9 |
Correct |
204 ms |
45228 KB |
Output is correct |
10 |
Correct |
18 ms |
20444 KB |
Output is correct |
11 |
Correct |
76 ms |
33144 KB |
Output is correct |
12 |
Correct |
25 ms |
21980 KB |
Output is correct |
13 |
Correct |
39 ms |
19480 KB |
Output is correct |
14 |
Correct |
6 ms |
15196 KB |
Output is correct |
15 |
Correct |
7 ms |
15448 KB |
Output is correct |
16 |
Correct |
212 ms |
45372 KB |
Output is correct |
17 |
Correct |
7 ms |
17500 KB |
Output is correct |
18 |
Correct |
7 ms |
17500 KB |
Output is correct |
19 |
Correct |
7 ms |
17500 KB |
Output is correct |
20 |
Correct |
7 ms |
17428 KB |
Output is correct |
21 |
Correct |
6 ms |
15196 KB |
Output is correct |
22 |
Correct |
7 ms |
17640 KB |
Output is correct |
23 |
Correct |
530 ms |
70704 KB |
Output is correct |
24 |
Correct |
7 ms |
17500 KB |
Output is correct |
25 |
Correct |
8 ms |
17756 KB |
Output is correct |
26 |
Correct |
8 ms |
15448 KB |
Output is correct |
27 |
Correct |
9 ms |
15636 KB |
Output is correct |
28 |
Correct |
188 ms |
38448 KB |
Output is correct |
29 |
Correct |
285 ms |
49388 KB |
Output is correct |
30 |
Correct |
477 ms |
59292 KB |
Output is correct |
31 |
Correct |
526 ms |
70684 KB |
Output is correct |
32 |
Correct |
7 ms |
17496 KB |
Output is correct |
33 |
Correct |
7 ms |
17500 KB |
Output is correct |
34 |
Correct |
7 ms |
17496 KB |
Output is correct |
35 |
Correct |
6 ms |
15196 KB |
Output is correct |
36 |
Correct |
6 ms |
15256 KB |
Output is correct |
37 |
Correct |
8 ms |
17496 KB |
Output is correct |
38 |
Correct |
7 ms |
17496 KB |
Output is correct |
39 |
Correct |
7 ms |
17500 KB |
Output is correct |
40 |
Correct |
7 ms |
17500 KB |
Output is correct |
41 |
Correct |
6 ms |
15192 KB |
Output is correct |
42 |
Correct |
7 ms |
17500 KB |
Output is correct |
43 |
Correct |
7 ms |
15452 KB |
Output is correct |
44 |
Correct |
9 ms |
15500 KB |
Output is correct |
45 |
Correct |
230 ms |
43232 KB |
Output is correct |
46 |
Correct |
362 ms |
55244 KB |
Output is correct |
47 |
Correct |
363 ms |
54728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
15196 KB |
Output is correct |
2 |
Correct |
7 ms |
17500 KB |
Output is correct |
3 |
Correct |
6 ms |
15192 KB |
Output is correct |
4 |
Correct |
7 ms |
17620 KB |
Output is correct |
5 |
Correct |
7 ms |
17500 KB |
Output is correct |
6 |
Correct |
6 ms |
15196 KB |
Output is correct |
7 |
Correct |
6 ms |
15196 KB |
Output is correct |
8 |
Correct |
6 ms |
15192 KB |
Output is correct |
9 |
Correct |
204 ms |
45228 KB |
Output is correct |
10 |
Correct |
18 ms |
20444 KB |
Output is correct |
11 |
Correct |
76 ms |
33144 KB |
Output is correct |
12 |
Correct |
25 ms |
21980 KB |
Output is correct |
13 |
Correct |
39 ms |
19480 KB |
Output is correct |
14 |
Correct |
6 ms |
15196 KB |
Output is correct |
15 |
Correct |
7 ms |
15448 KB |
Output is correct |
16 |
Correct |
212 ms |
45372 KB |
Output is correct |
17 |
Correct |
7 ms |
17500 KB |
Output is correct |
18 |
Correct |
7 ms |
17500 KB |
Output is correct |
19 |
Correct |
7 ms |
17500 KB |
Output is correct |
20 |
Correct |
7 ms |
17428 KB |
Output is correct |
21 |
Correct |
6 ms |
15196 KB |
Output is correct |
22 |
Correct |
7 ms |
17640 KB |
Output is correct |
23 |
Correct |
530 ms |
70704 KB |
Output is correct |
24 |
Correct |
7 ms |
17500 KB |
Output is correct |
25 |
Correct |
8 ms |
17756 KB |
Output is correct |
26 |
Correct |
8 ms |
15448 KB |
Output is correct |
27 |
Correct |
9 ms |
15636 KB |
Output is correct |
28 |
Correct |
188 ms |
38448 KB |
Output is correct |
29 |
Correct |
285 ms |
49388 KB |
Output is correct |
30 |
Correct |
477 ms |
59292 KB |
Output is correct |
31 |
Correct |
526 ms |
70684 KB |
Output is correct |
32 |
Correct |
7 ms |
17496 KB |
Output is correct |
33 |
Correct |
7 ms |
17500 KB |
Output is correct |
34 |
Correct |
7 ms |
17496 KB |
Output is correct |
35 |
Correct |
6 ms |
15196 KB |
Output is correct |
36 |
Correct |
6 ms |
15256 KB |
Output is correct |
37 |
Correct |
8 ms |
17496 KB |
Output is correct |
38 |
Correct |
7 ms |
17496 KB |
Output is correct |
39 |
Correct |
7 ms |
17500 KB |
Output is correct |
40 |
Correct |
7 ms |
17500 KB |
Output is correct |
41 |
Correct |
6 ms |
15192 KB |
Output is correct |
42 |
Correct |
7 ms |
17500 KB |
Output is correct |
43 |
Correct |
7 ms |
15452 KB |
Output is correct |
44 |
Correct |
9 ms |
15500 KB |
Output is correct |
45 |
Correct |
230 ms |
43232 KB |
Output is correct |
46 |
Correct |
362 ms |
55244 KB |
Output is correct |
47 |
Correct |
363 ms |
54728 KB |
Output is correct |
48 |
Correct |
8 ms |
17500 KB |
Output is correct |
49 |
Correct |
8 ms |
17496 KB |
Output is correct |
50 |
Correct |
8 ms |
17488 KB |
Output is correct |
51 |
Correct |
8 ms |
17468 KB |
Output is correct |
52 |
Correct |
7 ms |
17500 KB |
Output is correct |
53 |
Correct |
7 ms |
17628 KB |
Output is correct |
54 |
Correct |
7 ms |
17500 KB |
Output is correct |
55 |
Correct |
570 ms |
68384 KB |
Output is correct |
56 |
Correct |
7 ms |
17500 KB |
Output is correct |
57 |
Correct |
9 ms |
18008 KB |
Output is correct |
58 |
Correct |
17 ms |
19032 KB |
Output is correct |
59 |
Correct |
15 ms |
16096 KB |
Output is correct |
60 |
Correct |
244 ms |
42800 KB |
Output is correct |
61 |
Correct |
363 ms |
52388 KB |
Output is correct |
62 |
Correct |
458 ms |
60208 KB |
Output is correct |
63 |
Correct |
614 ms |
68380 KB |
Output is correct |
64 |
Correct |
6 ms |
15196 KB |
Output is correct |
65 |
Correct |
7 ms |
17532 KB |
Output is correct |
66 |
Correct |
6 ms |
15124 KB |
Output is correct |
67 |
Correct |
497 ms |
73284 KB |
Output is correct |
68 |
Correct |
462 ms |
73468 KB |
Output is correct |
69 |
Correct |
504 ms |
73156 KB |
Output is correct |
70 |
Correct |
10 ms |
15448 KB |
Output is correct |
71 |
Correct |
12 ms |
16040 KB |
Output is correct |
72 |
Correct |
235 ms |
43340 KB |
Output is correct |
73 |
Correct |
404 ms |
56188 KB |
Output is correct |
74 |
Correct |
572 ms |
69664 KB |
Output is correct |
75 |
Correct |
541 ms |
70376 KB |
Output is correct |
76 |
Correct |
465 ms |
73500 KB |
Output is correct |
77 |
Correct |
10 ms |
15704 KB |
Output is correct |
78 |
Correct |
13 ms |
16220 KB |
Output is correct |
79 |
Correct |
235 ms |
43568 KB |
Output is correct |
80 |
Correct |
401 ms |
56876 KB |
Output is correct |
81 |
Correct |
557 ms |
69660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
15196 KB |
Output is correct |
2 |
Correct |
7 ms |
17500 KB |
Output is correct |
3 |
Correct |
6 ms |
15192 KB |
Output is correct |
4 |
Correct |
7 ms |
17620 KB |
Output is correct |
5 |
Correct |
7 ms |
17500 KB |
Output is correct |
6 |
Correct |
6 ms |
15196 KB |
Output is correct |
7 |
Correct |
6 ms |
15196 KB |
Output is correct |
8 |
Correct |
6 ms |
15192 KB |
Output is correct |
9 |
Correct |
204 ms |
45228 KB |
Output is correct |
10 |
Correct |
18 ms |
20444 KB |
Output is correct |
11 |
Correct |
76 ms |
33144 KB |
Output is correct |
12 |
Correct |
25 ms |
21980 KB |
Output is correct |
13 |
Correct |
39 ms |
19480 KB |
Output is correct |
14 |
Correct |
6 ms |
15196 KB |
Output is correct |
15 |
Correct |
7 ms |
15448 KB |
Output is correct |
16 |
Correct |
212 ms |
45372 KB |
Output is correct |
17 |
Correct |
7 ms |
17496 KB |
Output is correct |
18 |
Correct |
9 ms |
17500 KB |
Output is correct |
19 |
Correct |
6 ms |
15196 KB |
Output is correct |
20 |
Correct |
529 ms |
67612 KB |
Output is correct |
21 |
Correct |
521 ms |
67172 KB |
Output is correct |
22 |
Correct |
524 ms |
67104 KB |
Output is correct |
23 |
Correct |
416 ms |
66052 KB |
Output is correct |
24 |
Correct |
219 ms |
32624 KB |
Output is correct |
25 |
Correct |
381 ms |
34552 KB |
Output is correct |
26 |
Correct |
258 ms |
34136 KB |
Output is correct |
27 |
Correct |
490 ms |
73248 KB |
Output is correct |
28 |
Correct |
512 ms |
72220 KB |
Output is correct |
29 |
Correct |
599 ms |
73012 KB |
Output is correct |
30 |
Correct |
622 ms |
73324 KB |
Output is correct |
31 |
Correct |
8 ms |
17500 KB |
Output is correct |
32 |
Correct |
34 ms |
21268 KB |
Output is correct |
33 |
Correct |
102 ms |
24148 KB |
Output is correct |
34 |
Correct |
568 ms |
67612 KB |
Output is correct |
35 |
Correct |
16 ms |
16220 KB |
Output is correct |
36 |
Correct |
73 ms |
20540 KB |
Output is correct |
37 |
Correct |
159 ms |
25288 KB |
Output is correct |
38 |
Correct |
234 ms |
38432 KB |
Output is correct |
39 |
Correct |
292 ms |
45616 KB |
Output is correct |
40 |
Correct |
417 ms |
54444 KB |
Output is correct |
41 |
Correct |
571 ms |
61696 KB |
Output is correct |
42 |
Correct |
599 ms |
68784 KB |
Output is correct |
43 |
Correct |
7 ms |
17500 KB |
Output is correct |
44 |
Correct |
7 ms |
17448 KB |
Output is correct |
45 |
Correct |
7 ms |
17620 KB |
Output is correct |
46 |
Correct |
6 ms |
15196 KB |
Output is correct |
47 |
Correct |
6 ms |
15192 KB |
Output is correct |
48 |
Correct |
7 ms |
17500 KB |
Output is correct |
49 |
Correct |
7 ms |
17552 KB |
Output is correct |
50 |
Correct |
8 ms |
17500 KB |
Output is correct |
51 |
Correct |
8 ms |
17500 KB |
Output is correct |
52 |
Correct |
7 ms |
15196 KB |
Output is correct |
53 |
Correct |
8 ms |
17660 KB |
Output is correct |
54 |
Correct |
7 ms |
15300 KB |
Output is correct |
55 |
Correct |
12 ms |
15448 KB |
Output is correct |
56 |
Correct |
230 ms |
43240 KB |
Output is correct |
57 |
Correct |
389 ms |
55244 KB |
Output is correct |
58 |
Correct |
366 ms |
55244 KB |
Output is correct |
59 |
Correct |
6 ms |
15196 KB |
Output is correct |
60 |
Correct |
6 ms |
17500 KB |
Output is correct |
61 |
Correct |
7 ms |
15196 KB |
Output is correct |
62 |
Correct |
481 ms |
73500 KB |
Output is correct |
63 |
Correct |
518 ms |
73468 KB |
Output is correct |
64 |
Correct |
524 ms |
73128 KB |
Output is correct |
65 |
Correct |
11 ms |
15452 KB |
Output is correct |
66 |
Correct |
13 ms |
15964 KB |
Output is correct |
67 |
Correct |
251 ms |
43284 KB |
Output is correct |
68 |
Correct |
421 ms |
56200 KB |
Output is correct |
69 |
Correct |
574 ms |
69660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
15196 KB |
Output is correct |
2 |
Correct |
7 ms |
17500 KB |
Output is correct |
3 |
Correct |
6 ms |
15192 KB |
Output is correct |
4 |
Correct |
7 ms |
17620 KB |
Output is correct |
5 |
Correct |
7 ms |
17500 KB |
Output is correct |
6 |
Correct |
6 ms |
15196 KB |
Output is correct |
7 |
Correct |
6 ms |
15196 KB |
Output is correct |
8 |
Correct |
6 ms |
15192 KB |
Output is correct |
9 |
Correct |
204 ms |
45228 KB |
Output is correct |
10 |
Correct |
18 ms |
20444 KB |
Output is correct |
11 |
Correct |
76 ms |
33144 KB |
Output is correct |
12 |
Correct |
25 ms |
21980 KB |
Output is correct |
13 |
Correct |
39 ms |
19480 KB |
Output is correct |
14 |
Correct |
6 ms |
15196 KB |
Output is correct |
15 |
Correct |
7 ms |
15448 KB |
Output is correct |
16 |
Correct |
212 ms |
45372 KB |
Output is correct |
17 |
Correct |
499 ms |
74208 KB |
Output is correct |
18 |
Correct |
509 ms |
74428 KB |
Output is correct |
19 |
Correct |
597 ms |
67100 KB |
Output is correct |
20 |
Correct |
650 ms |
67224 KB |
Output is correct |
21 |
Correct |
549 ms |
64560 KB |
Output is correct |
22 |
Correct |
9 ms |
17500 KB |
Output is correct |
23 |
Correct |
84 ms |
25908 KB |
Output is correct |
24 |
Correct |
38 ms |
17328 KB |
Output is correct |
25 |
Correct |
123 ms |
22712 KB |
Output is correct |
26 |
Correct |
230 ms |
27076 KB |
Output is correct |
27 |
Correct |
328 ms |
44084 KB |
Output is correct |
28 |
Correct |
412 ms |
50716 KB |
Output is correct |
29 |
Correct |
489 ms |
57392 KB |
Output is correct |
30 |
Correct |
620 ms |
62944 KB |
Output is correct |
31 |
Correct |
756 ms |
70856 KB |
Output is correct |
32 |
Correct |
664 ms |
70324 KB |
Output is correct |
33 |
Correct |
523 ms |
73484 KB |
Output is correct |
34 |
Correct |
13 ms |
15584 KB |
Output is correct |
35 |
Correct |
20 ms |
16112 KB |
Output is correct |
36 |
Correct |
259 ms |
43428 KB |
Output is correct |
37 |
Correct |
450 ms |
56968 KB |
Output is correct |
38 |
Correct |
611 ms |
69708 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
15196 KB |
Output is correct |
2 |
Correct |
7 ms |
17500 KB |
Output is correct |
3 |
Correct |
6 ms |
15192 KB |
Output is correct |
4 |
Correct |
7 ms |
17620 KB |
Output is correct |
5 |
Correct |
7 ms |
17500 KB |
Output is correct |
6 |
Correct |
6 ms |
15196 KB |
Output is correct |
7 |
Correct |
6 ms |
15196 KB |
Output is correct |
8 |
Correct |
6 ms |
15192 KB |
Output is correct |
9 |
Correct |
204 ms |
45228 KB |
Output is correct |
10 |
Correct |
18 ms |
20444 KB |
Output is correct |
11 |
Correct |
76 ms |
33144 KB |
Output is correct |
12 |
Correct |
25 ms |
21980 KB |
Output is correct |
13 |
Correct |
39 ms |
19480 KB |
Output is correct |
14 |
Correct |
6 ms |
15196 KB |
Output is correct |
15 |
Correct |
7 ms |
15448 KB |
Output is correct |
16 |
Correct |
212 ms |
45372 KB |
Output is correct |
17 |
Correct |
7 ms |
17500 KB |
Output is correct |
18 |
Correct |
7 ms |
17500 KB |
Output is correct |
19 |
Correct |
7 ms |
17500 KB |
Output is correct |
20 |
Correct |
7 ms |
17428 KB |
Output is correct |
21 |
Correct |
6 ms |
15196 KB |
Output is correct |
22 |
Correct |
7 ms |
17640 KB |
Output is correct |
23 |
Correct |
530 ms |
70704 KB |
Output is correct |
24 |
Correct |
7 ms |
17500 KB |
Output is correct |
25 |
Correct |
8 ms |
17756 KB |
Output is correct |
26 |
Correct |
8 ms |
15448 KB |
Output is correct |
27 |
Correct |
9 ms |
15636 KB |
Output is correct |
28 |
Correct |
188 ms |
38448 KB |
Output is correct |
29 |
Correct |
285 ms |
49388 KB |
Output is correct |
30 |
Correct |
477 ms |
59292 KB |
Output is correct |
31 |
Correct |
526 ms |
70684 KB |
Output is correct |
32 |
Correct |
7 ms |
17496 KB |
Output is correct |
33 |
Correct |
7 ms |
17500 KB |
Output is correct |
34 |
Correct |
7 ms |
17496 KB |
Output is correct |
35 |
Correct |
6 ms |
15196 KB |
Output is correct |
36 |
Correct |
6 ms |
15256 KB |
Output is correct |
37 |
Correct |
8 ms |
17496 KB |
Output is correct |
38 |
Correct |
7 ms |
17496 KB |
Output is correct |
39 |
Correct |
7 ms |
17500 KB |
Output is correct |
40 |
Correct |
7 ms |
17500 KB |
Output is correct |
41 |
Correct |
6 ms |
15192 KB |
Output is correct |
42 |
Correct |
7 ms |
17500 KB |
Output is correct |
43 |
Correct |
7 ms |
15452 KB |
Output is correct |
44 |
Correct |
9 ms |
15500 KB |
Output is correct |
45 |
Correct |
230 ms |
43232 KB |
Output is correct |
46 |
Correct |
362 ms |
55244 KB |
Output is correct |
47 |
Correct |
363 ms |
54728 KB |
Output is correct |
48 |
Correct |
8 ms |
17500 KB |
Output is correct |
49 |
Correct |
8 ms |
17496 KB |
Output is correct |
50 |
Correct |
8 ms |
17488 KB |
Output is correct |
51 |
Correct |
8 ms |
17468 KB |
Output is correct |
52 |
Correct |
7 ms |
17500 KB |
Output is correct |
53 |
Correct |
7 ms |
17628 KB |
Output is correct |
54 |
Correct |
7 ms |
17500 KB |
Output is correct |
55 |
Correct |
570 ms |
68384 KB |
Output is correct |
56 |
Correct |
7 ms |
17500 KB |
Output is correct |
57 |
Correct |
9 ms |
18008 KB |
Output is correct |
58 |
Correct |
17 ms |
19032 KB |
Output is correct |
59 |
Correct |
15 ms |
16096 KB |
Output is correct |
60 |
Correct |
244 ms |
42800 KB |
Output is correct |
61 |
Correct |
363 ms |
52388 KB |
Output is correct |
62 |
Correct |
458 ms |
60208 KB |
Output is correct |
63 |
Correct |
614 ms |
68380 KB |
Output is correct |
64 |
Correct |
6 ms |
15196 KB |
Output is correct |
65 |
Correct |
7 ms |
17532 KB |
Output is correct |
66 |
Correct |
6 ms |
15124 KB |
Output is correct |
67 |
Correct |
497 ms |
73284 KB |
Output is correct |
68 |
Correct |
462 ms |
73468 KB |
Output is correct |
69 |
Correct |
504 ms |
73156 KB |
Output is correct |
70 |
Correct |
10 ms |
15448 KB |
Output is correct |
71 |
Correct |
12 ms |
16040 KB |
Output is correct |
72 |
Correct |
235 ms |
43340 KB |
Output is correct |
73 |
Correct |
404 ms |
56188 KB |
Output is correct |
74 |
Correct |
572 ms |
69664 KB |
Output is correct |
75 |
Correct |
541 ms |
70376 KB |
Output is correct |
76 |
Correct |
465 ms |
73500 KB |
Output is correct |
77 |
Correct |
10 ms |
15704 KB |
Output is correct |
78 |
Correct |
13 ms |
16220 KB |
Output is correct |
79 |
Correct |
235 ms |
43568 KB |
Output is correct |
80 |
Correct |
401 ms |
56876 KB |
Output is correct |
81 |
Correct |
557 ms |
69660 KB |
Output is correct |
82 |
Correct |
7 ms |
17496 KB |
Output is correct |
83 |
Correct |
9 ms |
17500 KB |
Output is correct |
84 |
Correct |
6 ms |
15196 KB |
Output is correct |
85 |
Correct |
529 ms |
67612 KB |
Output is correct |
86 |
Correct |
521 ms |
67172 KB |
Output is correct |
87 |
Correct |
524 ms |
67104 KB |
Output is correct |
88 |
Correct |
416 ms |
66052 KB |
Output is correct |
89 |
Correct |
219 ms |
32624 KB |
Output is correct |
90 |
Correct |
381 ms |
34552 KB |
Output is correct |
91 |
Correct |
258 ms |
34136 KB |
Output is correct |
92 |
Correct |
490 ms |
73248 KB |
Output is correct |
93 |
Correct |
512 ms |
72220 KB |
Output is correct |
94 |
Correct |
599 ms |
73012 KB |
Output is correct |
95 |
Correct |
622 ms |
73324 KB |
Output is correct |
96 |
Correct |
8 ms |
17500 KB |
Output is correct |
97 |
Correct |
34 ms |
21268 KB |
Output is correct |
98 |
Correct |
102 ms |
24148 KB |
Output is correct |
99 |
Correct |
568 ms |
67612 KB |
Output is correct |
100 |
Correct |
16 ms |
16220 KB |
Output is correct |
101 |
Correct |
73 ms |
20540 KB |
Output is correct |
102 |
Correct |
159 ms |
25288 KB |
Output is correct |
103 |
Correct |
234 ms |
38432 KB |
Output is correct |
104 |
Correct |
292 ms |
45616 KB |
Output is correct |
105 |
Correct |
417 ms |
54444 KB |
Output is correct |
106 |
Correct |
571 ms |
61696 KB |
Output is correct |
107 |
Correct |
599 ms |
68784 KB |
Output is correct |
108 |
Correct |
7 ms |
17500 KB |
Output is correct |
109 |
Correct |
7 ms |
17448 KB |
Output is correct |
110 |
Correct |
7 ms |
17620 KB |
Output is correct |
111 |
Correct |
6 ms |
15196 KB |
Output is correct |
112 |
Correct |
6 ms |
15192 KB |
Output is correct |
113 |
Correct |
7 ms |
17500 KB |
Output is correct |
114 |
Correct |
7 ms |
17552 KB |
Output is correct |
115 |
Correct |
8 ms |
17500 KB |
Output is correct |
116 |
Correct |
8 ms |
17500 KB |
Output is correct |
117 |
Correct |
7 ms |
15196 KB |
Output is correct |
118 |
Correct |
8 ms |
17660 KB |
Output is correct |
119 |
Correct |
7 ms |
15300 KB |
Output is correct |
120 |
Correct |
12 ms |
15448 KB |
Output is correct |
121 |
Correct |
230 ms |
43240 KB |
Output is correct |
122 |
Correct |
389 ms |
55244 KB |
Output is correct |
123 |
Correct |
366 ms |
55244 KB |
Output is correct |
124 |
Correct |
6 ms |
15196 KB |
Output is correct |
125 |
Correct |
6 ms |
17500 KB |
Output is correct |
126 |
Correct |
7 ms |
15196 KB |
Output is correct |
127 |
Correct |
481 ms |
73500 KB |
Output is correct |
128 |
Correct |
518 ms |
73468 KB |
Output is correct |
129 |
Correct |
524 ms |
73128 KB |
Output is correct |
130 |
Correct |
11 ms |
15452 KB |
Output is correct |
131 |
Correct |
13 ms |
15964 KB |
Output is correct |
132 |
Correct |
251 ms |
43284 KB |
Output is correct |
133 |
Correct |
421 ms |
56200 KB |
Output is correct |
134 |
Correct |
574 ms |
69660 KB |
Output is correct |
135 |
Correct |
499 ms |
74208 KB |
Output is correct |
136 |
Correct |
509 ms |
74428 KB |
Output is correct |
137 |
Correct |
597 ms |
67100 KB |
Output is correct |
138 |
Correct |
650 ms |
67224 KB |
Output is correct |
139 |
Correct |
549 ms |
64560 KB |
Output is correct |
140 |
Correct |
9 ms |
17500 KB |
Output is correct |
141 |
Correct |
84 ms |
25908 KB |
Output is correct |
142 |
Correct |
38 ms |
17328 KB |
Output is correct |
143 |
Correct |
123 ms |
22712 KB |
Output is correct |
144 |
Correct |
230 ms |
27076 KB |
Output is correct |
145 |
Correct |
328 ms |
44084 KB |
Output is correct |
146 |
Correct |
412 ms |
50716 KB |
Output is correct |
147 |
Correct |
489 ms |
57392 KB |
Output is correct |
148 |
Correct |
620 ms |
62944 KB |
Output is correct |
149 |
Correct |
756 ms |
70856 KB |
Output is correct |
150 |
Correct |
664 ms |
70324 KB |
Output is correct |
151 |
Correct |
523 ms |
73484 KB |
Output is correct |
152 |
Correct |
13 ms |
15584 KB |
Output is correct |
153 |
Correct |
20 ms |
16112 KB |
Output is correct |
154 |
Correct |
259 ms |
43428 KB |
Output is correct |
155 |
Correct |
450 ms |
56968 KB |
Output is correct |
156 |
Correct |
611 ms |
69708 KB |
Output is correct |
157 |
Correct |
7 ms |
17500 KB |
Output is correct |
158 |
Correct |
9 ms |
15312 KB |
Output is correct |
159 |
Correct |
9 ms |
17620 KB |
Output is correct |
160 |
Correct |
8 ms |
17620 KB |
Output is correct |
161 |
Runtime error |
662 ms |
105676 KB |
Execution killed with signal 6 |
162 |
Halted |
0 ms |
0 KB |
- |