#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[100000000];
int val[100000000];
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));
}
char c;
int l,r,q,i,id,len,l1,r1;
void dfs(int v,int tl,int tr) {
int in_ans = cans;
int start_time = timer;
for (auto i1 : Q[v]) {
l = i1.fi;
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;
}
pair<pii,char> query[500006];
multiset<int> AL[1000004],AR[1000004];
set<int> cnt[1000005];
main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
multiset<int> L,R;
cin >> q;
for (i = 0; i < 4*N;i ++)
t[0][i] = inf, t[1][i] = -inf;
vector<pii> t(q);
for (int i = 1; i <= q; i++) {
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;
}
for (i = 1; i <= q; i++) {
c= query[i].se;
l = query[i].fi.fi;
r = query[i].fi.se;
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();
len = max(0,r - l);
if (len) {
l1 = l, r1 = r;
r = *AR[l1].begin();
l = *AL[r1].rbegin();
ANS[i] = r-l;
}else {
F[i] = 1;
}}
for (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 ( i = 1; i <= q; i++)
cout << ANS[i] <<'\n';
}
Compilation message
Main.cpp:111:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
111 | main() {
| ^
Main.cpp: In function 'int main()':
Main.cpp:129: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]
129 | for (int i = 0; i < t.size(); i++) {
| ~~^~~~~~~~~~
Main.cpp:162:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
162 | for (i= 0; i < t.size(); i++)
| ~~^~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
176 ms |
266872 KB |
Output is correct |
2 |
Correct |
172 ms |
266616 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
173 ms |
266616 KB |
Output is correct |
5 |
Correct |
172 ms |
266744 KB |
Output is correct |
6 |
Correct |
170 ms |
266616 KB |
Output is correct |
7 |
Correct |
173 ms |
266616 KB |
Output is correct |
8 |
Correct |
171 ms |
266744 KB |
Output is correct |
9 |
Correct |
172 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266872 KB |
Output is correct |
11 |
Correct |
170 ms |
266872 KB |
Output is correct |
12 |
Correct |
172 ms |
266872 KB |
Output is correct |
13 |
Correct |
172 ms |
267084 KB |
Output is correct |
14 |
Correct |
173 ms |
267000 KB |
Output is correct |
15 |
Correct |
172 ms |
267000 KB |
Output is correct |
16 |
Correct |
176 ms |
267000 KB |
Output is correct |
17 |
Correct |
178 ms |
266744 KB |
Output is correct |
18 |
Correct |
169 ms |
266616 KB |
Output is correct |
19 |
Correct |
171 ms |
266616 KB |
Output is correct |
20 |
Correct |
175 ms |
266624 KB |
Output is correct |
21 |
Correct |
171 ms |
266744 KB |
Output is correct |
22 |
Correct |
174 ms |
266616 KB |
Output is correct |
23 |
Correct |
173 ms |
266568 KB |
Output is correct |
24 |
Correct |
170 ms |
266616 KB |
Output is correct |
25 |
Correct |
174 ms |
266976 KB |
Output is correct |
26 |
Correct |
170 ms |
266872 KB |
Output is correct |
27 |
Correct |
171 ms |
266744 KB |
Output is correct |
28 |
Correct |
171 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
267000 KB |
Output is correct |
30 |
Correct |
171 ms |
267000 KB |
Output is correct |
31 |
Correct |
176 ms |
267000 KB |
Output is correct |
32 |
Correct |
183 ms |
267000 KB |
Output is correct |
33 |
Correct |
168 ms |
266616 KB |
Output is correct |
34 |
Correct |
172 ms |
266744 KB |
Output is correct |
35 |
Correct |
173 ms |
266616 KB |
Output is correct |
36 |
Correct |
174 ms |
266744 KB |
Output is correct |
37 |
Correct |
173 ms |
266616 KB |
Output is correct |
38 |
Correct |
172 ms |
266616 KB |
Output is correct |
39 |
Correct |
171 ms |
266616 KB |
Output is correct |
40 |
Correct |
169 ms |
266552 KB |
Output is correct |
41 |
Correct |
172 ms |
266744 KB |
Output is correct |
42 |
Correct |
177 ms |
266616 KB |
Output is correct |
43 |
Correct |
174 ms |
266616 KB |
Output is correct |
44 |
Correct |
171 ms |
266616 KB |
Output is correct |
45 |
Correct |
172 ms |
266744 KB |
Output is correct |
46 |
Correct |
170 ms |
266620 KB |
Output is correct |
47 |
Correct |
174 ms |
266616 KB |
Output is correct |
48 |
Correct |
173 ms |
266744 KB |
Output is correct |
49 |
Correct |
172 ms |
266856 KB |
Output is correct |
50 |
Correct |
173 ms |
266944 KB |
Output is correct |
51 |
Correct |
172 ms |
266872 KB |
Output is correct |
52 |
Correct |
171 ms |
266904 KB |
Output is correct |
53 |
Correct |
174 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266752 KB |
Output is correct |
55 |
Correct |
182 ms |
266744 KB |
Output is correct |
56 |
Correct |
171 ms |
266744 KB |
Output is correct |
57 |
Correct |
170 ms |
266872 KB |
Output is correct |
58 |
Correct |
173 ms |
266748 KB |
Output is correct |
59 |
Correct |
174 ms |
267000 KB |
Output is correct |
60 |
Correct |
171 ms |
267000 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
176 ms |
266872 KB |
Output is correct |
2 |
Correct |
172 ms |
266616 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
173 ms |
266616 KB |
Output is correct |
5 |
Correct |
172 ms |
266744 KB |
Output is correct |
6 |
Correct |
170 ms |
266616 KB |
Output is correct |
7 |
Correct |
173 ms |
266616 KB |
Output is correct |
8 |
Correct |
171 ms |
266744 KB |
Output is correct |
9 |
Correct |
172 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266872 KB |
Output is correct |
11 |
Correct |
170 ms |
266872 KB |
Output is correct |
12 |
Correct |
172 ms |
266872 KB |
Output is correct |
13 |
Correct |
172 ms |
267084 KB |
Output is correct |
14 |
Correct |
173 ms |
267000 KB |
Output is correct |
15 |
Correct |
172 ms |
267000 KB |
Output is correct |
16 |
Correct |
176 ms |
267000 KB |
Output is correct |
17 |
Correct |
178 ms |
266744 KB |
Output is correct |
18 |
Correct |
169 ms |
266616 KB |
Output is correct |
19 |
Correct |
171 ms |
266616 KB |
Output is correct |
20 |
Correct |
175 ms |
266624 KB |
Output is correct |
21 |
Correct |
171 ms |
266744 KB |
Output is correct |
22 |
Correct |
174 ms |
266616 KB |
Output is correct |
23 |
Correct |
173 ms |
266568 KB |
Output is correct |
24 |
Correct |
170 ms |
266616 KB |
Output is correct |
25 |
Correct |
174 ms |
266976 KB |
Output is correct |
26 |
Correct |
170 ms |
266872 KB |
Output is correct |
27 |
Correct |
171 ms |
266744 KB |
Output is correct |
28 |
Correct |
171 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
267000 KB |
Output is correct |
30 |
Correct |
171 ms |
267000 KB |
Output is correct |
31 |
Correct |
176 ms |
267000 KB |
Output is correct |
32 |
Correct |
183 ms |
267000 KB |
Output is correct |
33 |
Correct |
168 ms |
266616 KB |
Output is correct |
34 |
Correct |
172 ms |
266744 KB |
Output is correct |
35 |
Correct |
173 ms |
266616 KB |
Output is correct |
36 |
Correct |
174 ms |
266744 KB |
Output is correct |
37 |
Correct |
173 ms |
266616 KB |
Output is correct |
38 |
Correct |
172 ms |
266616 KB |
Output is correct |
39 |
Correct |
171 ms |
266616 KB |
Output is correct |
40 |
Correct |
169 ms |
266552 KB |
Output is correct |
41 |
Correct |
172 ms |
266744 KB |
Output is correct |
42 |
Correct |
177 ms |
266616 KB |
Output is correct |
43 |
Correct |
174 ms |
266616 KB |
Output is correct |
44 |
Correct |
171 ms |
266616 KB |
Output is correct |
45 |
Correct |
172 ms |
266744 KB |
Output is correct |
46 |
Correct |
170 ms |
266620 KB |
Output is correct |
47 |
Correct |
174 ms |
266616 KB |
Output is correct |
48 |
Correct |
173 ms |
266744 KB |
Output is correct |
49 |
Correct |
172 ms |
266856 KB |
Output is correct |
50 |
Correct |
173 ms |
266944 KB |
Output is correct |
51 |
Correct |
172 ms |
266872 KB |
Output is correct |
52 |
Correct |
171 ms |
266904 KB |
Output is correct |
53 |
Correct |
174 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266752 KB |
Output is correct |
55 |
Correct |
182 ms |
266744 KB |
Output is correct |
56 |
Correct |
171 ms |
266744 KB |
Output is correct |
57 |
Correct |
170 ms |
266872 KB |
Output is correct |
58 |
Correct |
173 ms |
266748 KB |
Output is correct |
59 |
Correct |
174 ms |
267000 KB |
Output is correct |
60 |
Correct |
171 ms |
267000 KB |
Output is correct |
61 |
Correct |
171 ms |
266464 KB |
Output is correct |
62 |
Correct |
168 ms |
266616 KB |
Output is correct |
63 |
Correct |
172 ms |
266488 KB |
Output is correct |
64 |
Correct |
286 ms |
273272 KB |
Output is correct |
65 |
Correct |
259 ms |
269432 KB |
Output is correct |
66 |
Correct |
239 ms |
268536 KB |
Output is correct |
67 |
Correct |
210 ms |
267768 KB |
Output is correct |
68 |
Correct |
280 ms |
273064 KB |
Output is correct |
69 |
Correct |
257 ms |
269432 KB |
Output is correct |
70 |
Correct |
238 ms |
268536 KB |
Output is correct |
71 |
Correct |
226 ms |
268280 KB |
Output is correct |
72 |
Correct |
296 ms |
275832 KB |
Output is correct |
73 |
Correct |
284 ms |
274424 KB |
Output is correct |
74 |
Correct |
291 ms |
274516 KB |
Output is correct |
75 |
Correct |
273 ms |
273912 KB |
Output is correct |
76 |
Correct |
297 ms |
277704 KB |
Output is correct |
77 |
Correct |
309 ms |
277588 KB |
Output is correct |
78 |
Correct |
297 ms |
277624 KB |
Output is correct |
79 |
Correct |
298 ms |
277624 KB |
Output is correct |
80 |
Correct |
286 ms |
273144 KB |
Output is correct |
81 |
Correct |
252 ms |
269432 KB |
Output is correct |
82 |
Correct |
233 ms |
268408 KB |
Output is correct |
83 |
Correct |
205 ms |
267908 KB |
Output is correct |
84 |
Correct |
279 ms |
273272 KB |
Output is correct |
85 |
Correct |
252 ms |
269432 KB |
Output is correct |
86 |
Correct |
235 ms |
268536 KB |
Output is correct |
87 |
Correct |
228 ms |
268280 KB |
Output is correct |
88 |
Correct |
286 ms |
276088 KB |
Output is correct |
89 |
Correct |
282 ms |
274424 KB |
Output is correct |
90 |
Correct |
279 ms |
274168 KB |
Output is correct |
91 |
Correct |
279 ms |
274040 KB |
Output is correct |
92 |
Correct |
298 ms |
277624 KB |
Output is correct |
93 |
Correct |
290 ms |
277752 KB |
Output is correct |
94 |
Correct |
290 ms |
277624 KB |
Output is correct |
95 |
Correct |
294 ms |
277624 KB |
Output is correct |
96 |
Correct |
202 ms |
267768 KB |
Output is correct |
97 |
Correct |
200 ms |
267768 KB |
Output is correct |
98 |
Correct |
197 ms |
267896 KB |
Output is correct |
99 |
Correct |
198 ms |
267768 KB |
Output is correct |
100 |
Correct |
225 ms |
268280 KB |
Output is correct |
101 |
Correct |
241 ms |
268024 KB |
Output is correct |
102 |
Correct |
218 ms |
268152 KB |
Output is correct |
103 |
Correct |
200 ms |
267768 KB |
Output is correct |
104 |
Correct |
268 ms |
272632 KB |
Output is correct |
105 |
Correct |
244 ms |
269176 KB |
Output is correct |
106 |
Correct |
231 ms |
268300 KB |
Output is correct |
107 |
Correct |
201 ms |
267768 KB |
Output is correct |
108 |
Correct |
284 ms |
272120 KB |
Output is correct |
109 |
Correct |
248 ms |
269116 KB |
Output is correct |
110 |
Correct |
232 ms |
268280 KB |
Output is correct |
111 |
Correct |
209 ms |
267768 KB |
Output is correct |
112 |
Correct |
245 ms |
272632 KB |
Output is correct |
113 |
Correct |
258 ms |
272632 KB |
Output is correct |
114 |
Correct |
241 ms |
272632 KB |
Output is correct |
115 |
Correct |
249 ms |
272632 KB |
Output is correct |
116 |
Correct |
244 ms |
272760 KB |
Output is correct |
117 |
Correct |
247 ms |
272636 KB |
Output is correct |
118 |
Correct |
238 ms |
272632 KB |
Output is correct |
119 |
Correct |
248 ms |
272760 KB |
Output is correct |
120 |
Correct |
240 ms |
272632 KB |
Output is correct |
121 |
Correct |
252 ms |
272600 KB |
Output is correct |
122 |
Correct |
302 ms |
277624 KB |
Output is correct |
123 |
Correct |
261 ms |
277496 KB |
Output is correct |
124 |
Correct |
257 ms |
269688 KB |
Output is correct |
125 |
Correct |
238 ms |
268664 KB |
Output is correct |
126 |
Correct |
233 ms |
268496 KB |
Output is correct |
127 |
Correct |
256 ms |
270456 KB |
Output is correct |
128 |
Correct |
238 ms |
268664 KB |
Output is correct |
129 |
Correct |
243 ms |
268412 KB |
Output is correct |
130 |
Correct |
262 ms |
270712 KB |
Output is correct |
131 |
Correct |
249 ms |
268664 KB |
Output is correct |
132 |
Correct |
238 ms |
268408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
176 ms |
266872 KB |
Output is correct |
2 |
Correct |
172 ms |
266616 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
173 ms |
266616 KB |
Output is correct |
5 |
Correct |
172 ms |
266744 KB |
Output is correct |
6 |
Correct |
170 ms |
266616 KB |
Output is correct |
7 |
Correct |
173 ms |
266616 KB |
Output is correct |
8 |
Correct |
171 ms |
266744 KB |
Output is correct |
9 |
Correct |
172 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266872 KB |
Output is correct |
11 |
Correct |
170 ms |
266872 KB |
Output is correct |
12 |
Correct |
172 ms |
266872 KB |
Output is correct |
13 |
Correct |
172 ms |
267084 KB |
Output is correct |
14 |
Correct |
173 ms |
267000 KB |
Output is correct |
15 |
Correct |
172 ms |
267000 KB |
Output is correct |
16 |
Correct |
176 ms |
267000 KB |
Output is correct |
17 |
Correct |
178 ms |
266744 KB |
Output is correct |
18 |
Correct |
169 ms |
266616 KB |
Output is correct |
19 |
Correct |
171 ms |
266616 KB |
Output is correct |
20 |
Correct |
175 ms |
266624 KB |
Output is correct |
21 |
Correct |
171 ms |
266744 KB |
Output is correct |
22 |
Correct |
174 ms |
266616 KB |
Output is correct |
23 |
Correct |
173 ms |
266568 KB |
Output is correct |
24 |
Correct |
170 ms |
266616 KB |
Output is correct |
25 |
Correct |
174 ms |
266976 KB |
Output is correct |
26 |
Correct |
170 ms |
266872 KB |
Output is correct |
27 |
Correct |
171 ms |
266744 KB |
Output is correct |
28 |
Correct |
171 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
267000 KB |
Output is correct |
30 |
Correct |
171 ms |
267000 KB |
Output is correct |
31 |
Correct |
176 ms |
267000 KB |
Output is correct |
32 |
Correct |
183 ms |
267000 KB |
Output is correct |
33 |
Correct |
168 ms |
266616 KB |
Output is correct |
34 |
Correct |
172 ms |
266744 KB |
Output is correct |
35 |
Correct |
173 ms |
266616 KB |
Output is correct |
36 |
Correct |
174 ms |
266744 KB |
Output is correct |
37 |
Correct |
173 ms |
266616 KB |
Output is correct |
38 |
Correct |
172 ms |
266616 KB |
Output is correct |
39 |
Correct |
171 ms |
266616 KB |
Output is correct |
40 |
Correct |
169 ms |
266552 KB |
Output is correct |
41 |
Correct |
172 ms |
266744 KB |
Output is correct |
42 |
Correct |
177 ms |
266616 KB |
Output is correct |
43 |
Correct |
174 ms |
266616 KB |
Output is correct |
44 |
Correct |
171 ms |
266616 KB |
Output is correct |
45 |
Correct |
172 ms |
266744 KB |
Output is correct |
46 |
Correct |
170 ms |
266620 KB |
Output is correct |
47 |
Correct |
174 ms |
266616 KB |
Output is correct |
48 |
Correct |
173 ms |
266744 KB |
Output is correct |
49 |
Correct |
172 ms |
266856 KB |
Output is correct |
50 |
Correct |
173 ms |
266944 KB |
Output is correct |
51 |
Correct |
172 ms |
266872 KB |
Output is correct |
52 |
Correct |
171 ms |
266904 KB |
Output is correct |
53 |
Correct |
174 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266752 KB |
Output is correct |
55 |
Correct |
182 ms |
266744 KB |
Output is correct |
56 |
Correct |
171 ms |
266744 KB |
Output is correct |
57 |
Correct |
170 ms |
266872 KB |
Output is correct |
58 |
Correct |
173 ms |
266748 KB |
Output is correct |
59 |
Correct |
174 ms |
267000 KB |
Output is correct |
60 |
Correct |
171 ms |
267000 KB |
Output is correct |
61 |
Correct |
171 ms |
266464 KB |
Output is correct |
62 |
Correct |
168 ms |
266616 KB |
Output is correct |
63 |
Correct |
172 ms |
266488 KB |
Output is correct |
64 |
Correct |
286 ms |
273272 KB |
Output is correct |
65 |
Correct |
259 ms |
269432 KB |
Output is correct |
66 |
Correct |
239 ms |
268536 KB |
Output is correct |
67 |
Correct |
210 ms |
267768 KB |
Output is correct |
68 |
Correct |
280 ms |
273064 KB |
Output is correct |
69 |
Correct |
257 ms |
269432 KB |
Output is correct |
70 |
Correct |
238 ms |
268536 KB |
Output is correct |
71 |
Correct |
226 ms |
268280 KB |
Output is correct |
72 |
Correct |
296 ms |
275832 KB |
Output is correct |
73 |
Correct |
284 ms |
274424 KB |
Output is correct |
74 |
Correct |
291 ms |
274516 KB |
Output is correct |
75 |
Correct |
273 ms |
273912 KB |
Output is correct |
76 |
Correct |
297 ms |
277704 KB |
Output is correct |
77 |
Correct |
309 ms |
277588 KB |
Output is correct |
78 |
Correct |
297 ms |
277624 KB |
Output is correct |
79 |
Correct |
298 ms |
277624 KB |
Output is correct |
80 |
Correct |
286 ms |
273144 KB |
Output is correct |
81 |
Correct |
252 ms |
269432 KB |
Output is correct |
82 |
Correct |
233 ms |
268408 KB |
Output is correct |
83 |
Correct |
205 ms |
267908 KB |
Output is correct |
84 |
Correct |
279 ms |
273272 KB |
Output is correct |
85 |
Correct |
252 ms |
269432 KB |
Output is correct |
86 |
Correct |
235 ms |
268536 KB |
Output is correct |
87 |
Correct |
228 ms |
268280 KB |
Output is correct |
88 |
Correct |
286 ms |
276088 KB |
Output is correct |
89 |
Correct |
282 ms |
274424 KB |
Output is correct |
90 |
Correct |
279 ms |
274168 KB |
Output is correct |
91 |
Correct |
279 ms |
274040 KB |
Output is correct |
92 |
Correct |
298 ms |
277624 KB |
Output is correct |
93 |
Correct |
290 ms |
277752 KB |
Output is correct |
94 |
Correct |
290 ms |
277624 KB |
Output is correct |
95 |
Correct |
294 ms |
277624 KB |
Output is correct |
96 |
Correct |
202 ms |
267768 KB |
Output is correct |
97 |
Correct |
200 ms |
267768 KB |
Output is correct |
98 |
Correct |
197 ms |
267896 KB |
Output is correct |
99 |
Correct |
198 ms |
267768 KB |
Output is correct |
100 |
Correct |
225 ms |
268280 KB |
Output is correct |
101 |
Correct |
241 ms |
268024 KB |
Output is correct |
102 |
Correct |
218 ms |
268152 KB |
Output is correct |
103 |
Correct |
200 ms |
267768 KB |
Output is correct |
104 |
Correct |
268 ms |
272632 KB |
Output is correct |
105 |
Correct |
244 ms |
269176 KB |
Output is correct |
106 |
Correct |
231 ms |
268300 KB |
Output is correct |
107 |
Correct |
201 ms |
267768 KB |
Output is correct |
108 |
Correct |
284 ms |
272120 KB |
Output is correct |
109 |
Correct |
248 ms |
269116 KB |
Output is correct |
110 |
Correct |
232 ms |
268280 KB |
Output is correct |
111 |
Correct |
209 ms |
267768 KB |
Output is correct |
112 |
Correct |
245 ms |
272632 KB |
Output is correct |
113 |
Correct |
258 ms |
272632 KB |
Output is correct |
114 |
Correct |
241 ms |
272632 KB |
Output is correct |
115 |
Correct |
249 ms |
272632 KB |
Output is correct |
116 |
Correct |
244 ms |
272760 KB |
Output is correct |
117 |
Correct |
247 ms |
272636 KB |
Output is correct |
118 |
Correct |
238 ms |
272632 KB |
Output is correct |
119 |
Correct |
248 ms |
272760 KB |
Output is correct |
120 |
Correct |
240 ms |
272632 KB |
Output is correct |
121 |
Correct |
252 ms |
272600 KB |
Output is correct |
122 |
Correct |
302 ms |
277624 KB |
Output is correct |
123 |
Correct |
261 ms |
277496 KB |
Output is correct |
124 |
Correct |
257 ms |
269688 KB |
Output is correct |
125 |
Correct |
238 ms |
268664 KB |
Output is correct |
126 |
Correct |
233 ms |
268496 KB |
Output is correct |
127 |
Correct |
256 ms |
270456 KB |
Output is correct |
128 |
Correct |
238 ms |
268664 KB |
Output is correct |
129 |
Correct |
243 ms |
268412 KB |
Output is correct |
130 |
Correct |
262 ms |
270712 KB |
Output is correct |
131 |
Correct |
249 ms |
268664 KB |
Output is correct |
132 |
Correct |
238 ms |
268408 KB |
Output is correct |
133 |
Correct |
769 ms |
294044 KB |
Output is correct |
134 |
Correct |
614 ms |
278648 KB |
Output is correct |
135 |
Correct |
502 ms |
274680 KB |
Output is correct |
136 |
Correct |
355 ms |
272120 KB |
Output is correct |
137 |
Correct |
772 ms |
293880 KB |
Output is correct |
138 |
Correct |
629 ms |
278648 KB |
Output is correct |
139 |
Correct |
521 ms |
274764 KB |
Output is correct |
140 |
Correct |
439 ms |
273528 KB |
Output is correct |
141 |
Correct |
795 ms |
305396 KB |
Output is correct |
142 |
Correct |
765 ms |
299384 KB |
Output is correct |
143 |
Correct |
739 ms |
298064 KB |
Output is correct |
144 |
Correct |
751 ms |
297920 KB |
Output is correct |
145 |
Correct |
844 ms |
312696 KB |
Output is correct |
146 |
Correct |
813 ms |
312744 KB |
Output is correct |
147 |
Correct |
824 ms |
312720 KB |
Output is correct |
148 |
Correct |
850 ms |
312684 KB |
Output is correct |
149 |
Correct |
760 ms |
293856 KB |
Output is correct |
150 |
Correct |
622 ms |
278472 KB |
Output is correct |
151 |
Correct |
507 ms |
274680 KB |
Output is correct |
152 |
Correct |
359 ms |
272268 KB |
Output is correct |
153 |
Correct |
756 ms |
293880 KB |
Output is correct |
154 |
Correct |
623 ms |
278520 KB |
Output is correct |
155 |
Correct |
505 ms |
274636 KB |
Output is correct |
156 |
Correct |
441 ms |
273400 KB |
Output is correct |
157 |
Correct |
795 ms |
305652 KB |
Output is correct |
158 |
Correct |
782 ms |
299512 KB |
Output is correct |
159 |
Correct |
752 ms |
298256 KB |
Output is correct |
160 |
Correct |
748 ms |
297900 KB |
Output is correct |
161 |
Correct |
819 ms |
312576 KB |
Output is correct |
162 |
Correct |
814 ms |
312672 KB |
Output is correct |
163 |
Correct |
813 ms |
312684 KB |
Output is correct |
164 |
Correct |
817 ms |
312696 KB |
Output is correct |
165 |
Correct |
324 ms |
271480 KB |
Output is correct |
166 |
Correct |
309 ms |
271608 KB |
Output is correct |
167 |
Correct |
327 ms |
271436 KB |
Output is correct |
168 |
Correct |
316 ms |
271480 KB |
Output is correct |
169 |
Correct |
442 ms |
273656 KB |
Output is correct |
170 |
Correct |
409 ms |
273016 KB |
Output is correct |
171 |
Correct |
399 ms |
272760 KB |
Output is correct |
172 |
Correct |
352 ms |
271736 KB |
Output is correct |
173 |
Correct |
748 ms |
292344 KB |
Output is correct |
174 |
Correct |
591 ms |
278008 KB |
Output is correct |
175 |
Correct |
483 ms |
274168 KB |
Output is correct |
176 |
Correct |
347 ms |
271864 KB |
Output is correct |
177 |
Correct |
711 ms |
290108 KB |
Output is correct |
178 |
Correct |
601 ms |
277256 KB |
Output is correct |
179 |
Correct |
496 ms |
274040 KB |
Output is correct |
180 |
Correct |
346 ms |
271864 KB |
Output is correct |
181 |
Correct |
520 ms |
291956 KB |
Output is correct |
182 |
Correct |
607 ms |
292084 KB |
Output is correct |
183 |
Correct |
518 ms |
291832 KB |
Output is correct |
184 |
Correct |
584 ms |
291956 KB |
Output is correct |
185 |
Correct |
526 ms |
291828 KB |
Output is correct |
186 |
Correct |
621 ms |
292084 KB |
Output is correct |
187 |
Correct |
527 ms |
291968 KB |
Output is correct |
188 |
Correct |
591 ms |
291828 KB |
Output is correct |
189 |
Correct |
528 ms |
291956 KB |
Output is correct |
190 |
Correct |
616 ms |
291828 KB |
Output is correct |
191 |
Correct |
773 ms |
312564 KB |
Output is correct |
192 |
Correct |
598 ms |
312452 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2732 ms |
451440 KB |
Output is correct |
2 |
Correct |
2273 ms |
451360 KB |
Output is correct |
3 |
Correct |
5530 ms |
637700 KB |
Output is correct |
4 |
Correct |
5644 ms |
637508 KB |
Output is correct |
5 |
Correct |
6932 ms |
725140 KB |
Output is correct |
6 |
Correct |
6983 ms |
725452 KB |
Output is correct |
7 |
Correct |
6286 ms |
351060 KB |
Output is correct |
8 |
Correct |
5291 ms |
332716 KB |
Output is correct |
9 |
Correct |
4811 ms |
330092 KB |
Output is correct |
10 |
Execution timed out |
7013 ms |
363996 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
176 ms |
266872 KB |
Output is correct |
2 |
Correct |
172 ms |
266616 KB |
Output is correct |
3 |
Correct |
169 ms |
266616 KB |
Output is correct |
4 |
Correct |
173 ms |
266616 KB |
Output is correct |
5 |
Correct |
172 ms |
266744 KB |
Output is correct |
6 |
Correct |
170 ms |
266616 KB |
Output is correct |
7 |
Correct |
173 ms |
266616 KB |
Output is correct |
8 |
Correct |
171 ms |
266744 KB |
Output is correct |
9 |
Correct |
172 ms |
266872 KB |
Output is correct |
10 |
Correct |
172 ms |
266872 KB |
Output is correct |
11 |
Correct |
170 ms |
266872 KB |
Output is correct |
12 |
Correct |
172 ms |
266872 KB |
Output is correct |
13 |
Correct |
172 ms |
267084 KB |
Output is correct |
14 |
Correct |
173 ms |
267000 KB |
Output is correct |
15 |
Correct |
172 ms |
267000 KB |
Output is correct |
16 |
Correct |
176 ms |
267000 KB |
Output is correct |
17 |
Correct |
178 ms |
266744 KB |
Output is correct |
18 |
Correct |
169 ms |
266616 KB |
Output is correct |
19 |
Correct |
171 ms |
266616 KB |
Output is correct |
20 |
Correct |
175 ms |
266624 KB |
Output is correct |
21 |
Correct |
171 ms |
266744 KB |
Output is correct |
22 |
Correct |
174 ms |
266616 KB |
Output is correct |
23 |
Correct |
173 ms |
266568 KB |
Output is correct |
24 |
Correct |
170 ms |
266616 KB |
Output is correct |
25 |
Correct |
174 ms |
266976 KB |
Output is correct |
26 |
Correct |
170 ms |
266872 KB |
Output is correct |
27 |
Correct |
171 ms |
266744 KB |
Output is correct |
28 |
Correct |
171 ms |
266744 KB |
Output is correct |
29 |
Correct |
171 ms |
267000 KB |
Output is correct |
30 |
Correct |
171 ms |
267000 KB |
Output is correct |
31 |
Correct |
176 ms |
267000 KB |
Output is correct |
32 |
Correct |
183 ms |
267000 KB |
Output is correct |
33 |
Correct |
168 ms |
266616 KB |
Output is correct |
34 |
Correct |
172 ms |
266744 KB |
Output is correct |
35 |
Correct |
173 ms |
266616 KB |
Output is correct |
36 |
Correct |
174 ms |
266744 KB |
Output is correct |
37 |
Correct |
173 ms |
266616 KB |
Output is correct |
38 |
Correct |
172 ms |
266616 KB |
Output is correct |
39 |
Correct |
171 ms |
266616 KB |
Output is correct |
40 |
Correct |
169 ms |
266552 KB |
Output is correct |
41 |
Correct |
172 ms |
266744 KB |
Output is correct |
42 |
Correct |
177 ms |
266616 KB |
Output is correct |
43 |
Correct |
174 ms |
266616 KB |
Output is correct |
44 |
Correct |
171 ms |
266616 KB |
Output is correct |
45 |
Correct |
172 ms |
266744 KB |
Output is correct |
46 |
Correct |
170 ms |
266620 KB |
Output is correct |
47 |
Correct |
174 ms |
266616 KB |
Output is correct |
48 |
Correct |
173 ms |
266744 KB |
Output is correct |
49 |
Correct |
172 ms |
266856 KB |
Output is correct |
50 |
Correct |
173 ms |
266944 KB |
Output is correct |
51 |
Correct |
172 ms |
266872 KB |
Output is correct |
52 |
Correct |
171 ms |
266904 KB |
Output is correct |
53 |
Correct |
174 ms |
266744 KB |
Output is correct |
54 |
Correct |
169 ms |
266752 KB |
Output is correct |
55 |
Correct |
182 ms |
266744 KB |
Output is correct |
56 |
Correct |
171 ms |
266744 KB |
Output is correct |
57 |
Correct |
170 ms |
266872 KB |
Output is correct |
58 |
Correct |
173 ms |
266748 KB |
Output is correct |
59 |
Correct |
174 ms |
267000 KB |
Output is correct |
60 |
Correct |
171 ms |
267000 KB |
Output is correct |
61 |
Correct |
171 ms |
266464 KB |
Output is correct |
62 |
Correct |
168 ms |
266616 KB |
Output is correct |
63 |
Correct |
172 ms |
266488 KB |
Output is correct |
64 |
Correct |
286 ms |
273272 KB |
Output is correct |
65 |
Correct |
259 ms |
269432 KB |
Output is correct |
66 |
Correct |
239 ms |
268536 KB |
Output is correct |
67 |
Correct |
210 ms |
267768 KB |
Output is correct |
68 |
Correct |
280 ms |
273064 KB |
Output is correct |
69 |
Correct |
257 ms |
269432 KB |
Output is correct |
70 |
Correct |
238 ms |
268536 KB |
Output is correct |
71 |
Correct |
226 ms |
268280 KB |
Output is correct |
72 |
Correct |
296 ms |
275832 KB |
Output is correct |
73 |
Correct |
284 ms |
274424 KB |
Output is correct |
74 |
Correct |
291 ms |
274516 KB |
Output is correct |
75 |
Correct |
273 ms |
273912 KB |
Output is correct |
76 |
Correct |
297 ms |
277704 KB |
Output is correct |
77 |
Correct |
309 ms |
277588 KB |
Output is correct |
78 |
Correct |
297 ms |
277624 KB |
Output is correct |
79 |
Correct |
298 ms |
277624 KB |
Output is correct |
80 |
Correct |
286 ms |
273144 KB |
Output is correct |
81 |
Correct |
252 ms |
269432 KB |
Output is correct |
82 |
Correct |
233 ms |
268408 KB |
Output is correct |
83 |
Correct |
205 ms |
267908 KB |
Output is correct |
84 |
Correct |
279 ms |
273272 KB |
Output is correct |
85 |
Correct |
252 ms |
269432 KB |
Output is correct |
86 |
Correct |
235 ms |
268536 KB |
Output is correct |
87 |
Correct |
228 ms |
268280 KB |
Output is correct |
88 |
Correct |
286 ms |
276088 KB |
Output is correct |
89 |
Correct |
282 ms |
274424 KB |
Output is correct |
90 |
Correct |
279 ms |
274168 KB |
Output is correct |
91 |
Correct |
279 ms |
274040 KB |
Output is correct |
92 |
Correct |
298 ms |
277624 KB |
Output is correct |
93 |
Correct |
290 ms |
277752 KB |
Output is correct |
94 |
Correct |
290 ms |
277624 KB |
Output is correct |
95 |
Correct |
294 ms |
277624 KB |
Output is correct |
96 |
Correct |
202 ms |
267768 KB |
Output is correct |
97 |
Correct |
200 ms |
267768 KB |
Output is correct |
98 |
Correct |
197 ms |
267896 KB |
Output is correct |
99 |
Correct |
198 ms |
267768 KB |
Output is correct |
100 |
Correct |
225 ms |
268280 KB |
Output is correct |
101 |
Correct |
241 ms |
268024 KB |
Output is correct |
102 |
Correct |
218 ms |
268152 KB |
Output is correct |
103 |
Correct |
200 ms |
267768 KB |
Output is correct |
104 |
Correct |
268 ms |
272632 KB |
Output is correct |
105 |
Correct |
244 ms |
269176 KB |
Output is correct |
106 |
Correct |
231 ms |
268300 KB |
Output is correct |
107 |
Correct |
201 ms |
267768 KB |
Output is correct |
108 |
Correct |
284 ms |
272120 KB |
Output is correct |
109 |
Correct |
248 ms |
269116 KB |
Output is correct |
110 |
Correct |
232 ms |
268280 KB |
Output is correct |
111 |
Correct |
209 ms |
267768 KB |
Output is correct |
112 |
Correct |
245 ms |
272632 KB |
Output is correct |
113 |
Correct |
258 ms |
272632 KB |
Output is correct |
114 |
Correct |
241 ms |
272632 KB |
Output is correct |
115 |
Correct |
249 ms |
272632 KB |
Output is correct |
116 |
Correct |
244 ms |
272760 KB |
Output is correct |
117 |
Correct |
247 ms |
272636 KB |
Output is correct |
118 |
Correct |
238 ms |
272632 KB |
Output is correct |
119 |
Correct |
248 ms |
272760 KB |
Output is correct |
120 |
Correct |
240 ms |
272632 KB |
Output is correct |
121 |
Correct |
252 ms |
272600 KB |
Output is correct |
122 |
Correct |
302 ms |
277624 KB |
Output is correct |
123 |
Correct |
261 ms |
277496 KB |
Output is correct |
124 |
Correct |
257 ms |
269688 KB |
Output is correct |
125 |
Correct |
238 ms |
268664 KB |
Output is correct |
126 |
Correct |
233 ms |
268496 KB |
Output is correct |
127 |
Correct |
256 ms |
270456 KB |
Output is correct |
128 |
Correct |
238 ms |
268664 KB |
Output is correct |
129 |
Correct |
243 ms |
268412 KB |
Output is correct |
130 |
Correct |
262 ms |
270712 KB |
Output is correct |
131 |
Correct |
249 ms |
268664 KB |
Output is correct |
132 |
Correct |
238 ms |
268408 KB |
Output is correct |
133 |
Correct |
769 ms |
294044 KB |
Output is correct |
134 |
Correct |
614 ms |
278648 KB |
Output is correct |
135 |
Correct |
502 ms |
274680 KB |
Output is correct |
136 |
Correct |
355 ms |
272120 KB |
Output is correct |
137 |
Correct |
772 ms |
293880 KB |
Output is correct |
138 |
Correct |
629 ms |
278648 KB |
Output is correct |
139 |
Correct |
521 ms |
274764 KB |
Output is correct |
140 |
Correct |
439 ms |
273528 KB |
Output is correct |
141 |
Correct |
795 ms |
305396 KB |
Output is correct |
142 |
Correct |
765 ms |
299384 KB |
Output is correct |
143 |
Correct |
739 ms |
298064 KB |
Output is correct |
144 |
Correct |
751 ms |
297920 KB |
Output is correct |
145 |
Correct |
844 ms |
312696 KB |
Output is correct |
146 |
Correct |
813 ms |
312744 KB |
Output is correct |
147 |
Correct |
824 ms |
312720 KB |
Output is correct |
148 |
Correct |
850 ms |
312684 KB |
Output is correct |
149 |
Correct |
760 ms |
293856 KB |
Output is correct |
150 |
Correct |
622 ms |
278472 KB |
Output is correct |
151 |
Correct |
507 ms |
274680 KB |
Output is correct |
152 |
Correct |
359 ms |
272268 KB |
Output is correct |
153 |
Correct |
756 ms |
293880 KB |
Output is correct |
154 |
Correct |
623 ms |
278520 KB |
Output is correct |
155 |
Correct |
505 ms |
274636 KB |
Output is correct |
156 |
Correct |
441 ms |
273400 KB |
Output is correct |
157 |
Correct |
795 ms |
305652 KB |
Output is correct |
158 |
Correct |
782 ms |
299512 KB |
Output is correct |
159 |
Correct |
752 ms |
298256 KB |
Output is correct |
160 |
Correct |
748 ms |
297900 KB |
Output is correct |
161 |
Correct |
819 ms |
312576 KB |
Output is correct |
162 |
Correct |
814 ms |
312672 KB |
Output is correct |
163 |
Correct |
813 ms |
312684 KB |
Output is correct |
164 |
Correct |
817 ms |
312696 KB |
Output is correct |
165 |
Correct |
324 ms |
271480 KB |
Output is correct |
166 |
Correct |
309 ms |
271608 KB |
Output is correct |
167 |
Correct |
327 ms |
271436 KB |
Output is correct |
168 |
Correct |
316 ms |
271480 KB |
Output is correct |
169 |
Correct |
442 ms |
273656 KB |
Output is correct |
170 |
Correct |
409 ms |
273016 KB |
Output is correct |
171 |
Correct |
399 ms |
272760 KB |
Output is correct |
172 |
Correct |
352 ms |
271736 KB |
Output is correct |
173 |
Correct |
748 ms |
292344 KB |
Output is correct |
174 |
Correct |
591 ms |
278008 KB |
Output is correct |
175 |
Correct |
483 ms |
274168 KB |
Output is correct |
176 |
Correct |
347 ms |
271864 KB |
Output is correct |
177 |
Correct |
711 ms |
290108 KB |
Output is correct |
178 |
Correct |
601 ms |
277256 KB |
Output is correct |
179 |
Correct |
496 ms |
274040 KB |
Output is correct |
180 |
Correct |
346 ms |
271864 KB |
Output is correct |
181 |
Correct |
520 ms |
291956 KB |
Output is correct |
182 |
Correct |
607 ms |
292084 KB |
Output is correct |
183 |
Correct |
518 ms |
291832 KB |
Output is correct |
184 |
Correct |
584 ms |
291956 KB |
Output is correct |
185 |
Correct |
526 ms |
291828 KB |
Output is correct |
186 |
Correct |
621 ms |
292084 KB |
Output is correct |
187 |
Correct |
527 ms |
291968 KB |
Output is correct |
188 |
Correct |
591 ms |
291828 KB |
Output is correct |
189 |
Correct |
528 ms |
291956 KB |
Output is correct |
190 |
Correct |
616 ms |
291828 KB |
Output is correct |
191 |
Correct |
773 ms |
312564 KB |
Output is correct |
192 |
Correct |
598 ms |
312452 KB |
Output is correct |
193 |
Correct |
2732 ms |
451440 KB |
Output is correct |
194 |
Correct |
2273 ms |
451360 KB |
Output is correct |
195 |
Correct |
5530 ms |
637700 KB |
Output is correct |
196 |
Correct |
5644 ms |
637508 KB |
Output is correct |
197 |
Correct |
6932 ms |
725140 KB |
Output is correct |
198 |
Correct |
6983 ms |
725452 KB |
Output is correct |
199 |
Correct |
6286 ms |
351060 KB |
Output is correct |
200 |
Correct |
5291 ms |
332716 KB |
Output is correct |
201 |
Correct |
4811 ms |
330092 KB |
Output is correct |
202 |
Execution timed out |
7013 ms |
363996 KB |
Time limit exceeded |
203 |
Halted |
0 ms |
0 KB |
- |