#include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define pb push_back
using namespace std;
const int N = 1e6+6,inf = 1e8;
int F[N],ANS[N];
vector<pii> Q[N*4];
void qer(int v,int tl,int tr,int l,int r,int QL,int QR) {
if (l > tr || r < tl) return;
if (l <= tl && r >= tr) {
Q[v].pb({QL,QR});
return;
}
int tm = (tl + tr)/2;
qer(v*2,tl,tm,l,r,QL,QR);
qer(v*2+1,tm+1,tr,l,r,QL,QR);
}
int cans=INT_MAX;
int t[2][4*N],timer;
int *H[61000000];
int val[61000000];
void change(int&x,int c) {
++timer;
H[timer] = &x;
val[timer] = x;
x = c;
}
void rollback() {
(*H[timer]) = val[timer];
timer--;
}
bool type;
int VAL,pos,L,R;
void add(int v,int tl,int tr) {
if (tl == tr) {
if (type == 0)
change(t[0][v],min(t[0][v],VAL));
else change(t[1][v],max(t[1][v],VAL));
return;
}
int tm = (tl + tr)/2;
if (pos <= tm) {
add(v*2,tl,tm);
}
else add(v*2+1,tm+1,tr);
if (type == 0)
change(t[0][v],min(t[0][v*2],t[0][v*2+1]));
else
change(t[1][v],max(t[1][v*2],t[1][v*2+1]));
}
int get(int v,int tl,int tr) {
if (L> tr || R < tl) {
if (type == 0) return inf;
else return -inf;
}
if (L <= tl && R >= tr) return t[type][v];
int tm = (tl + tr)/2;
if (type == 0)
return min(get(v*2,tl,tm),get(v*2+1,tm+1,tr));
else return max(get(v*2,tl,tm),get(v*2+1,tm+1,tr));
}
void dfs(int v,int tl,int tr) {
int in_ans = cans;
int start_time = timer;
if (timer > 60000000) {
while(true) {
}
}
for (auto i1 : Q[v]) {
int l = i1.fi;
int r = i1.se;
type = 0;
L = r;
R = 1e6;
type = 0;
if (cans > r - l)
cans = min(cans, -l + get(1,1,1e6));
L = 1;
R = l;type = 1;
if (cans > r - l)
cans = min(cans, r - get(1,1,1e6));
pos = l;
VAL = r;
type = 0;
add(1,1,1e6); // l-ze patara r-ebshi udidesi l, r-ze did l-ebshi umciresi r
pos = r;
VAL = l;
type = 1;
add(1,1,1e6);
}
if (tl != tr) {
int tm = (tl + tr)/2;
dfs(v*2,tl,tm);
dfs(v*2+1,tm+1,tr);
}else {
if (F[tl])
ANS[tl] = cans;
}
while(start_time != timer) {
rollback();
}
cans = in_ans;
}
main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int q;
cin >> q;
multiset<int> L,R;
multiset<int> AL[1000004],AR[1000004];
for (int i = 0; i < 4*N;i ++)
t[0][i] = inf, t[1][i] = -inf;
vector<pair<pii,char> > query(q+1);
vector<pii> t(q);
for (int i = 1; i <= q; i++) {
char c;
int l,r;
cin >> c >> l >> r;
query[i] = {{l,r},c};
t[i-1] = {l,r};
}
sort(all(t));
t.resize(unique(all(t)) - t.begin());
map<pii,int> ID;
for (int i = 0; i < t.size(); i++) {
ID[t[i]] = i;
}
set<int> cnt[1000005];
for (int i = 1; i <= q; i++) {
char c= query[i].se;
int l = query[i].fi.fi;
int r = query[i].fi.se;
int id = ID[{l,r}];
if (c == 'A') {
cnt[id].insert(i);
L.insert(l);
R.insert(r);
AR[l].insert(r);
AL[r].insert(l);
}else {
qer(1,1,q,*cnt[id].begin(),i-1,l,r);
cnt[id].erase(cnt[id].begin());
AL[r].erase(AL[r].find(l));
AR[l].erase(AR[l].find(r));
L.erase(L.find(l));
R.erase(R.find(r));
}
l = *L.rbegin();
r = *R.begin();
int len = max(0,r - l);
if (len) {
int l1 = l, r1 = r;
r = *AR[l1].begin();
l = *AL[r1].rbegin();
ANS[i] = r-l;
}else {
F[i] = 1;
}}
for (int i= 0; i < t.size(); i++)
for (int j : cnt[i])
qer(1,1,q,j,q,t[i].fi,t[i].se);
dfs(1,1,q);
for (int i = 1; i <= q; i++)
cout << ANS[i] <<'\n';
}
Compilation message
Main.cpp:112:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
112 | main() {
| ^
Main.cpp: In function 'int main()':
Main.cpp:135:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
135 | for (int i = 0; i < t.size(); i++) {
| ~~^~~~~~~~~~
Main.cpp:169:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
169 | for (int i= 0; i < t.size(); i++)
| ~~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
171 ms |
266744 KB |
Output is correct |
2 |
Correct |
170 ms |
266624 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
170 ms |
266488 KB |
Output is correct |
5 |
Correct |
173 ms |
266788 KB |
Output is correct |
6 |
Correct |
169 ms |
266616 KB |
Output is correct |
7 |
Correct |
168 ms |
266748 KB |
Output is correct |
8 |
Correct |
168 ms |
266756 KB |
Output is correct |
9 |
Correct |
169 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266748 KB |
Output is correct |
11 |
Correct |
169 ms |
266744 KB |
Output is correct |
12 |
Correct |
169 ms |
266744 KB |
Output is correct |
13 |
Correct |
170 ms |
267000 KB |
Output is correct |
14 |
Correct |
169 ms |
267000 KB |
Output is correct |
15 |
Correct |
182 ms |
267000 KB |
Output is correct |
16 |
Correct |
168 ms |
266872 KB |
Output is correct |
17 |
Correct |
171 ms |
266776 KB |
Output is correct |
18 |
Correct |
170 ms |
266568 KB |
Output is correct |
19 |
Correct |
168 ms |
266616 KB |
Output is correct |
20 |
Correct |
167 ms |
266616 KB |
Output is correct |
21 |
Correct |
170 ms |
266908 KB |
Output is correct |
22 |
Correct |
169 ms |
266616 KB |
Output is correct |
23 |
Correct |
169 ms |
266668 KB |
Output is correct |
24 |
Correct |
169 ms |
266616 KB |
Output is correct |
25 |
Correct |
170 ms |
266872 KB |
Output is correct |
26 |
Correct |
168 ms |
266788 KB |
Output is correct |
27 |
Correct |
171 ms |
266872 KB |
Output is correct |
28 |
Correct |
168 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
266996 KB |
Output is correct |
30 |
Correct |
170 ms |
267000 KB |
Output is correct |
31 |
Correct |
170 ms |
267000 KB |
Output is correct |
32 |
Correct |
169 ms |
267000 KB |
Output is correct |
33 |
Correct |
166 ms |
266720 KB |
Output is correct |
34 |
Correct |
165 ms |
266488 KB |
Output is correct |
35 |
Correct |
170 ms |
266656 KB |
Output is correct |
36 |
Correct |
167 ms |
266488 KB |
Output is correct |
37 |
Correct |
169 ms |
266616 KB |
Output is correct |
38 |
Correct |
174 ms |
266616 KB |
Output is correct |
39 |
Correct |
167 ms |
266596 KB |
Output is correct |
40 |
Correct |
167 ms |
266488 KB |
Output is correct |
41 |
Correct |
168 ms |
266744 KB |
Output is correct |
42 |
Correct |
168 ms |
266616 KB |
Output is correct |
43 |
Correct |
167 ms |
266488 KB |
Output is correct |
44 |
Correct |
166 ms |
266492 KB |
Output is correct |
45 |
Correct |
169 ms |
266872 KB |
Output is correct |
46 |
Correct |
170 ms |
266872 KB |
Output is correct |
47 |
Correct |
169 ms |
266512 KB |
Output is correct |
48 |
Correct |
170 ms |
266560 KB |
Output is correct |
49 |
Correct |
170 ms |
266888 KB |
Output is correct |
50 |
Correct |
169 ms |
266744 KB |
Output is correct |
51 |
Correct |
169 ms |
266872 KB |
Output is correct |
52 |
Correct |
169 ms |
266744 KB |
Output is correct |
53 |
Correct |
167 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266744 KB |
Output is correct |
55 |
Correct |
169 ms |
266744 KB |
Output is correct |
56 |
Correct |
172 ms |
266872 KB |
Output is correct |
57 |
Correct |
167 ms |
266744 KB |
Output is correct |
58 |
Correct |
169 ms |
266744 KB |
Output is correct |
59 |
Correct |
171 ms |
266872 KB |
Output is correct |
60 |
Correct |
173 ms |
267000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
171 ms |
266744 KB |
Output is correct |
2 |
Correct |
170 ms |
266624 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
170 ms |
266488 KB |
Output is correct |
5 |
Correct |
173 ms |
266788 KB |
Output is correct |
6 |
Correct |
169 ms |
266616 KB |
Output is correct |
7 |
Correct |
168 ms |
266748 KB |
Output is correct |
8 |
Correct |
168 ms |
266756 KB |
Output is correct |
9 |
Correct |
169 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266748 KB |
Output is correct |
11 |
Correct |
169 ms |
266744 KB |
Output is correct |
12 |
Correct |
169 ms |
266744 KB |
Output is correct |
13 |
Correct |
170 ms |
267000 KB |
Output is correct |
14 |
Correct |
169 ms |
267000 KB |
Output is correct |
15 |
Correct |
182 ms |
267000 KB |
Output is correct |
16 |
Correct |
168 ms |
266872 KB |
Output is correct |
17 |
Correct |
171 ms |
266776 KB |
Output is correct |
18 |
Correct |
170 ms |
266568 KB |
Output is correct |
19 |
Correct |
168 ms |
266616 KB |
Output is correct |
20 |
Correct |
167 ms |
266616 KB |
Output is correct |
21 |
Correct |
170 ms |
266908 KB |
Output is correct |
22 |
Correct |
169 ms |
266616 KB |
Output is correct |
23 |
Correct |
169 ms |
266668 KB |
Output is correct |
24 |
Correct |
169 ms |
266616 KB |
Output is correct |
25 |
Correct |
170 ms |
266872 KB |
Output is correct |
26 |
Correct |
168 ms |
266788 KB |
Output is correct |
27 |
Correct |
171 ms |
266872 KB |
Output is correct |
28 |
Correct |
168 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
266996 KB |
Output is correct |
30 |
Correct |
170 ms |
267000 KB |
Output is correct |
31 |
Correct |
170 ms |
267000 KB |
Output is correct |
32 |
Correct |
169 ms |
267000 KB |
Output is correct |
33 |
Correct |
166 ms |
266720 KB |
Output is correct |
34 |
Correct |
165 ms |
266488 KB |
Output is correct |
35 |
Correct |
170 ms |
266656 KB |
Output is correct |
36 |
Correct |
167 ms |
266488 KB |
Output is correct |
37 |
Correct |
169 ms |
266616 KB |
Output is correct |
38 |
Correct |
174 ms |
266616 KB |
Output is correct |
39 |
Correct |
167 ms |
266596 KB |
Output is correct |
40 |
Correct |
167 ms |
266488 KB |
Output is correct |
41 |
Correct |
168 ms |
266744 KB |
Output is correct |
42 |
Correct |
168 ms |
266616 KB |
Output is correct |
43 |
Correct |
167 ms |
266488 KB |
Output is correct |
44 |
Correct |
166 ms |
266492 KB |
Output is correct |
45 |
Correct |
169 ms |
266872 KB |
Output is correct |
46 |
Correct |
170 ms |
266872 KB |
Output is correct |
47 |
Correct |
169 ms |
266512 KB |
Output is correct |
48 |
Correct |
170 ms |
266560 KB |
Output is correct |
49 |
Correct |
170 ms |
266888 KB |
Output is correct |
50 |
Correct |
169 ms |
266744 KB |
Output is correct |
51 |
Correct |
169 ms |
266872 KB |
Output is correct |
52 |
Correct |
169 ms |
266744 KB |
Output is correct |
53 |
Correct |
167 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266744 KB |
Output is correct |
55 |
Correct |
169 ms |
266744 KB |
Output is correct |
56 |
Correct |
172 ms |
266872 KB |
Output is correct |
57 |
Correct |
167 ms |
266744 KB |
Output is correct |
58 |
Correct |
169 ms |
266744 KB |
Output is correct |
59 |
Correct |
171 ms |
266872 KB |
Output is correct |
60 |
Correct |
173 ms |
267000 KB |
Output is correct |
61 |
Correct |
170 ms |
266496 KB |
Output is correct |
62 |
Correct |
171 ms |
266616 KB |
Output is correct |
63 |
Correct |
171 ms |
266488 KB |
Output is correct |
64 |
Correct |
279 ms |
272888 KB |
Output is correct |
65 |
Correct |
248 ms |
269176 KB |
Output is correct |
66 |
Correct |
231 ms |
268280 KB |
Output is correct |
67 |
Correct |
201 ms |
267640 KB |
Output is correct |
68 |
Correct |
275 ms |
273016 KB |
Output is correct |
69 |
Correct |
259 ms |
269304 KB |
Output is correct |
70 |
Correct |
232 ms |
268408 KB |
Output is correct |
71 |
Correct |
221 ms |
268152 KB |
Output is correct |
72 |
Correct |
286 ms |
275832 KB |
Output is correct |
73 |
Correct |
278 ms |
274268 KB |
Output is correct |
74 |
Correct |
277 ms |
274368 KB |
Output is correct |
75 |
Correct |
271 ms |
273784 KB |
Output is correct |
76 |
Correct |
290 ms |
277496 KB |
Output is correct |
77 |
Correct |
286 ms |
277496 KB |
Output is correct |
78 |
Correct |
292 ms |
277384 KB |
Output is correct |
79 |
Correct |
288 ms |
277496 KB |
Output is correct |
80 |
Correct |
274 ms |
272892 KB |
Output is correct |
81 |
Correct |
247 ms |
269304 KB |
Output is correct |
82 |
Correct |
230 ms |
268284 KB |
Output is correct |
83 |
Correct |
199 ms |
267644 KB |
Output is correct |
84 |
Correct |
277 ms |
273016 KB |
Output is correct |
85 |
Correct |
249 ms |
269304 KB |
Output is correct |
86 |
Correct |
237 ms |
268280 KB |
Output is correct |
87 |
Correct |
222 ms |
268152 KB |
Output is correct |
88 |
Correct |
286 ms |
275704 KB |
Output is correct |
89 |
Correct |
277 ms |
274168 KB |
Output is correct |
90 |
Correct |
273 ms |
273912 KB |
Output is correct |
91 |
Correct |
275 ms |
273852 KB |
Output is correct |
92 |
Correct |
292 ms |
277552 KB |
Output is correct |
93 |
Correct |
295 ms |
277496 KB |
Output is correct |
94 |
Correct |
292 ms |
277496 KB |
Output is correct |
95 |
Correct |
287 ms |
277496 KB |
Output is correct |
96 |
Correct |
197 ms |
267640 KB |
Output is correct |
97 |
Correct |
200 ms |
267628 KB |
Output is correct |
98 |
Correct |
199 ms |
267720 KB |
Output is correct |
99 |
Correct |
202 ms |
267672 KB |
Output is correct |
100 |
Correct |
226 ms |
268280 KB |
Output is correct |
101 |
Correct |
219 ms |
267984 KB |
Output is correct |
102 |
Correct |
222 ms |
268108 KB |
Output is correct |
103 |
Correct |
202 ms |
267640 KB |
Output is correct |
104 |
Correct |
271 ms |
272504 KB |
Output is correct |
105 |
Correct |
244 ms |
269028 KB |
Output is correct |
106 |
Correct |
226 ms |
268152 KB |
Output is correct |
107 |
Correct |
209 ms |
267640 KB |
Output is correct |
108 |
Correct |
268 ms |
272120 KB |
Output is correct |
109 |
Correct |
246 ms |
268920 KB |
Output is correct |
110 |
Correct |
228 ms |
268152 KB |
Output is correct |
111 |
Correct |
205 ms |
267640 KB |
Output is correct |
112 |
Correct |
242 ms |
272536 KB |
Output is correct |
113 |
Correct |
253 ms |
272504 KB |
Output is correct |
114 |
Correct |
236 ms |
272504 KB |
Output is correct |
115 |
Correct |
248 ms |
272504 KB |
Output is correct |
116 |
Correct |
242 ms |
272632 KB |
Output is correct |
117 |
Correct |
251 ms |
272504 KB |
Output is correct |
118 |
Correct |
238 ms |
272452 KB |
Output is correct |
119 |
Correct |
249 ms |
272548 KB |
Output is correct |
120 |
Correct |
246 ms |
272500 KB |
Output is correct |
121 |
Correct |
250 ms |
272632 KB |
Output is correct |
122 |
Correct |
302 ms |
277368 KB |
Output is correct |
123 |
Correct |
265 ms |
277444 KB |
Output is correct |
124 |
Correct |
251 ms |
269368 KB |
Output is correct |
125 |
Correct |
239 ms |
268528 KB |
Output is correct |
126 |
Correct |
239 ms |
268408 KB |
Output is correct |
127 |
Correct |
260 ms |
270328 KB |
Output is correct |
128 |
Correct |
244 ms |
268680 KB |
Output is correct |
129 |
Correct |
237 ms |
268340 KB |
Output is correct |
130 |
Correct |
264 ms |
270584 KB |
Output is correct |
131 |
Correct |
238 ms |
268664 KB |
Output is correct |
132 |
Correct |
232 ms |
268408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
171 ms |
266744 KB |
Output is correct |
2 |
Correct |
170 ms |
266624 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
170 ms |
266488 KB |
Output is correct |
5 |
Correct |
173 ms |
266788 KB |
Output is correct |
6 |
Correct |
169 ms |
266616 KB |
Output is correct |
7 |
Correct |
168 ms |
266748 KB |
Output is correct |
8 |
Correct |
168 ms |
266756 KB |
Output is correct |
9 |
Correct |
169 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266748 KB |
Output is correct |
11 |
Correct |
169 ms |
266744 KB |
Output is correct |
12 |
Correct |
169 ms |
266744 KB |
Output is correct |
13 |
Correct |
170 ms |
267000 KB |
Output is correct |
14 |
Correct |
169 ms |
267000 KB |
Output is correct |
15 |
Correct |
182 ms |
267000 KB |
Output is correct |
16 |
Correct |
168 ms |
266872 KB |
Output is correct |
17 |
Correct |
171 ms |
266776 KB |
Output is correct |
18 |
Correct |
170 ms |
266568 KB |
Output is correct |
19 |
Correct |
168 ms |
266616 KB |
Output is correct |
20 |
Correct |
167 ms |
266616 KB |
Output is correct |
21 |
Correct |
170 ms |
266908 KB |
Output is correct |
22 |
Correct |
169 ms |
266616 KB |
Output is correct |
23 |
Correct |
169 ms |
266668 KB |
Output is correct |
24 |
Correct |
169 ms |
266616 KB |
Output is correct |
25 |
Correct |
170 ms |
266872 KB |
Output is correct |
26 |
Correct |
168 ms |
266788 KB |
Output is correct |
27 |
Correct |
171 ms |
266872 KB |
Output is correct |
28 |
Correct |
168 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
266996 KB |
Output is correct |
30 |
Correct |
170 ms |
267000 KB |
Output is correct |
31 |
Correct |
170 ms |
267000 KB |
Output is correct |
32 |
Correct |
169 ms |
267000 KB |
Output is correct |
33 |
Correct |
166 ms |
266720 KB |
Output is correct |
34 |
Correct |
165 ms |
266488 KB |
Output is correct |
35 |
Correct |
170 ms |
266656 KB |
Output is correct |
36 |
Correct |
167 ms |
266488 KB |
Output is correct |
37 |
Correct |
169 ms |
266616 KB |
Output is correct |
38 |
Correct |
174 ms |
266616 KB |
Output is correct |
39 |
Correct |
167 ms |
266596 KB |
Output is correct |
40 |
Correct |
167 ms |
266488 KB |
Output is correct |
41 |
Correct |
168 ms |
266744 KB |
Output is correct |
42 |
Correct |
168 ms |
266616 KB |
Output is correct |
43 |
Correct |
167 ms |
266488 KB |
Output is correct |
44 |
Correct |
166 ms |
266492 KB |
Output is correct |
45 |
Correct |
169 ms |
266872 KB |
Output is correct |
46 |
Correct |
170 ms |
266872 KB |
Output is correct |
47 |
Correct |
169 ms |
266512 KB |
Output is correct |
48 |
Correct |
170 ms |
266560 KB |
Output is correct |
49 |
Correct |
170 ms |
266888 KB |
Output is correct |
50 |
Correct |
169 ms |
266744 KB |
Output is correct |
51 |
Correct |
169 ms |
266872 KB |
Output is correct |
52 |
Correct |
169 ms |
266744 KB |
Output is correct |
53 |
Correct |
167 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266744 KB |
Output is correct |
55 |
Correct |
169 ms |
266744 KB |
Output is correct |
56 |
Correct |
172 ms |
266872 KB |
Output is correct |
57 |
Correct |
167 ms |
266744 KB |
Output is correct |
58 |
Correct |
169 ms |
266744 KB |
Output is correct |
59 |
Correct |
171 ms |
266872 KB |
Output is correct |
60 |
Correct |
173 ms |
267000 KB |
Output is correct |
61 |
Correct |
170 ms |
266496 KB |
Output is correct |
62 |
Correct |
171 ms |
266616 KB |
Output is correct |
63 |
Correct |
171 ms |
266488 KB |
Output is correct |
64 |
Correct |
279 ms |
272888 KB |
Output is correct |
65 |
Correct |
248 ms |
269176 KB |
Output is correct |
66 |
Correct |
231 ms |
268280 KB |
Output is correct |
67 |
Correct |
201 ms |
267640 KB |
Output is correct |
68 |
Correct |
275 ms |
273016 KB |
Output is correct |
69 |
Correct |
259 ms |
269304 KB |
Output is correct |
70 |
Correct |
232 ms |
268408 KB |
Output is correct |
71 |
Correct |
221 ms |
268152 KB |
Output is correct |
72 |
Correct |
286 ms |
275832 KB |
Output is correct |
73 |
Correct |
278 ms |
274268 KB |
Output is correct |
74 |
Correct |
277 ms |
274368 KB |
Output is correct |
75 |
Correct |
271 ms |
273784 KB |
Output is correct |
76 |
Correct |
290 ms |
277496 KB |
Output is correct |
77 |
Correct |
286 ms |
277496 KB |
Output is correct |
78 |
Correct |
292 ms |
277384 KB |
Output is correct |
79 |
Correct |
288 ms |
277496 KB |
Output is correct |
80 |
Correct |
274 ms |
272892 KB |
Output is correct |
81 |
Correct |
247 ms |
269304 KB |
Output is correct |
82 |
Correct |
230 ms |
268284 KB |
Output is correct |
83 |
Correct |
199 ms |
267644 KB |
Output is correct |
84 |
Correct |
277 ms |
273016 KB |
Output is correct |
85 |
Correct |
249 ms |
269304 KB |
Output is correct |
86 |
Correct |
237 ms |
268280 KB |
Output is correct |
87 |
Correct |
222 ms |
268152 KB |
Output is correct |
88 |
Correct |
286 ms |
275704 KB |
Output is correct |
89 |
Correct |
277 ms |
274168 KB |
Output is correct |
90 |
Correct |
273 ms |
273912 KB |
Output is correct |
91 |
Correct |
275 ms |
273852 KB |
Output is correct |
92 |
Correct |
292 ms |
277552 KB |
Output is correct |
93 |
Correct |
295 ms |
277496 KB |
Output is correct |
94 |
Correct |
292 ms |
277496 KB |
Output is correct |
95 |
Correct |
287 ms |
277496 KB |
Output is correct |
96 |
Correct |
197 ms |
267640 KB |
Output is correct |
97 |
Correct |
200 ms |
267628 KB |
Output is correct |
98 |
Correct |
199 ms |
267720 KB |
Output is correct |
99 |
Correct |
202 ms |
267672 KB |
Output is correct |
100 |
Correct |
226 ms |
268280 KB |
Output is correct |
101 |
Correct |
219 ms |
267984 KB |
Output is correct |
102 |
Correct |
222 ms |
268108 KB |
Output is correct |
103 |
Correct |
202 ms |
267640 KB |
Output is correct |
104 |
Correct |
271 ms |
272504 KB |
Output is correct |
105 |
Correct |
244 ms |
269028 KB |
Output is correct |
106 |
Correct |
226 ms |
268152 KB |
Output is correct |
107 |
Correct |
209 ms |
267640 KB |
Output is correct |
108 |
Correct |
268 ms |
272120 KB |
Output is correct |
109 |
Correct |
246 ms |
268920 KB |
Output is correct |
110 |
Correct |
228 ms |
268152 KB |
Output is correct |
111 |
Correct |
205 ms |
267640 KB |
Output is correct |
112 |
Correct |
242 ms |
272536 KB |
Output is correct |
113 |
Correct |
253 ms |
272504 KB |
Output is correct |
114 |
Correct |
236 ms |
272504 KB |
Output is correct |
115 |
Correct |
248 ms |
272504 KB |
Output is correct |
116 |
Correct |
242 ms |
272632 KB |
Output is correct |
117 |
Correct |
251 ms |
272504 KB |
Output is correct |
118 |
Correct |
238 ms |
272452 KB |
Output is correct |
119 |
Correct |
249 ms |
272548 KB |
Output is correct |
120 |
Correct |
246 ms |
272500 KB |
Output is correct |
121 |
Correct |
250 ms |
272632 KB |
Output is correct |
122 |
Correct |
302 ms |
277368 KB |
Output is correct |
123 |
Correct |
265 ms |
277444 KB |
Output is correct |
124 |
Correct |
251 ms |
269368 KB |
Output is correct |
125 |
Correct |
239 ms |
268528 KB |
Output is correct |
126 |
Correct |
239 ms |
268408 KB |
Output is correct |
127 |
Correct |
260 ms |
270328 KB |
Output is correct |
128 |
Correct |
244 ms |
268680 KB |
Output is correct |
129 |
Correct |
237 ms |
268340 KB |
Output is correct |
130 |
Correct |
264 ms |
270584 KB |
Output is correct |
131 |
Correct |
238 ms |
268664 KB |
Output is correct |
132 |
Correct |
232 ms |
268408 KB |
Output is correct |
133 |
Correct |
779 ms |
293496 KB |
Output is correct |
134 |
Correct |
617 ms |
278276 KB |
Output is correct |
135 |
Correct |
504 ms |
274596 KB |
Output is correct |
136 |
Correct |
349 ms |
271736 KB |
Output is correct |
137 |
Correct |
758 ms |
293624 KB |
Output is correct |
138 |
Correct |
615 ms |
278428 KB |
Output is correct |
139 |
Correct |
522 ms |
274680 KB |
Output is correct |
140 |
Correct |
436 ms |
273144 KB |
Output is correct |
141 |
Correct |
804 ms |
305396 KB |
Output is correct |
142 |
Correct |
777 ms |
299160 KB |
Output is correct |
143 |
Correct |
747 ms |
297848 KB |
Output is correct |
144 |
Correct |
731 ms |
297720 KB |
Output is correct |
145 |
Correct |
799 ms |
312568 KB |
Output is correct |
146 |
Correct |
807 ms |
312508 KB |
Output is correct |
147 |
Correct |
809 ms |
312440 KB |
Output is correct |
148 |
Correct |
812 ms |
312392 KB |
Output is correct |
149 |
Correct |
753 ms |
293624 KB |
Output is correct |
150 |
Correct |
607 ms |
278136 KB |
Output is correct |
151 |
Correct |
495 ms |
274296 KB |
Output is correct |
152 |
Correct |
353 ms |
271736 KB |
Output is correct |
153 |
Correct |
743 ms |
293624 KB |
Output is correct |
154 |
Correct |
642 ms |
278244 KB |
Output is correct |
155 |
Correct |
539 ms |
274364 KB |
Output is correct |
156 |
Correct |
431 ms |
273144 KB |
Output is correct |
157 |
Correct |
816 ms |
305360 KB |
Output is correct |
158 |
Correct |
830 ms |
299128 KB |
Output is correct |
159 |
Correct |
735 ms |
297848 KB |
Output is correct |
160 |
Correct |
743 ms |
297608 KB |
Output is correct |
161 |
Correct |
818 ms |
312432 KB |
Output is correct |
162 |
Correct |
839 ms |
312416 KB |
Output is correct |
163 |
Correct |
804 ms |
312424 KB |
Output is correct |
164 |
Correct |
815 ms |
312516 KB |
Output is correct |
165 |
Correct |
312 ms |
271224 KB |
Output is correct |
166 |
Correct |
307 ms |
271224 KB |
Output is correct |
167 |
Correct |
306 ms |
271224 KB |
Output is correct |
168 |
Correct |
310 ms |
271228 KB |
Output is correct |
169 |
Correct |
436 ms |
273272 KB |
Output is correct |
170 |
Correct |
405 ms |
272852 KB |
Output is correct |
171 |
Correct |
401 ms |
272504 KB |
Output is correct |
172 |
Correct |
342 ms |
271476 KB |
Output is correct |
173 |
Correct |
724 ms |
292092 KB |
Output is correct |
174 |
Correct |
588 ms |
277720 KB |
Output is correct |
175 |
Correct |
473 ms |
273884 KB |
Output is correct |
176 |
Correct |
346 ms |
271708 KB |
Output is correct |
177 |
Correct |
703 ms |
289784 KB |
Output is correct |
178 |
Correct |
583 ms |
276984 KB |
Output is correct |
179 |
Correct |
482 ms |
273784 KB |
Output is correct |
180 |
Correct |
352 ms |
271480 KB |
Output is correct |
181 |
Correct |
515 ms |
291572 KB |
Output is correct |
182 |
Correct |
588 ms |
291700 KB |
Output is correct |
183 |
Correct |
509 ms |
291700 KB |
Output is correct |
184 |
Correct |
579 ms |
291572 KB |
Output is correct |
185 |
Correct |
517 ms |
291572 KB |
Output is correct |
186 |
Correct |
595 ms |
291828 KB |
Output is correct |
187 |
Correct |
502 ms |
291572 KB |
Output is correct |
188 |
Correct |
578 ms |
291700 KB |
Output is correct |
189 |
Correct |
515 ms |
291700 KB |
Output is correct |
190 |
Correct |
587 ms |
291700 KB |
Output is correct |
191 |
Correct |
755 ms |
312336 KB |
Output is correct |
192 |
Correct |
609 ms |
312180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2695 ms |
451080 KB |
Output is correct |
2 |
Correct |
2216 ms |
450796 KB |
Output is correct |
3 |
Correct |
5400 ms |
636956 KB |
Output is correct |
4 |
Correct |
5408 ms |
636568 KB |
Output is correct |
5 |
Correct |
6694 ms |
724268 KB |
Output is correct |
6 |
Correct |
6676 ms |
724628 KB |
Output is correct |
7 |
Correct |
5972 ms |
349792 KB |
Output is correct |
8 |
Correct |
4951 ms |
337176 KB |
Output is correct |
9 |
Correct |
4603 ms |
334616 KB |
Output is correct |
10 |
Correct |
6741 ms |
369632 KB |
Output is correct |
11 |
Correct |
4892 ms |
337232 KB |
Output is correct |
12 |
Correct |
4657 ms |
334632 KB |
Output is correct |
13 |
Correct |
6988 ms |
375648 KB |
Output is correct |
14 |
Correct |
4896 ms |
337788 KB |
Output is correct |
15 |
Correct |
4684 ms |
334504 KB |
Output is correct |
16 |
Correct |
2264 ms |
324692 KB |
Output is correct |
17 |
Correct |
2297 ms |
324768 KB |
Output is correct |
18 |
Correct |
2267 ms |
324600 KB |
Output is correct |
19 |
Correct |
2293 ms |
324804 KB |
Output is correct |
20 |
Correct |
2300 ms |
324764 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
171 ms |
266744 KB |
Output is correct |
2 |
Correct |
170 ms |
266624 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
170 ms |
266488 KB |
Output is correct |
5 |
Correct |
173 ms |
266788 KB |
Output is correct |
6 |
Correct |
169 ms |
266616 KB |
Output is correct |
7 |
Correct |
168 ms |
266748 KB |
Output is correct |
8 |
Correct |
168 ms |
266756 KB |
Output is correct |
9 |
Correct |
169 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266748 KB |
Output is correct |
11 |
Correct |
169 ms |
266744 KB |
Output is correct |
12 |
Correct |
169 ms |
266744 KB |
Output is correct |
13 |
Correct |
170 ms |
267000 KB |
Output is correct |
14 |
Correct |
169 ms |
267000 KB |
Output is correct |
15 |
Correct |
182 ms |
267000 KB |
Output is correct |
16 |
Correct |
168 ms |
266872 KB |
Output is correct |
17 |
Correct |
171 ms |
266776 KB |
Output is correct |
18 |
Correct |
170 ms |
266568 KB |
Output is correct |
19 |
Correct |
168 ms |
266616 KB |
Output is correct |
20 |
Correct |
167 ms |
266616 KB |
Output is correct |
21 |
Correct |
170 ms |
266908 KB |
Output is correct |
22 |
Correct |
169 ms |
266616 KB |
Output is correct |
23 |
Correct |
169 ms |
266668 KB |
Output is correct |
24 |
Correct |
169 ms |
266616 KB |
Output is correct |
25 |
Correct |
170 ms |
266872 KB |
Output is correct |
26 |
Correct |
168 ms |
266788 KB |
Output is correct |
27 |
Correct |
171 ms |
266872 KB |
Output is correct |
28 |
Correct |
168 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
266996 KB |
Output is correct |
30 |
Correct |
170 ms |
267000 KB |
Output is correct |
31 |
Correct |
170 ms |
267000 KB |
Output is correct |
32 |
Correct |
169 ms |
267000 KB |
Output is correct |
33 |
Correct |
166 ms |
266720 KB |
Output is correct |
34 |
Correct |
165 ms |
266488 KB |
Output is correct |
35 |
Correct |
170 ms |
266656 KB |
Output is correct |
36 |
Correct |
167 ms |
266488 KB |
Output is correct |
37 |
Correct |
169 ms |
266616 KB |
Output is correct |
38 |
Correct |
174 ms |
266616 KB |
Output is correct |
39 |
Correct |
167 ms |
266596 KB |
Output is correct |
40 |
Correct |
167 ms |
266488 KB |
Output is correct |
41 |
Correct |
168 ms |
266744 KB |
Output is correct |
42 |
Correct |
168 ms |
266616 KB |
Output is correct |
43 |
Correct |
167 ms |
266488 KB |
Output is correct |
44 |
Correct |
166 ms |
266492 KB |
Output is correct |
45 |
Correct |
169 ms |
266872 KB |
Output is correct |
46 |
Correct |
170 ms |
266872 KB |
Output is correct |
47 |
Correct |
169 ms |
266512 KB |
Output is correct |
48 |
Correct |
170 ms |
266560 KB |
Output is correct |
49 |
Correct |
170 ms |
266888 KB |
Output is correct |
50 |
Correct |
169 ms |
266744 KB |
Output is correct |
51 |
Correct |
169 ms |
266872 KB |
Output is correct |
52 |
Correct |
169 ms |
266744 KB |
Output is correct |
53 |
Correct |
167 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266744 KB |
Output is correct |
55 |
Correct |
169 ms |
266744 KB |
Output is correct |
56 |
Correct |
172 ms |
266872 KB |
Output is correct |
57 |
Correct |
167 ms |
266744 KB |
Output is correct |
58 |
Correct |
169 ms |
266744 KB |
Output is correct |
59 |
Correct |
171 ms |
266872 KB |
Output is correct |
60 |
Correct |
173 ms |
267000 KB |
Output is correct |
61 |
Correct |
170 ms |
266496 KB |
Output is correct |
62 |
Correct |
171 ms |
266616 KB |
Output is correct |
63 |
Correct |
171 ms |
266488 KB |
Output is correct |
64 |
Correct |
279 ms |
272888 KB |
Output is correct |
65 |
Correct |
248 ms |
269176 KB |
Output is correct |
66 |
Correct |
231 ms |
268280 KB |
Output is correct |
67 |
Correct |
201 ms |
267640 KB |
Output is correct |
68 |
Correct |
275 ms |
273016 KB |
Output is correct |
69 |
Correct |
259 ms |
269304 KB |
Output is correct |
70 |
Correct |
232 ms |
268408 KB |
Output is correct |
71 |
Correct |
221 ms |
268152 KB |
Output is correct |
72 |
Correct |
286 ms |
275832 KB |
Output is correct |
73 |
Correct |
278 ms |
274268 KB |
Output is correct |
74 |
Correct |
277 ms |
274368 KB |
Output is correct |
75 |
Correct |
271 ms |
273784 KB |
Output is correct |
76 |
Correct |
290 ms |
277496 KB |
Output is correct |
77 |
Correct |
286 ms |
277496 KB |
Output is correct |
78 |
Correct |
292 ms |
277384 KB |
Output is correct |
79 |
Correct |
288 ms |
277496 KB |
Output is correct |
80 |
Correct |
274 ms |
272892 KB |
Output is correct |
81 |
Correct |
247 ms |
269304 KB |
Output is correct |
82 |
Correct |
230 ms |
268284 KB |
Output is correct |
83 |
Correct |
199 ms |
267644 KB |
Output is correct |
84 |
Correct |
277 ms |
273016 KB |
Output is correct |
85 |
Correct |
249 ms |
269304 KB |
Output is correct |
86 |
Correct |
237 ms |
268280 KB |
Output is correct |
87 |
Correct |
222 ms |
268152 KB |
Output is correct |
88 |
Correct |
286 ms |
275704 KB |
Output is correct |
89 |
Correct |
277 ms |
274168 KB |
Output is correct |
90 |
Correct |
273 ms |
273912 KB |
Output is correct |
91 |
Correct |
275 ms |
273852 KB |
Output is correct |
92 |
Correct |
292 ms |
277552 KB |
Output is correct |
93 |
Correct |
295 ms |
277496 KB |
Output is correct |
94 |
Correct |
292 ms |
277496 KB |
Output is correct |
95 |
Correct |
287 ms |
277496 KB |
Output is correct |
96 |
Correct |
197 ms |
267640 KB |
Output is correct |
97 |
Correct |
200 ms |
267628 KB |
Output is correct |
98 |
Correct |
199 ms |
267720 KB |
Output is correct |
99 |
Correct |
202 ms |
267672 KB |
Output is correct |
100 |
Correct |
226 ms |
268280 KB |
Output is correct |
101 |
Correct |
219 ms |
267984 KB |
Output is correct |
102 |
Correct |
222 ms |
268108 KB |
Output is correct |
103 |
Correct |
202 ms |
267640 KB |
Output is correct |
104 |
Correct |
271 ms |
272504 KB |
Output is correct |
105 |
Correct |
244 ms |
269028 KB |
Output is correct |
106 |
Correct |
226 ms |
268152 KB |
Output is correct |
107 |
Correct |
209 ms |
267640 KB |
Output is correct |
108 |
Correct |
268 ms |
272120 KB |
Output is correct |
109 |
Correct |
246 ms |
268920 KB |
Output is correct |
110 |
Correct |
228 ms |
268152 KB |
Output is correct |
111 |
Correct |
205 ms |
267640 KB |
Output is correct |
112 |
Correct |
242 ms |
272536 KB |
Output is correct |
113 |
Correct |
253 ms |
272504 KB |
Output is correct |
114 |
Correct |
236 ms |
272504 KB |
Output is correct |
115 |
Correct |
248 ms |
272504 KB |
Output is correct |
116 |
Correct |
242 ms |
272632 KB |
Output is correct |
117 |
Correct |
251 ms |
272504 KB |
Output is correct |
118 |
Correct |
238 ms |
272452 KB |
Output is correct |
119 |
Correct |
249 ms |
272548 KB |
Output is correct |
120 |
Correct |
246 ms |
272500 KB |
Output is correct |
121 |
Correct |
250 ms |
272632 KB |
Output is correct |
122 |
Correct |
302 ms |
277368 KB |
Output is correct |
123 |
Correct |
265 ms |
277444 KB |
Output is correct |
124 |
Correct |
251 ms |
269368 KB |
Output is correct |
125 |
Correct |
239 ms |
268528 KB |
Output is correct |
126 |
Correct |
239 ms |
268408 KB |
Output is correct |
127 |
Correct |
260 ms |
270328 KB |
Output is correct |
128 |
Correct |
244 ms |
268680 KB |
Output is correct |
129 |
Correct |
237 ms |
268340 KB |
Output is correct |
130 |
Correct |
264 ms |
270584 KB |
Output is correct |
131 |
Correct |
238 ms |
268664 KB |
Output is correct |
132 |
Correct |
232 ms |
268408 KB |
Output is correct |
133 |
Correct |
779 ms |
293496 KB |
Output is correct |
134 |
Correct |
617 ms |
278276 KB |
Output is correct |
135 |
Correct |
504 ms |
274596 KB |
Output is correct |
136 |
Correct |
349 ms |
271736 KB |
Output is correct |
137 |
Correct |
758 ms |
293624 KB |
Output is correct |
138 |
Correct |
615 ms |
278428 KB |
Output is correct |
139 |
Correct |
522 ms |
274680 KB |
Output is correct |
140 |
Correct |
436 ms |
273144 KB |
Output is correct |
141 |
Correct |
804 ms |
305396 KB |
Output is correct |
142 |
Correct |
777 ms |
299160 KB |
Output is correct |
143 |
Correct |
747 ms |
297848 KB |
Output is correct |
144 |
Correct |
731 ms |
297720 KB |
Output is correct |
145 |
Correct |
799 ms |
312568 KB |
Output is correct |
146 |
Correct |
807 ms |
312508 KB |
Output is correct |
147 |
Correct |
809 ms |
312440 KB |
Output is correct |
148 |
Correct |
812 ms |
312392 KB |
Output is correct |
149 |
Correct |
753 ms |
293624 KB |
Output is correct |
150 |
Correct |
607 ms |
278136 KB |
Output is correct |
151 |
Correct |
495 ms |
274296 KB |
Output is correct |
152 |
Correct |
353 ms |
271736 KB |
Output is correct |
153 |
Correct |
743 ms |
293624 KB |
Output is correct |
154 |
Correct |
642 ms |
278244 KB |
Output is correct |
155 |
Correct |
539 ms |
274364 KB |
Output is correct |
156 |
Correct |
431 ms |
273144 KB |
Output is correct |
157 |
Correct |
816 ms |
305360 KB |
Output is correct |
158 |
Correct |
830 ms |
299128 KB |
Output is correct |
159 |
Correct |
735 ms |
297848 KB |
Output is correct |
160 |
Correct |
743 ms |
297608 KB |
Output is correct |
161 |
Correct |
818 ms |
312432 KB |
Output is correct |
162 |
Correct |
839 ms |
312416 KB |
Output is correct |
163 |
Correct |
804 ms |
312424 KB |
Output is correct |
164 |
Correct |
815 ms |
312516 KB |
Output is correct |
165 |
Correct |
312 ms |
271224 KB |
Output is correct |
166 |
Correct |
307 ms |
271224 KB |
Output is correct |
167 |
Correct |
306 ms |
271224 KB |
Output is correct |
168 |
Correct |
310 ms |
271228 KB |
Output is correct |
169 |
Correct |
436 ms |
273272 KB |
Output is correct |
170 |
Correct |
405 ms |
272852 KB |
Output is correct |
171 |
Correct |
401 ms |
272504 KB |
Output is correct |
172 |
Correct |
342 ms |
271476 KB |
Output is correct |
173 |
Correct |
724 ms |
292092 KB |
Output is correct |
174 |
Correct |
588 ms |
277720 KB |
Output is correct |
175 |
Correct |
473 ms |
273884 KB |
Output is correct |
176 |
Correct |
346 ms |
271708 KB |
Output is correct |
177 |
Correct |
703 ms |
289784 KB |
Output is correct |
178 |
Correct |
583 ms |
276984 KB |
Output is correct |
179 |
Correct |
482 ms |
273784 KB |
Output is correct |
180 |
Correct |
352 ms |
271480 KB |
Output is correct |
181 |
Correct |
515 ms |
291572 KB |
Output is correct |
182 |
Correct |
588 ms |
291700 KB |
Output is correct |
183 |
Correct |
509 ms |
291700 KB |
Output is correct |
184 |
Correct |
579 ms |
291572 KB |
Output is correct |
185 |
Correct |
517 ms |
291572 KB |
Output is correct |
186 |
Correct |
595 ms |
291828 KB |
Output is correct |
187 |
Correct |
502 ms |
291572 KB |
Output is correct |
188 |
Correct |
578 ms |
291700 KB |
Output is correct |
189 |
Correct |
515 ms |
291700 KB |
Output is correct |
190 |
Correct |
587 ms |
291700 KB |
Output is correct |
191 |
Correct |
755 ms |
312336 KB |
Output is correct |
192 |
Correct |
609 ms |
312180 KB |
Output is correct |
193 |
Correct |
2695 ms |
451080 KB |
Output is correct |
194 |
Correct |
2216 ms |
450796 KB |
Output is correct |
195 |
Correct |
5400 ms |
636956 KB |
Output is correct |
196 |
Correct |
5408 ms |
636568 KB |
Output is correct |
197 |
Correct |
6694 ms |
724268 KB |
Output is correct |
198 |
Correct |
6676 ms |
724628 KB |
Output is correct |
199 |
Correct |
5972 ms |
349792 KB |
Output is correct |
200 |
Correct |
4951 ms |
337176 KB |
Output is correct |
201 |
Correct |
4603 ms |
334616 KB |
Output is correct |
202 |
Correct |
6741 ms |
369632 KB |
Output is correct |
203 |
Correct |
4892 ms |
337232 KB |
Output is correct |
204 |
Correct |
4657 ms |
334632 KB |
Output is correct |
205 |
Correct |
6988 ms |
375648 KB |
Output is correct |
206 |
Correct |
4896 ms |
337788 KB |
Output is correct |
207 |
Correct |
4684 ms |
334504 KB |
Output is correct |
208 |
Correct |
2264 ms |
324692 KB |
Output is correct |
209 |
Correct |
2297 ms |
324768 KB |
Output is correct |
210 |
Correct |
2267 ms |
324600 KB |
Output is correct |
211 |
Correct |
2293 ms |
324804 KB |
Output is correct |
212 |
Correct |
2300 ms |
324764 KB |
Output is correct |
213 |
Execution timed out |
7131 ms |
542444 KB |
Time limit exceeded |
214 |
Halted |
0 ms |
0 KB |
- |