#include <bits/stdc++.h>
using namespace std;
#define int long long
#define getchar getchar_unlocked
struct node{
int32_t s,e,m;
int lazymin,lazych;
int v;
node *l,*r;
node (int32_t _s, int32_t _e){
s = _s; e = _e; m = (s+e)/2;
lazymin = 0; lazych = 0;
v = 0;
if (s!=e){
l = new node(s,m);
r = new node(m+1,e);
}
}
void proc(){
if (lazymin==0 && lazych==0) return;
if (s!=e){
l->lazymin = min(l->lazymin,l->lazych+lazymin);
l->lazych += lazych;
r->lazymin = min(r->lazymin,r->lazych+lazymin);
r->lazych += lazych;
}
if (s==e){
v += lazymin;
v = max(v,0LL);
v -= lazymin;
v += lazych;
}
lazymin = 0;
lazych = 0;
}
void inc(int32_t a, int32_t b, int val){
proc();
if (a<=s && e<=b){
lazych += val;
proc();
return;
}
else if (b<=m){
l->inc(a,b,val);
}
else if (a>m){
r->inc(a,b,val);
}
else{
l->inc(a,b,val);
r->inc(a,b,val);
}
}
void dec(int32_t a, int32_t b, int val){
proc();
if (a<=s && e<=b){
lazych -= val;
lazymin = min(lazymin,lazych);
proc();
return;
}
else if (b<=m){
l->dec(a,b,val);
}
else if (a>m){
r->dec(a,b,val);
}
else{
l->dec(a,b,val);
r->dec(a,b,val);
}
}
int qu(int32_t pos){
proc();
if (s==e) return v;
if (pos>m)return r->qu(pos);
else return l->qu(pos);
}
}*root;
//vector<q_dat> query1;
int groupnum[250005];
//vector<q_dat> query2;
vector<pair<pair<int,int>,int> > query3;
int fw[250005];
void upd(int32_t pos, int val){
while (pos<250005){
fw[pos] += val;
pos+=pos&-pos;
}
}
int qu(int32_t pos){
int ans = 0;
while (pos>0){
ans += fw[pos];
pos -= pos&-pos;
}
return ans;
}
int numt[250005];
int32_t ans[250005];
vector<pair<pair<int32_t,int32_t>,int32_t> > bsvals[250005];
vector<pair<pair<int32_t,int32_t>,int32_t> > bsvals2[250005];
struct node2{
int32_t s, e,m;
int lazyval;
node2 *l,*r;
node2 (int32_t _s, int32_t _e){
s = _s; e = _e;m = (s+e)/2;
lazyval = -1;
if (s!=e){
l = new node2(s,m);
r = new node2(m+1,e);
}
}
void proc(){
if (lazyval==-1) return;
if (s!=e){
l->lazyval = lazyval;
r->lazyval = lazyval;
lazyval = -1;
}
}
int qu(int32_t pos){
proc();
if (s==e) return lazyval;
if (pos<=m) return l->qu(pos);
return r->qu(pos);
}
void upd(int32_t a, int32_t b, int val){
proc();
if (a<=s && e<=b) {
lazyval = val;
proc();
return;
}
if (b<=m){
l->upd(a,b,val);
}
else if (a>m){
r->upd(a,b,val);
}
else{
l->upd(a,b,val);
r->upd(a,b,val);
}
}
}*root2;
int32_t incl[250005];
int32_t incr[250005];
int incamt[250005];
int finans[250005];
inline void scan(int &a){
a = 0;
char ch = ' ';
while (ch<'0' || ch>'9') ch = getchar();
while (ch>='0' && ch<='9'){
a = (a<<3)+(a<<1)+ch-'0';
ch = getchar();
}
}
main(){
int n,m,q;
scan(n); scan(m); scan(q);
root = new node(1,n);
for (int x = 0; x<q; x++){
int a;
scan(a);
if (a==1){
int b,c,d,e;
scan(b); scan(c); scan(d); scan(e);
groupnum[x] = d;
// query1.push_back(q_dat(b,c,x,e));
root->inc(b,c,e);
upd(b,e);
upd(c+1,-e);
incl[x] = b;
incr[x] = c;
incamt[x] = e;
}
else if (a==2){
int b,c,d;
scan(b); scan(c); scan(d);
// query2.push_back(q_dat(b,c,x,d));
root->dec(b,c,d);
}
else if (a==3){
int b,c;
scan(b); scan(c);
query3.push_back({{b,c},x});
int num = root->qu(b);
numt[x] = qu(b)-num+c;
incl[x] = b;
if (num<c){
ans[x] = -1;
}
//printf("%lld has %lld\n",b,numpopped[x]);
}
}
for (auto x : query3){
if (ans[x.second]==-1) continue;
int a = -1;
int b = x.second;
int mid = (a+b)/2;
bsvals[mid].push_back({{a,b},x.second});
}
if (m==1){
for (auto x : query3){
if (ans[x.second]==-1) printf("0\n");
else printf("1\n");
}
return 0;
}
bool found = true;
while (found){
found = false;
for (int32_t k = 0; k<250005; k++){
fw[k] = 0;
}
for (int32_t t = 0; t<q; t++){
if (incamt[t]!=0){
upd(incl[t],incamt[t]);
upd(incr[t]+1,-incamt[t]);
}
for (auto x : bsvals[t]){
if (x.first.first+1==x.first.second) {
ans[x.second] = x.first.second;
continue;
}
if (qu(incl[x.second])>=numt[x.second]){
bsvals2[(x.first.first+t)/2].push_back({{x.first.first,t},x.second});
}
else{
bsvals2[(x.first.second+t)/2].push_back({{t,x.first.second},x.second});
}
found = true;
}
bsvals[t].clear();
}
swap(bsvals2,bsvals);
}
root2 = new node2(1,n);
vector<pair<pair<int,int>,int> > stuff;
for (auto x : query3){
if (ans[x.second]==-1) {
continue;
}
stuff.push_back({{ans[x.second],incl[x.second]},x.second});
}
sort(stuff.begin(),stuff.end());
int curt = 0;
for (auto x : stuff){
while (curt<=x.first.first){
if (incamt[curt]!=0){
root2->upd(incl[curt],incr[curt],curt);
//printf("set %lld to %lld with %lld\n",incl[curt],incr[curt],curt);
}
curt++;
}
finans[x.second] = root2->qu(x.first.second);
//printf("query %lld = %lld\n",x.first.second,finans[x.second]);
}
for (auto x : query3){
// printf("ans = %lld\n",ans[x.second]);
if (ans[x.second]==-1){
printf("0\n");
}
else{
assert(finans[x.second]!=-1);
printf("%lld\n",groupnum[finans[x.second]]);
}
}
}
Compilation message
foodcourt.cpp:172:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
172 | main(){
| ^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
14404 KB |
Output is correct |
2 |
Correct |
30 ms |
14576 KB |
Output is correct |
3 |
Correct |
28 ms |
14500 KB |
Output is correct |
4 |
Correct |
30 ms |
14660 KB |
Output is correct |
5 |
Correct |
27 ms |
14176 KB |
Output is correct |
6 |
Correct |
27 ms |
14116 KB |
Output is correct |
7 |
Correct |
28 ms |
14540 KB |
Output is correct |
8 |
Correct |
27 ms |
14588 KB |
Output is correct |
9 |
Correct |
28 ms |
14592 KB |
Output is correct |
10 |
Correct |
29 ms |
14660 KB |
Output is correct |
11 |
Correct |
29 ms |
14708 KB |
Output is correct |
12 |
Correct |
32 ms |
14668 KB |
Output is correct |
13 |
Correct |
26 ms |
14544 KB |
Output is correct |
14 |
Correct |
28 ms |
14612 KB |
Output is correct |
15 |
Correct |
28 ms |
14592 KB |
Output is correct |
16 |
Correct |
29 ms |
14604 KB |
Output is correct |
17 |
Correct |
27 ms |
14472 KB |
Output is correct |
18 |
Correct |
28 ms |
14660 KB |
Output is correct |
19 |
Correct |
28 ms |
14404 KB |
Output is correct |
20 |
Correct |
28 ms |
14536 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
14404 KB |
Output is correct |
2 |
Correct |
30 ms |
14576 KB |
Output is correct |
3 |
Correct |
28 ms |
14500 KB |
Output is correct |
4 |
Correct |
30 ms |
14660 KB |
Output is correct |
5 |
Correct |
27 ms |
14176 KB |
Output is correct |
6 |
Correct |
27 ms |
14116 KB |
Output is correct |
7 |
Correct |
28 ms |
14540 KB |
Output is correct |
8 |
Correct |
27 ms |
14588 KB |
Output is correct |
9 |
Correct |
28 ms |
14592 KB |
Output is correct |
10 |
Correct |
29 ms |
14660 KB |
Output is correct |
11 |
Correct |
29 ms |
14708 KB |
Output is correct |
12 |
Correct |
32 ms |
14668 KB |
Output is correct |
13 |
Correct |
26 ms |
14544 KB |
Output is correct |
14 |
Correct |
28 ms |
14612 KB |
Output is correct |
15 |
Correct |
28 ms |
14592 KB |
Output is correct |
16 |
Correct |
29 ms |
14604 KB |
Output is correct |
17 |
Correct |
27 ms |
14472 KB |
Output is correct |
18 |
Correct |
28 ms |
14660 KB |
Output is correct |
19 |
Correct |
28 ms |
14404 KB |
Output is correct |
20 |
Correct |
28 ms |
14536 KB |
Output is correct |
21 |
Correct |
29 ms |
14560 KB |
Output is correct |
22 |
Correct |
30 ms |
14636 KB |
Output is correct |
23 |
Correct |
29 ms |
14604 KB |
Output is correct |
24 |
Correct |
29 ms |
14628 KB |
Output is correct |
25 |
Correct |
26 ms |
14156 KB |
Output is correct |
26 |
Correct |
27 ms |
14156 KB |
Output is correct |
27 |
Correct |
30 ms |
14648 KB |
Output is correct |
28 |
Correct |
31 ms |
14696 KB |
Output is correct |
29 |
Correct |
29 ms |
14696 KB |
Output is correct |
30 |
Correct |
32 ms |
14704 KB |
Output is correct |
31 |
Correct |
29 ms |
14608 KB |
Output is correct |
32 |
Correct |
28 ms |
14560 KB |
Output is correct |
33 |
Correct |
27 ms |
14500 KB |
Output is correct |
34 |
Correct |
28 ms |
14616 KB |
Output is correct |
35 |
Correct |
29 ms |
14476 KB |
Output is correct |
36 |
Correct |
29 ms |
14584 KB |
Output is correct |
37 |
Correct |
30 ms |
14440 KB |
Output is correct |
38 |
Correct |
28 ms |
14540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
124 ms |
31108 KB |
Output is correct |
2 |
Correct |
132 ms |
31984 KB |
Output is correct |
3 |
Correct |
129 ms |
32120 KB |
Output is correct |
4 |
Correct |
136 ms |
32192 KB |
Output is correct |
5 |
Correct |
164 ms |
32068 KB |
Output is correct |
6 |
Correct |
147 ms |
32068 KB |
Output is correct |
7 |
Correct |
85 ms |
20240 KB |
Output is correct |
8 |
Correct |
87 ms |
20544 KB |
Output is correct |
9 |
Correct |
136 ms |
32012 KB |
Output is correct |
10 |
Correct |
128 ms |
32012 KB |
Output is correct |
11 |
Correct |
126 ms |
31884 KB |
Output is correct |
12 |
Correct |
143 ms |
32008 KB |
Output is correct |
13 |
Correct |
133 ms |
29492 KB |
Output is correct |
14 |
Correct |
148 ms |
34664 KB |
Output is correct |
15 |
Correct |
167 ms |
27796 KB |
Output is correct |
16 |
Correct |
170 ms |
32440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
383 ms |
53408 KB |
Output is correct |
2 |
Correct |
329 ms |
48448 KB |
Output is correct |
3 |
Correct |
428 ms |
59160 KB |
Output is correct |
4 |
Correct |
349 ms |
54444 KB |
Output is correct |
5 |
Correct |
304 ms |
46560 KB |
Output is correct |
6 |
Correct |
428 ms |
57988 KB |
Output is correct |
7 |
Correct |
45 ms |
25520 KB |
Output is correct |
8 |
Correct |
48 ms |
25544 KB |
Output is correct |
9 |
Correct |
378 ms |
60392 KB |
Output is correct |
10 |
Correct |
418 ms |
60332 KB |
Output is correct |
11 |
Correct |
436 ms |
55396 KB |
Output is correct |
12 |
Correct |
454 ms |
57828 KB |
Output is correct |
13 |
Correct |
427 ms |
55660 KB |
Output is correct |
14 |
Correct |
427 ms |
57952 KB |
Output is correct |
15 |
Correct |
440 ms |
57916 KB |
Output is correct |
16 |
Correct |
430 ms |
57820 KB |
Output is correct |
17 |
Correct |
465 ms |
57920 KB |
Output is correct |
18 |
Correct |
431 ms |
56716 KB |
Output is correct |
19 |
Correct |
434 ms |
57836 KB |
Output is correct |
20 |
Correct |
426 ms |
56728 KB |
Output is correct |
21 |
Correct |
452 ms |
58120 KB |
Output is correct |
22 |
Correct |
433 ms |
58092 KB |
Output is correct |
23 |
Correct |
443 ms |
57896 KB |
Output is correct |
24 |
Correct |
429 ms |
57832 KB |
Output is correct |
25 |
Correct |
239 ms |
49620 KB |
Output is correct |
26 |
Correct |
279 ms |
57000 KB |
Output is correct |
27 |
Correct |
247 ms |
55476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
14404 KB |
Output is correct |
2 |
Correct |
30 ms |
14576 KB |
Output is correct |
3 |
Correct |
28 ms |
14500 KB |
Output is correct |
4 |
Correct |
30 ms |
14660 KB |
Output is correct |
5 |
Correct |
27 ms |
14176 KB |
Output is correct |
6 |
Correct |
27 ms |
14116 KB |
Output is correct |
7 |
Correct |
28 ms |
14540 KB |
Output is correct |
8 |
Correct |
27 ms |
14588 KB |
Output is correct |
9 |
Correct |
28 ms |
14592 KB |
Output is correct |
10 |
Correct |
29 ms |
14660 KB |
Output is correct |
11 |
Correct |
29 ms |
14708 KB |
Output is correct |
12 |
Correct |
32 ms |
14668 KB |
Output is correct |
13 |
Correct |
26 ms |
14544 KB |
Output is correct |
14 |
Correct |
28 ms |
14612 KB |
Output is correct |
15 |
Correct |
28 ms |
14592 KB |
Output is correct |
16 |
Correct |
29 ms |
14604 KB |
Output is correct |
17 |
Correct |
27 ms |
14472 KB |
Output is correct |
18 |
Correct |
28 ms |
14660 KB |
Output is correct |
19 |
Correct |
28 ms |
14404 KB |
Output is correct |
20 |
Correct |
28 ms |
14536 KB |
Output is correct |
21 |
Correct |
124 ms |
31108 KB |
Output is correct |
22 |
Correct |
132 ms |
31984 KB |
Output is correct |
23 |
Correct |
129 ms |
32120 KB |
Output is correct |
24 |
Correct |
136 ms |
32192 KB |
Output is correct |
25 |
Correct |
164 ms |
32068 KB |
Output is correct |
26 |
Correct |
147 ms |
32068 KB |
Output is correct |
27 |
Correct |
85 ms |
20240 KB |
Output is correct |
28 |
Correct |
87 ms |
20544 KB |
Output is correct |
29 |
Correct |
136 ms |
32012 KB |
Output is correct |
30 |
Correct |
128 ms |
32012 KB |
Output is correct |
31 |
Correct |
126 ms |
31884 KB |
Output is correct |
32 |
Correct |
143 ms |
32008 KB |
Output is correct |
33 |
Correct |
133 ms |
29492 KB |
Output is correct |
34 |
Correct |
148 ms |
34664 KB |
Output is correct |
35 |
Correct |
167 ms |
27796 KB |
Output is correct |
36 |
Correct |
170 ms |
32440 KB |
Output is correct |
37 |
Correct |
179 ms |
34528 KB |
Output is correct |
38 |
Correct |
174 ms |
32848 KB |
Output is correct |
39 |
Correct |
87 ms |
19904 KB |
Output is correct |
40 |
Correct |
100 ms |
20724 KB |
Output is correct |
41 |
Correct |
202 ms |
34372 KB |
Output is correct |
42 |
Correct |
195 ms |
35460 KB |
Output is correct |
43 |
Correct |
182 ms |
35728 KB |
Output is correct |
44 |
Correct |
188 ms |
35020 KB |
Output is correct |
45 |
Correct |
203 ms |
35652 KB |
Output is correct |
46 |
Correct |
195 ms |
35748 KB |
Output is correct |
47 |
Correct |
125 ms |
36672 KB |
Output is correct |
48 |
Correct |
166 ms |
36668 KB |
Output is correct |
49 |
Correct |
135 ms |
29064 KB |
Output is correct |
50 |
Correct |
172 ms |
34148 KB |
Output is correct |
51 |
Correct |
185 ms |
35276 KB |
Output is correct |
52 |
Correct |
182 ms |
35396 KB |
Output is correct |
53 |
Correct |
131 ms |
29908 KB |
Output is correct |
54 |
Correct |
164 ms |
32244 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
220 ms |
34944 KB |
Output is correct |
2 |
Correct |
218 ms |
34856 KB |
Output is correct |
3 |
Correct |
228 ms |
37104 KB |
Output is correct |
4 |
Correct |
194 ms |
34320 KB |
Output is correct |
5 |
Correct |
203 ms |
35568 KB |
Output is correct |
6 |
Correct |
238 ms |
37096 KB |
Output is correct |
7 |
Correct |
131 ms |
21944 KB |
Output is correct |
8 |
Correct |
127 ms |
21604 KB |
Output is correct |
9 |
Correct |
167 ms |
37140 KB |
Output is correct |
10 |
Correct |
161 ms |
33208 KB |
Output is correct |
11 |
Correct |
236 ms |
37144 KB |
Output is correct |
12 |
Correct |
205 ms |
37168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
14404 KB |
Output is correct |
2 |
Correct |
30 ms |
14576 KB |
Output is correct |
3 |
Correct |
28 ms |
14500 KB |
Output is correct |
4 |
Correct |
30 ms |
14660 KB |
Output is correct |
5 |
Correct |
27 ms |
14176 KB |
Output is correct |
6 |
Correct |
27 ms |
14116 KB |
Output is correct |
7 |
Correct |
28 ms |
14540 KB |
Output is correct |
8 |
Correct |
27 ms |
14588 KB |
Output is correct |
9 |
Correct |
28 ms |
14592 KB |
Output is correct |
10 |
Correct |
29 ms |
14660 KB |
Output is correct |
11 |
Correct |
29 ms |
14708 KB |
Output is correct |
12 |
Correct |
32 ms |
14668 KB |
Output is correct |
13 |
Correct |
26 ms |
14544 KB |
Output is correct |
14 |
Correct |
28 ms |
14612 KB |
Output is correct |
15 |
Correct |
28 ms |
14592 KB |
Output is correct |
16 |
Correct |
29 ms |
14604 KB |
Output is correct |
17 |
Correct |
27 ms |
14472 KB |
Output is correct |
18 |
Correct |
28 ms |
14660 KB |
Output is correct |
19 |
Correct |
28 ms |
14404 KB |
Output is correct |
20 |
Correct |
28 ms |
14536 KB |
Output is correct |
21 |
Correct |
29 ms |
14560 KB |
Output is correct |
22 |
Correct |
30 ms |
14636 KB |
Output is correct |
23 |
Correct |
29 ms |
14604 KB |
Output is correct |
24 |
Correct |
29 ms |
14628 KB |
Output is correct |
25 |
Correct |
26 ms |
14156 KB |
Output is correct |
26 |
Correct |
27 ms |
14156 KB |
Output is correct |
27 |
Correct |
30 ms |
14648 KB |
Output is correct |
28 |
Correct |
31 ms |
14696 KB |
Output is correct |
29 |
Correct |
29 ms |
14696 KB |
Output is correct |
30 |
Correct |
32 ms |
14704 KB |
Output is correct |
31 |
Correct |
29 ms |
14608 KB |
Output is correct |
32 |
Correct |
28 ms |
14560 KB |
Output is correct |
33 |
Correct |
27 ms |
14500 KB |
Output is correct |
34 |
Correct |
28 ms |
14616 KB |
Output is correct |
35 |
Correct |
29 ms |
14476 KB |
Output is correct |
36 |
Correct |
29 ms |
14584 KB |
Output is correct |
37 |
Correct |
30 ms |
14440 KB |
Output is correct |
38 |
Correct |
28 ms |
14540 KB |
Output is correct |
39 |
Correct |
124 ms |
31108 KB |
Output is correct |
40 |
Correct |
132 ms |
31984 KB |
Output is correct |
41 |
Correct |
129 ms |
32120 KB |
Output is correct |
42 |
Correct |
136 ms |
32192 KB |
Output is correct |
43 |
Correct |
164 ms |
32068 KB |
Output is correct |
44 |
Correct |
147 ms |
32068 KB |
Output is correct |
45 |
Correct |
85 ms |
20240 KB |
Output is correct |
46 |
Correct |
87 ms |
20544 KB |
Output is correct |
47 |
Correct |
136 ms |
32012 KB |
Output is correct |
48 |
Correct |
128 ms |
32012 KB |
Output is correct |
49 |
Correct |
126 ms |
31884 KB |
Output is correct |
50 |
Correct |
143 ms |
32008 KB |
Output is correct |
51 |
Correct |
133 ms |
29492 KB |
Output is correct |
52 |
Correct |
148 ms |
34664 KB |
Output is correct |
53 |
Correct |
167 ms |
27796 KB |
Output is correct |
54 |
Correct |
170 ms |
32440 KB |
Output is correct |
55 |
Correct |
179 ms |
34528 KB |
Output is correct |
56 |
Correct |
174 ms |
32848 KB |
Output is correct |
57 |
Correct |
87 ms |
19904 KB |
Output is correct |
58 |
Correct |
100 ms |
20724 KB |
Output is correct |
59 |
Correct |
202 ms |
34372 KB |
Output is correct |
60 |
Correct |
195 ms |
35460 KB |
Output is correct |
61 |
Correct |
182 ms |
35728 KB |
Output is correct |
62 |
Correct |
188 ms |
35020 KB |
Output is correct |
63 |
Correct |
203 ms |
35652 KB |
Output is correct |
64 |
Correct |
195 ms |
35748 KB |
Output is correct |
65 |
Correct |
125 ms |
36672 KB |
Output is correct |
66 |
Correct |
166 ms |
36668 KB |
Output is correct |
67 |
Correct |
135 ms |
29064 KB |
Output is correct |
68 |
Correct |
172 ms |
34148 KB |
Output is correct |
69 |
Correct |
185 ms |
35276 KB |
Output is correct |
70 |
Correct |
182 ms |
35396 KB |
Output is correct |
71 |
Correct |
131 ms |
29908 KB |
Output is correct |
72 |
Correct |
164 ms |
32244 KB |
Output is correct |
73 |
Correct |
220 ms |
34944 KB |
Output is correct |
74 |
Correct |
218 ms |
34856 KB |
Output is correct |
75 |
Correct |
228 ms |
37104 KB |
Output is correct |
76 |
Correct |
194 ms |
34320 KB |
Output is correct |
77 |
Correct |
203 ms |
35568 KB |
Output is correct |
78 |
Correct |
238 ms |
37096 KB |
Output is correct |
79 |
Correct |
131 ms |
21944 KB |
Output is correct |
80 |
Correct |
127 ms |
21604 KB |
Output is correct |
81 |
Correct |
167 ms |
37140 KB |
Output is correct |
82 |
Correct |
161 ms |
33208 KB |
Output is correct |
83 |
Correct |
236 ms |
37144 KB |
Output is correct |
84 |
Correct |
205 ms |
37168 KB |
Output is correct |
85 |
Correct |
195 ms |
32932 KB |
Output is correct |
86 |
Correct |
204 ms |
36708 KB |
Output is correct |
87 |
Correct |
186 ms |
33720 KB |
Output is correct |
88 |
Correct |
214 ms |
35628 KB |
Output is correct |
89 |
Correct |
134 ms |
29692 KB |
Output is correct |
90 |
Correct |
199 ms |
35492 KB |
Output is correct |
91 |
Correct |
153 ms |
29916 KB |
Output is correct |
92 |
Correct |
143 ms |
29708 KB |
Output is correct |
93 |
Correct |
221 ms |
35784 KB |
Output is correct |
94 |
Correct |
201 ms |
35268 KB |
Output is correct |
95 |
Correct |
194 ms |
34176 KB |
Output is correct |
96 |
Correct |
201 ms |
35644 KB |
Output is correct |
97 |
Correct |
210 ms |
35720 KB |
Output is correct |
98 |
Correct |
163 ms |
30612 KB |
Output is correct |
99 |
Correct |
132 ms |
36688 KB |
Output is correct |
100 |
Correct |
169 ms |
33468 KB |
Output is correct |
101 |
Correct |
168 ms |
36708 KB |
Output is correct |
102 |
Correct |
156 ms |
34372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
14404 KB |
Output is correct |
2 |
Correct |
30 ms |
14576 KB |
Output is correct |
3 |
Correct |
28 ms |
14500 KB |
Output is correct |
4 |
Correct |
30 ms |
14660 KB |
Output is correct |
5 |
Correct |
27 ms |
14176 KB |
Output is correct |
6 |
Correct |
27 ms |
14116 KB |
Output is correct |
7 |
Correct |
28 ms |
14540 KB |
Output is correct |
8 |
Correct |
27 ms |
14588 KB |
Output is correct |
9 |
Correct |
28 ms |
14592 KB |
Output is correct |
10 |
Correct |
29 ms |
14660 KB |
Output is correct |
11 |
Correct |
29 ms |
14708 KB |
Output is correct |
12 |
Correct |
32 ms |
14668 KB |
Output is correct |
13 |
Correct |
26 ms |
14544 KB |
Output is correct |
14 |
Correct |
28 ms |
14612 KB |
Output is correct |
15 |
Correct |
28 ms |
14592 KB |
Output is correct |
16 |
Correct |
29 ms |
14604 KB |
Output is correct |
17 |
Correct |
27 ms |
14472 KB |
Output is correct |
18 |
Correct |
28 ms |
14660 KB |
Output is correct |
19 |
Correct |
28 ms |
14404 KB |
Output is correct |
20 |
Correct |
28 ms |
14536 KB |
Output is correct |
21 |
Correct |
29 ms |
14560 KB |
Output is correct |
22 |
Correct |
30 ms |
14636 KB |
Output is correct |
23 |
Correct |
29 ms |
14604 KB |
Output is correct |
24 |
Correct |
29 ms |
14628 KB |
Output is correct |
25 |
Correct |
26 ms |
14156 KB |
Output is correct |
26 |
Correct |
27 ms |
14156 KB |
Output is correct |
27 |
Correct |
30 ms |
14648 KB |
Output is correct |
28 |
Correct |
31 ms |
14696 KB |
Output is correct |
29 |
Correct |
29 ms |
14696 KB |
Output is correct |
30 |
Correct |
32 ms |
14704 KB |
Output is correct |
31 |
Correct |
29 ms |
14608 KB |
Output is correct |
32 |
Correct |
28 ms |
14560 KB |
Output is correct |
33 |
Correct |
27 ms |
14500 KB |
Output is correct |
34 |
Correct |
28 ms |
14616 KB |
Output is correct |
35 |
Correct |
29 ms |
14476 KB |
Output is correct |
36 |
Correct |
29 ms |
14584 KB |
Output is correct |
37 |
Correct |
30 ms |
14440 KB |
Output is correct |
38 |
Correct |
28 ms |
14540 KB |
Output is correct |
39 |
Correct |
124 ms |
31108 KB |
Output is correct |
40 |
Correct |
132 ms |
31984 KB |
Output is correct |
41 |
Correct |
129 ms |
32120 KB |
Output is correct |
42 |
Correct |
136 ms |
32192 KB |
Output is correct |
43 |
Correct |
164 ms |
32068 KB |
Output is correct |
44 |
Correct |
147 ms |
32068 KB |
Output is correct |
45 |
Correct |
85 ms |
20240 KB |
Output is correct |
46 |
Correct |
87 ms |
20544 KB |
Output is correct |
47 |
Correct |
136 ms |
32012 KB |
Output is correct |
48 |
Correct |
128 ms |
32012 KB |
Output is correct |
49 |
Correct |
126 ms |
31884 KB |
Output is correct |
50 |
Correct |
143 ms |
32008 KB |
Output is correct |
51 |
Correct |
133 ms |
29492 KB |
Output is correct |
52 |
Correct |
148 ms |
34664 KB |
Output is correct |
53 |
Correct |
167 ms |
27796 KB |
Output is correct |
54 |
Correct |
170 ms |
32440 KB |
Output is correct |
55 |
Correct |
383 ms |
53408 KB |
Output is correct |
56 |
Correct |
329 ms |
48448 KB |
Output is correct |
57 |
Correct |
428 ms |
59160 KB |
Output is correct |
58 |
Correct |
349 ms |
54444 KB |
Output is correct |
59 |
Correct |
304 ms |
46560 KB |
Output is correct |
60 |
Correct |
428 ms |
57988 KB |
Output is correct |
61 |
Correct |
45 ms |
25520 KB |
Output is correct |
62 |
Correct |
48 ms |
25544 KB |
Output is correct |
63 |
Correct |
378 ms |
60392 KB |
Output is correct |
64 |
Correct |
418 ms |
60332 KB |
Output is correct |
65 |
Correct |
436 ms |
55396 KB |
Output is correct |
66 |
Correct |
454 ms |
57828 KB |
Output is correct |
67 |
Correct |
427 ms |
55660 KB |
Output is correct |
68 |
Correct |
427 ms |
57952 KB |
Output is correct |
69 |
Correct |
440 ms |
57916 KB |
Output is correct |
70 |
Correct |
430 ms |
57820 KB |
Output is correct |
71 |
Correct |
465 ms |
57920 KB |
Output is correct |
72 |
Correct |
431 ms |
56716 KB |
Output is correct |
73 |
Correct |
434 ms |
57836 KB |
Output is correct |
74 |
Correct |
426 ms |
56728 KB |
Output is correct |
75 |
Correct |
452 ms |
58120 KB |
Output is correct |
76 |
Correct |
433 ms |
58092 KB |
Output is correct |
77 |
Correct |
443 ms |
57896 KB |
Output is correct |
78 |
Correct |
429 ms |
57832 KB |
Output is correct |
79 |
Correct |
239 ms |
49620 KB |
Output is correct |
80 |
Correct |
279 ms |
57000 KB |
Output is correct |
81 |
Correct |
247 ms |
55476 KB |
Output is correct |
82 |
Correct |
179 ms |
34528 KB |
Output is correct |
83 |
Correct |
174 ms |
32848 KB |
Output is correct |
84 |
Correct |
87 ms |
19904 KB |
Output is correct |
85 |
Correct |
100 ms |
20724 KB |
Output is correct |
86 |
Correct |
202 ms |
34372 KB |
Output is correct |
87 |
Correct |
195 ms |
35460 KB |
Output is correct |
88 |
Correct |
182 ms |
35728 KB |
Output is correct |
89 |
Correct |
188 ms |
35020 KB |
Output is correct |
90 |
Correct |
203 ms |
35652 KB |
Output is correct |
91 |
Correct |
195 ms |
35748 KB |
Output is correct |
92 |
Correct |
125 ms |
36672 KB |
Output is correct |
93 |
Correct |
166 ms |
36668 KB |
Output is correct |
94 |
Correct |
135 ms |
29064 KB |
Output is correct |
95 |
Correct |
172 ms |
34148 KB |
Output is correct |
96 |
Correct |
185 ms |
35276 KB |
Output is correct |
97 |
Correct |
182 ms |
35396 KB |
Output is correct |
98 |
Correct |
131 ms |
29908 KB |
Output is correct |
99 |
Correct |
164 ms |
32244 KB |
Output is correct |
100 |
Correct |
220 ms |
34944 KB |
Output is correct |
101 |
Correct |
218 ms |
34856 KB |
Output is correct |
102 |
Correct |
228 ms |
37104 KB |
Output is correct |
103 |
Correct |
194 ms |
34320 KB |
Output is correct |
104 |
Correct |
203 ms |
35568 KB |
Output is correct |
105 |
Correct |
238 ms |
37096 KB |
Output is correct |
106 |
Correct |
131 ms |
21944 KB |
Output is correct |
107 |
Correct |
127 ms |
21604 KB |
Output is correct |
108 |
Correct |
167 ms |
37140 KB |
Output is correct |
109 |
Correct |
161 ms |
33208 KB |
Output is correct |
110 |
Correct |
236 ms |
37144 KB |
Output is correct |
111 |
Correct |
205 ms |
37168 KB |
Output is correct |
112 |
Correct |
195 ms |
32932 KB |
Output is correct |
113 |
Correct |
204 ms |
36708 KB |
Output is correct |
114 |
Correct |
186 ms |
33720 KB |
Output is correct |
115 |
Correct |
214 ms |
35628 KB |
Output is correct |
116 |
Correct |
134 ms |
29692 KB |
Output is correct |
117 |
Correct |
199 ms |
35492 KB |
Output is correct |
118 |
Correct |
153 ms |
29916 KB |
Output is correct |
119 |
Correct |
143 ms |
29708 KB |
Output is correct |
120 |
Correct |
221 ms |
35784 KB |
Output is correct |
121 |
Correct |
201 ms |
35268 KB |
Output is correct |
122 |
Correct |
194 ms |
34176 KB |
Output is correct |
123 |
Correct |
201 ms |
35644 KB |
Output is correct |
124 |
Correct |
210 ms |
35720 KB |
Output is correct |
125 |
Correct |
163 ms |
30612 KB |
Output is correct |
126 |
Correct |
132 ms |
36688 KB |
Output is correct |
127 |
Correct |
169 ms |
33468 KB |
Output is correct |
128 |
Correct |
168 ms |
36708 KB |
Output is correct |
129 |
Correct |
156 ms |
34372 KB |
Output is correct |
130 |
Correct |
890 ms |
97720 KB |
Output is correct |
131 |
Correct |
649 ms |
76060 KB |
Output is correct |
132 |
Correct |
881 ms |
99112 KB |
Output is correct |
133 |
Correct |
970 ms |
90944 KB |
Output is correct |
134 |
Correct |
887 ms |
88328 KB |
Output is correct |
135 |
Execution timed out |
1038 ms |
93856 KB |
Time limit exceeded |
136 |
Halted |
0 ms |
0 KB |
- |