#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> ii;
int n,m,q;
struct dat{
int v, pv, id;
};
dat merge(dat a, dat b){
dat D;
D.id = (a.pv + b.v > b.pv)?a.id:b.id;
D.v = a.v + b.v;
D.pv = max(a.pv + b.v, b.pv);
return D;
}
struct node{
int s,e,m;
dat D;
int NV;
node *l, *r;
node (int _s, int _e){
s = _s, e = _e, m = (s+e)/2;
D.v = D.pv = NV = 0;
D.id = e;
if (s != e){
l = new node(s, m);
r = new node(m+1, e);
}
}
void up(int x, int nv){
if (s == e){
D.v = nv;
D.pv = nv;
NV = max(0ll, nv);
return;
}
if (x > m) r->up(x,nv);
else l->up(x,nv);
D = merge(l->D, r->D);
NV = l->NV + r->NV;
}
int sum(int qs, int qe){
if (qs == s && qe == e){
return NV;
}
else if (qs > m) return r->sum(qs, qe);
else if (qe <= m) return l->sum(qs, qe);
else{
return l->sum(qs,m) + r->sum(m+1,qe);
}
}
int find(int X){
if (s == e) return s;
if (l->NV >= X) return l->find(X);
else return r->find(X-l->NV);
}
dat findMaxSuffix(int qs, int qe){
///printf("%d %d: %d %d\n",s,e,qs,qe);
if (qs == s && qe == e){
return D;
}
else if (qs > m) return r->findMaxSuffix(qs, qe);
else if (qe <= m) return l->findMaxSuffix(qs, qe);
else{
dat L = l->findMaxSuffix(qs, m);
dat R = r->findMaxSuffix(m+1,qe);
return merge(L, R);
}
}
} *root;
int ID[250005];
int ANS[250005];
vector<ii> ups[250005];
vector<ii> qus[250005];
main(){
scanf("%lld%lld%lld",&n,&m,&q);
for (int i = 0; i < q; i++){
int t;
scanf("%lld",&t);
if (t == 1){
int l,r,c,k;
scanf("%lld%lld%lld%lld",&l,&r,&c,&k);
ID[i] = c;
ups[l].push_back({i,k});
ups[r+1].push_back({i,0});
}
else if (t == 2){
int l,r,k;
scanf("%lld%lld%lld",&l,&r,&k);
ups[l].push_back({i,-k});
ups[r+1].push_back({i,0});
}
else{
int a,b;
scanf("%lld%lld",&a,&b);
qus[a].push_back({b,i});
}
}
fill(ANS, ANS+q, -1);
root = new node(0, q+1);
for (int i = 1; i <= n; i++){
//printf("at store %d\n",i);
for (auto [id, nv] : ups[i]){
//printf("updating %d to %d\n",id,nv);
root->up(id, nv);
}
for (auto [qv, id]: qus[i]){
//printf("at store %d, querying for the maxsuffix ending at %d\n",i,id);
dat res = root->findMaxSuffix(0, id);
//printf("answer %d %d %d\n",res.v, res.pv, res.id);
if (res.pv < qv){
ANS[id] = 0;
continue;
}
int target = res.pv - qv;
//printf("targeting suffix of %d\n",target);
int PF = root->sum(0, id);
//printf("sum is %d, need to find first prefix that is >= %d\n",PF,PF-target);
int ret = root->find(PF - target);
//printf("found at %d\n",ret);
ANS[id] = ID[ret];
}
}
for (int i = 0; i < q; i++){
if (ANS[i] != -1) printf("%lld\n",ANS[i]);
}
}
Compilation message
foodcourt.cpp:76:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
76 | main(){
| ^~~~
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:104:19: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
104 | for (auto [id, nv] : ups[i]){
| ^
foodcourt.cpp:108:19: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
108 | for (auto [qv, id]: qus[i]){
| ^
foodcourt.cpp:77:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
77 | scanf("%lld%lld%lld",&n,&m,&q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:80:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
80 | scanf("%lld",&t);
| ~~~~~^~~~~~~~~~~
foodcourt.cpp:83:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
83 | scanf("%lld%lld%lld%lld",&l,&r,&c,&k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:90:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
90 | scanf("%lld%lld%lld",&l,&r,&k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:96:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
96 | scanf("%lld%lld",&a,&b);
| ~~~~~^~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12428 KB |
Output is correct |
2 |
Correct |
9 ms |
12500 KB |
Output is correct |
3 |
Correct |
8 ms |
12424 KB |
Output is correct |
4 |
Correct |
8 ms |
12500 KB |
Output is correct |
5 |
Correct |
8 ms |
12372 KB |
Output is correct |
6 |
Correct |
8 ms |
12372 KB |
Output is correct |
7 |
Correct |
8 ms |
12500 KB |
Output is correct |
8 |
Correct |
8 ms |
12500 KB |
Output is correct |
9 |
Correct |
8 ms |
12460 KB |
Output is correct |
10 |
Correct |
8 ms |
12448 KB |
Output is correct |
11 |
Correct |
8 ms |
12452 KB |
Output is correct |
12 |
Correct |
8 ms |
12500 KB |
Output is correct |
13 |
Correct |
8 ms |
12328 KB |
Output is correct |
14 |
Correct |
8 ms |
12452 KB |
Output is correct |
15 |
Correct |
8 ms |
12372 KB |
Output is correct |
16 |
Correct |
8 ms |
12500 KB |
Output is correct |
17 |
Correct |
10 ms |
12396 KB |
Output is correct |
18 |
Correct |
9 ms |
12500 KB |
Output is correct |
19 |
Correct |
9 ms |
12452 KB |
Output is correct |
20 |
Correct |
8 ms |
12440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12428 KB |
Output is correct |
2 |
Correct |
9 ms |
12500 KB |
Output is correct |
3 |
Correct |
8 ms |
12424 KB |
Output is correct |
4 |
Correct |
8 ms |
12500 KB |
Output is correct |
5 |
Correct |
8 ms |
12372 KB |
Output is correct |
6 |
Correct |
8 ms |
12372 KB |
Output is correct |
7 |
Correct |
8 ms |
12500 KB |
Output is correct |
8 |
Correct |
8 ms |
12500 KB |
Output is correct |
9 |
Correct |
8 ms |
12460 KB |
Output is correct |
10 |
Correct |
8 ms |
12448 KB |
Output is correct |
11 |
Correct |
8 ms |
12452 KB |
Output is correct |
12 |
Correct |
8 ms |
12500 KB |
Output is correct |
13 |
Correct |
8 ms |
12328 KB |
Output is correct |
14 |
Correct |
8 ms |
12452 KB |
Output is correct |
15 |
Correct |
8 ms |
12372 KB |
Output is correct |
16 |
Correct |
8 ms |
12500 KB |
Output is correct |
17 |
Correct |
10 ms |
12396 KB |
Output is correct |
18 |
Correct |
9 ms |
12500 KB |
Output is correct |
19 |
Correct |
9 ms |
12452 KB |
Output is correct |
20 |
Correct |
8 ms |
12440 KB |
Output is correct |
21 |
Correct |
9 ms |
12452 KB |
Output is correct |
22 |
Correct |
9 ms |
12500 KB |
Output is correct |
23 |
Correct |
8 ms |
12500 KB |
Output is correct |
24 |
Correct |
11 ms |
12500 KB |
Output is correct |
25 |
Correct |
8 ms |
12372 KB |
Output is correct |
26 |
Correct |
9 ms |
12372 KB |
Output is correct |
27 |
Correct |
9 ms |
12452 KB |
Output is correct |
28 |
Correct |
9 ms |
12500 KB |
Output is correct |
29 |
Correct |
10 ms |
12452 KB |
Output is correct |
30 |
Correct |
8 ms |
12452 KB |
Output is correct |
31 |
Correct |
9 ms |
12452 KB |
Output is correct |
32 |
Correct |
9 ms |
12452 KB |
Output is correct |
33 |
Correct |
9 ms |
12372 KB |
Output is correct |
34 |
Correct |
8 ms |
12500 KB |
Output is correct |
35 |
Correct |
7 ms |
12388 KB |
Output is correct |
36 |
Correct |
10 ms |
12516 KB |
Output is correct |
37 |
Correct |
8 ms |
12372 KB |
Output is correct |
38 |
Correct |
8 ms |
12500 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
93 ms |
27344 KB |
Output is correct |
2 |
Correct |
97 ms |
27460 KB |
Output is correct |
3 |
Correct |
95 ms |
27284 KB |
Output is correct |
4 |
Correct |
110 ms |
27412 KB |
Output is correct |
5 |
Correct |
113 ms |
27376 KB |
Output is correct |
6 |
Correct |
92 ms |
27452 KB |
Output is correct |
7 |
Correct |
44 ms |
24836 KB |
Output is correct |
8 |
Correct |
52 ms |
25060 KB |
Output is correct |
9 |
Correct |
103 ms |
27236 KB |
Output is correct |
10 |
Correct |
99 ms |
27380 KB |
Output is correct |
11 |
Correct |
100 ms |
27368 KB |
Output is correct |
12 |
Correct |
97 ms |
27460 KB |
Output is correct |
13 |
Correct |
78 ms |
25664 KB |
Output is correct |
14 |
Correct |
106 ms |
27308 KB |
Output is correct |
15 |
Correct |
98 ms |
27340 KB |
Output is correct |
16 |
Correct |
102 ms |
27624 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
522 ms |
67196 KB |
Output is correct |
2 |
Correct |
393 ms |
56208 KB |
Output is correct |
3 |
Correct |
601 ms |
72280 KB |
Output is correct |
4 |
Correct |
393 ms |
55980 KB |
Output is correct |
5 |
Correct |
396 ms |
56908 KB |
Output is correct |
6 |
Correct |
548 ms |
72832 KB |
Output is correct |
7 |
Correct |
180 ms |
65812 KB |
Output is correct |
8 |
Correct |
220 ms |
66260 KB |
Output is correct |
9 |
Correct |
509 ms |
71504 KB |
Output is correct |
10 |
Correct |
527 ms |
71508 KB |
Output is correct |
11 |
Correct |
574 ms |
71744 KB |
Output is correct |
12 |
Correct |
562 ms |
72736 KB |
Output is correct |
13 |
Correct |
567 ms |
71672 KB |
Output is correct |
14 |
Correct |
568 ms |
72692 KB |
Output is correct |
15 |
Correct |
569 ms |
72616 KB |
Output is correct |
16 |
Correct |
610 ms |
72604 KB |
Output is correct |
17 |
Correct |
563 ms |
72612 KB |
Output is correct |
18 |
Correct |
553 ms |
72208 KB |
Output is correct |
19 |
Correct |
570 ms |
72684 KB |
Output is correct |
20 |
Correct |
555 ms |
72268 KB |
Output is correct |
21 |
Correct |
540 ms |
72632 KB |
Output is correct |
22 |
Correct |
565 ms |
72616 KB |
Output is correct |
23 |
Correct |
591 ms |
72540 KB |
Output is correct |
24 |
Correct |
568 ms |
72608 KB |
Output is correct |
25 |
Correct |
456 ms |
70432 KB |
Output is correct |
26 |
Correct |
480 ms |
71496 KB |
Output is correct |
27 |
Correct |
395 ms |
73160 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12428 KB |
Output is correct |
2 |
Correct |
9 ms |
12500 KB |
Output is correct |
3 |
Correct |
8 ms |
12424 KB |
Output is correct |
4 |
Correct |
8 ms |
12500 KB |
Output is correct |
5 |
Correct |
8 ms |
12372 KB |
Output is correct |
6 |
Correct |
8 ms |
12372 KB |
Output is correct |
7 |
Correct |
8 ms |
12500 KB |
Output is correct |
8 |
Correct |
8 ms |
12500 KB |
Output is correct |
9 |
Correct |
8 ms |
12460 KB |
Output is correct |
10 |
Correct |
8 ms |
12448 KB |
Output is correct |
11 |
Correct |
8 ms |
12452 KB |
Output is correct |
12 |
Correct |
8 ms |
12500 KB |
Output is correct |
13 |
Correct |
8 ms |
12328 KB |
Output is correct |
14 |
Correct |
8 ms |
12452 KB |
Output is correct |
15 |
Correct |
8 ms |
12372 KB |
Output is correct |
16 |
Correct |
8 ms |
12500 KB |
Output is correct |
17 |
Correct |
10 ms |
12396 KB |
Output is correct |
18 |
Correct |
9 ms |
12500 KB |
Output is correct |
19 |
Correct |
9 ms |
12452 KB |
Output is correct |
20 |
Correct |
8 ms |
12440 KB |
Output is correct |
21 |
Correct |
93 ms |
27344 KB |
Output is correct |
22 |
Correct |
97 ms |
27460 KB |
Output is correct |
23 |
Correct |
95 ms |
27284 KB |
Output is correct |
24 |
Correct |
110 ms |
27412 KB |
Output is correct |
25 |
Correct |
113 ms |
27376 KB |
Output is correct |
26 |
Correct |
92 ms |
27452 KB |
Output is correct |
27 |
Correct |
44 ms |
24836 KB |
Output is correct |
28 |
Correct |
52 ms |
25060 KB |
Output is correct |
29 |
Correct |
103 ms |
27236 KB |
Output is correct |
30 |
Correct |
99 ms |
27380 KB |
Output is correct |
31 |
Correct |
100 ms |
27368 KB |
Output is correct |
32 |
Correct |
97 ms |
27460 KB |
Output is correct |
33 |
Correct |
78 ms |
25664 KB |
Output is correct |
34 |
Correct |
106 ms |
27308 KB |
Output is correct |
35 |
Correct |
98 ms |
27340 KB |
Output is correct |
36 |
Correct |
102 ms |
27624 KB |
Output is correct |
37 |
Correct |
97 ms |
25548 KB |
Output is correct |
38 |
Correct |
110 ms |
24176 KB |
Output is correct |
39 |
Correct |
44 ms |
23144 KB |
Output is correct |
40 |
Correct |
48 ms |
24752 KB |
Output is correct |
41 |
Correct |
115 ms |
27040 KB |
Output is correct |
42 |
Correct |
118 ms |
27292 KB |
Output is correct |
43 |
Correct |
111 ms |
27340 KB |
Output is correct |
44 |
Correct |
104 ms |
27216 KB |
Output is correct |
45 |
Correct |
111 ms |
27416 KB |
Output is correct |
46 |
Correct |
119 ms |
27276 KB |
Output is correct |
47 |
Correct |
66 ms |
26168 KB |
Output is correct |
48 |
Correct |
91 ms |
26948 KB |
Output is correct |
49 |
Correct |
79 ms |
22864 KB |
Output is correct |
50 |
Correct |
100 ms |
25032 KB |
Output is correct |
51 |
Correct |
103 ms |
27404 KB |
Output is correct |
52 |
Correct |
102 ms |
27336 KB |
Output is correct |
53 |
Correct |
71 ms |
24160 KB |
Output is correct |
54 |
Correct |
108 ms |
27616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
96 ms |
25932 KB |
Output is correct |
2 |
Correct |
102 ms |
27340 KB |
Output is correct |
3 |
Correct |
109 ms |
27604 KB |
Output is correct |
4 |
Correct |
77 ms |
22996 KB |
Output is correct |
5 |
Correct |
93 ms |
25536 KB |
Output is correct |
6 |
Correct |
103 ms |
27648 KB |
Output is correct |
7 |
Correct |
51 ms |
24644 KB |
Output is correct |
8 |
Correct |
63 ms |
23740 KB |
Output is correct |
9 |
Correct |
73 ms |
26856 KB |
Output is correct |
10 |
Correct |
66 ms |
22676 KB |
Output is correct |
11 |
Correct |
96 ms |
27260 KB |
Output is correct |
12 |
Correct |
96 ms |
27300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12428 KB |
Output is correct |
2 |
Correct |
9 ms |
12500 KB |
Output is correct |
3 |
Correct |
8 ms |
12424 KB |
Output is correct |
4 |
Correct |
8 ms |
12500 KB |
Output is correct |
5 |
Correct |
8 ms |
12372 KB |
Output is correct |
6 |
Correct |
8 ms |
12372 KB |
Output is correct |
7 |
Correct |
8 ms |
12500 KB |
Output is correct |
8 |
Correct |
8 ms |
12500 KB |
Output is correct |
9 |
Correct |
8 ms |
12460 KB |
Output is correct |
10 |
Correct |
8 ms |
12448 KB |
Output is correct |
11 |
Correct |
8 ms |
12452 KB |
Output is correct |
12 |
Correct |
8 ms |
12500 KB |
Output is correct |
13 |
Correct |
8 ms |
12328 KB |
Output is correct |
14 |
Correct |
8 ms |
12452 KB |
Output is correct |
15 |
Correct |
8 ms |
12372 KB |
Output is correct |
16 |
Correct |
8 ms |
12500 KB |
Output is correct |
17 |
Correct |
10 ms |
12396 KB |
Output is correct |
18 |
Correct |
9 ms |
12500 KB |
Output is correct |
19 |
Correct |
9 ms |
12452 KB |
Output is correct |
20 |
Correct |
8 ms |
12440 KB |
Output is correct |
21 |
Correct |
9 ms |
12452 KB |
Output is correct |
22 |
Correct |
9 ms |
12500 KB |
Output is correct |
23 |
Correct |
8 ms |
12500 KB |
Output is correct |
24 |
Correct |
11 ms |
12500 KB |
Output is correct |
25 |
Correct |
8 ms |
12372 KB |
Output is correct |
26 |
Correct |
9 ms |
12372 KB |
Output is correct |
27 |
Correct |
9 ms |
12452 KB |
Output is correct |
28 |
Correct |
9 ms |
12500 KB |
Output is correct |
29 |
Correct |
10 ms |
12452 KB |
Output is correct |
30 |
Correct |
8 ms |
12452 KB |
Output is correct |
31 |
Correct |
9 ms |
12452 KB |
Output is correct |
32 |
Correct |
9 ms |
12452 KB |
Output is correct |
33 |
Correct |
9 ms |
12372 KB |
Output is correct |
34 |
Correct |
8 ms |
12500 KB |
Output is correct |
35 |
Correct |
7 ms |
12388 KB |
Output is correct |
36 |
Correct |
10 ms |
12516 KB |
Output is correct |
37 |
Correct |
8 ms |
12372 KB |
Output is correct |
38 |
Correct |
8 ms |
12500 KB |
Output is correct |
39 |
Correct |
93 ms |
27344 KB |
Output is correct |
40 |
Correct |
97 ms |
27460 KB |
Output is correct |
41 |
Correct |
95 ms |
27284 KB |
Output is correct |
42 |
Correct |
110 ms |
27412 KB |
Output is correct |
43 |
Correct |
113 ms |
27376 KB |
Output is correct |
44 |
Correct |
92 ms |
27452 KB |
Output is correct |
45 |
Correct |
44 ms |
24836 KB |
Output is correct |
46 |
Correct |
52 ms |
25060 KB |
Output is correct |
47 |
Correct |
103 ms |
27236 KB |
Output is correct |
48 |
Correct |
99 ms |
27380 KB |
Output is correct |
49 |
Correct |
100 ms |
27368 KB |
Output is correct |
50 |
Correct |
97 ms |
27460 KB |
Output is correct |
51 |
Correct |
78 ms |
25664 KB |
Output is correct |
52 |
Correct |
106 ms |
27308 KB |
Output is correct |
53 |
Correct |
98 ms |
27340 KB |
Output is correct |
54 |
Correct |
102 ms |
27624 KB |
Output is correct |
55 |
Correct |
97 ms |
25548 KB |
Output is correct |
56 |
Correct |
110 ms |
24176 KB |
Output is correct |
57 |
Correct |
44 ms |
23144 KB |
Output is correct |
58 |
Correct |
48 ms |
24752 KB |
Output is correct |
59 |
Correct |
115 ms |
27040 KB |
Output is correct |
60 |
Correct |
118 ms |
27292 KB |
Output is correct |
61 |
Correct |
111 ms |
27340 KB |
Output is correct |
62 |
Correct |
104 ms |
27216 KB |
Output is correct |
63 |
Correct |
111 ms |
27416 KB |
Output is correct |
64 |
Correct |
119 ms |
27276 KB |
Output is correct |
65 |
Correct |
66 ms |
26168 KB |
Output is correct |
66 |
Correct |
91 ms |
26948 KB |
Output is correct |
67 |
Correct |
79 ms |
22864 KB |
Output is correct |
68 |
Correct |
100 ms |
25032 KB |
Output is correct |
69 |
Correct |
103 ms |
27404 KB |
Output is correct |
70 |
Correct |
102 ms |
27336 KB |
Output is correct |
71 |
Correct |
71 ms |
24160 KB |
Output is correct |
72 |
Correct |
108 ms |
27616 KB |
Output is correct |
73 |
Correct |
96 ms |
25932 KB |
Output is correct |
74 |
Correct |
102 ms |
27340 KB |
Output is correct |
75 |
Correct |
109 ms |
27604 KB |
Output is correct |
76 |
Correct |
77 ms |
22996 KB |
Output is correct |
77 |
Correct |
93 ms |
25536 KB |
Output is correct |
78 |
Correct |
103 ms |
27648 KB |
Output is correct |
79 |
Correct |
51 ms |
24644 KB |
Output is correct |
80 |
Correct |
63 ms |
23740 KB |
Output is correct |
81 |
Correct |
73 ms |
26856 KB |
Output is correct |
82 |
Correct |
66 ms |
22676 KB |
Output is correct |
83 |
Correct |
96 ms |
27260 KB |
Output is correct |
84 |
Correct |
96 ms |
27300 KB |
Output is correct |
85 |
Correct |
103 ms |
26236 KB |
Output is correct |
86 |
Correct |
120 ms |
27776 KB |
Output is correct |
87 |
Correct |
89 ms |
25948 KB |
Output is correct |
88 |
Correct |
103 ms |
27928 KB |
Output is correct |
89 |
Correct |
81 ms |
22524 KB |
Output is correct |
90 |
Correct |
130 ms |
27808 KB |
Output is correct |
91 |
Correct |
100 ms |
25080 KB |
Output is correct |
92 |
Correct |
79 ms |
24312 KB |
Output is correct |
93 |
Correct |
133 ms |
27784 KB |
Output is correct |
94 |
Correct |
112 ms |
27728 KB |
Output is correct |
95 |
Correct |
113 ms |
27464 KB |
Output is correct |
96 |
Correct |
102 ms |
27764 KB |
Output is correct |
97 |
Correct |
116 ms |
27832 KB |
Output is correct |
98 |
Correct |
105 ms |
25540 KB |
Output is correct |
99 |
Correct |
76 ms |
26744 KB |
Output is correct |
100 |
Correct |
86 ms |
24912 KB |
Output is correct |
101 |
Correct |
94 ms |
27536 KB |
Output is correct |
102 |
Correct |
109 ms |
28060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12428 KB |
Output is correct |
2 |
Correct |
9 ms |
12500 KB |
Output is correct |
3 |
Correct |
8 ms |
12424 KB |
Output is correct |
4 |
Correct |
8 ms |
12500 KB |
Output is correct |
5 |
Correct |
8 ms |
12372 KB |
Output is correct |
6 |
Correct |
8 ms |
12372 KB |
Output is correct |
7 |
Correct |
8 ms |
12500 KB |
Output is correct |
8 |
Correct |
8 ms |
12500 KB |
Output is correct |
9 |
Correct |
8 ms |
12460 KB |
Output is correct |
10 |
Correct |
8 ms |
12448 KB |
Output is correct |
11 |
Correct |
8 ms |
12452 KB |
Output is correct |
12 |
Correct |
8 ms |
12500 KB |
Output is correct |
13 |
Correct |
8 ms |
12328 KB |
Output is correct |
14 |
Correct |
8 ms |
12452 KB |
Output is correct |
15 |
Correct |
8 ms |
12372 KB |
Output is correct |
16 |
Correct |
8 ms |
12500 KB |
Output is correct |
17 |
Correct |
10 ms |
12396 KB |
Output is correct |
18 |
Correct |
9 ms |
12500 KB |
Output is correct |
19 |
Correct |
9 ms |
12452 KB |
Output is correct |
20 |
Correct |
8 ms |
12440 KB |
Output is correct |
21 |
Correct |
9 ms |
12452 KB |
Output is correct |
22 |
Correct |
9 ms |
12500 KB |
Output is correct |
23 |
Correct |
8 ms |
12500 KB |
Output is correct |
24 |
Correct |
11 ms |
12500 KB |
Output is correct |
25 |
Correct |
8 ms |
12372 KB |
Output is correct |
26 |
Correct |
9 ms |
12372 KB |
Output is correct |
27 |
Correct |
9 ms |
12452 KB |
Output is correct |
28 |
Correct |
9 ms |
12500 KB |
Output is correct |
29 |
Correct |
10 ms |
12452 KB |
Output is correct |
30 |
Correct |
8 ms |
12452 KB |
Output is correct |
31 |
Correct |
9 ms |
12452 KB |
Output is correct |
32 |
Correct |
9 ms |
12452 KB |
Output is correct |
33 |
Correct |
9 ms |
12372 KB |
Output is correct |
34 |
Correct |
8 ms |
12500 KB |
Output is correct |
35 |
Correct |
7 ms |
12388 KB |
Output is correct |
36 |
Correct |
10 ms |
12516 KB |
Output is correct |
37 |
Correct |
8 ms |
12372 KB |
Output is correct |
38 |
Correct |
8 ms |
12500 KB |
Output is correct |
39 |
Correct |
93 ms |
27344 KB |
Output is correct |
40 |
Correct |
97 ms |
27460 KB |
Output is correct |
41 |
Correct |
95 ms |
27284 KB |
Output is correct |
42 |
Correct |
110 ms |
27412 KB |
Output is correct |
43 |
Correct |
113 ms |
27376 KB |
Output is correct |
44 |
Correct |
92 ms |
27452 KB |
Output is correct |
45 |
Correct |
44 ms |
24836 KB |
Output is correct |
46 |
Correct |
52 ms |
25060 KB |
Output is correct |
47 |
Correct |
103 ms |
27236 KB |
Output is correct |
48 |
Correct |
99 ms |
27380 KB |
Output is correct |
49 |
Correct |
100 ms |
27368 KB |
Output is correct |
50 |
Correct |
97 ms |
27460 KB |
Output is correct |
51 |
Correct |
78 ms |
25664 KB |
Output is correct |
52 |
Correct |
106 ms |
27308 KB |
Output is correct |
53 |
Correct |
98 ms |
27340 KB |
Output is correct |
54 |
Correct |
102 ms |
27624 KB |
Output is correct |
55 |
Correct |
522 ms |
67196 KB |
Output is correct |
56 |
Correct |
393 ms |
56208 KB |
Output is correct |
57 |
Correct |
601 ms |
72280 KB |
Output is correct |
58 |
Correct |
393 ms |
55980 KB |
Output is correct |
59 |
Correct |
396 ms |
56908 KB |
Output is correct |
60 |
Correct |
548 ms |
72832 KB |
Output is correct |
61 |
Correct |
180 ms |
65812 KB |
Output is correct |
62 |
Correct |
220 ms |
66260 KB |
Output is correct |
63 |
Correct |
509 ms |
71504 KB |
Output is correct |
64 |
Correct |
527 ms |
71508 KB |
Output is correct |
65 |
Correct |
574 ms |
71744 KB |
Output is correct |
66 |
Correct |
562 ms |
72736 KB |
Output is correct |
67 |
Correct |
567 ms |
71672 KB |
Output is correct |
68 |
Correct |
568 ms |
72692 KB |
Output is correct |
69 |
Correct |
569 ms |
72616 KB |
Output is correct |
70 |
Correct |
610 ms |
72604 KB |
Output is correct |
71 |
Correct |
563 ms |
72612 KB |
Output is correct |
72 |
Correct |
553 ms |
72208 KB |
Output is correct |
73 |
Correct |
570 ms |
72684 KB |
Output is correct |
74 |
Correct |
555 ms |
72268 KB |
Output is correct |
75 |
Correct |
540 ms |
72632 KB |
Output is correct |
76 |
Correct |
565 ms |
72616 KB |
Output is correct |
77 |
Correct |
591 ms |
72540 KB |
Output is correct |
78 |
Correct |
568 ms |
72608 KB |
Output is correct |
79 |
Correct |
456 ms |
70432 KB |
Output is correct |
80 |
Correct |
480 ms |
71496 KB |
Output is correct |
81 |
Correct |
395 ms |
73160 KB |
Output is correct |
82 |
Correct |
97 ms |
25548 KB |
Output is correct |
83 |
Correct |
110 ms |
24176 KB |
Output is correct |
84 |
Correct |
44 ms |
23144 KB |
Output is correct |
85 |
Correct |
48 ms |
24752 KB |
Output is correct |
86 |
Correct |
115 ms |
27040 KB |
Output is correct |
87 |
Correct |
118 ms |
27292 KB |
Output is correct |
88 |
Correct |
111 ms |
27340 KB |
Output is correct |
89 |
Correct |
104 ms |
27216 KB |
Output is correct |
90 |
Correct |
111 ms |
27416 KB |
Output is correct |
91 |
Correct |
119 ms |
27276 KB |
Output is correct |
92 |
Correct |
66 ms |
26168 KB |
Output is correct |
93 |
Correct |
91 ms |
26948 KB |
Output is correct |
94 |
Correct |
79 ms |
22864 KB |
Output is correct |
95 |
Correct |
100 ms |
25032 KB |
Output is correct |
96 |
Correct |
103 ms |
27404 KB |
Output is correct |
97 |
Correct |
102 ms |
27336 KB |
Output is correct |
98 |
Correct |
71 ms |
24160 KB |
Output is correct |
99 |
Correct |
108 ms |
27616 KB |
Output is correct |
100 |
Correct |
96 ms |
25932 KB |
Output is correct |
101 |
Correct |
102 ms |
27340 KB |
Output is correct |
102 |
Correct |
109 ms |
27604 KB |
Output is correct |
103 |
Correct |
77 ms |
22996 KB |
Output is correct |
104 |
Correct |
93 ms |
25536 KB |
Output is correct |
105 |
Correct |
103 ms |
27648 KB |
Output is correct |
106 |
Correct |
51 ms |
24644 KB |
Output is correct |
107 |
Correct |
63 ms |
23740 KB |
Output is correct |
108 |
Correct |
73 ms |
26856 KB |
Output is correct |
109 |
Correct |
66 ms |
22676 KB |
Output is correct |
110 |
Correct |
96 ms |
27260 KB |
Output is correct |
111 |
Correct |
96 ms |
27300 KB |
Output is correct |
112 |
Correct |
103 ms |
26236 KB |
Output is correct |
113 |
Correct |
120 ms |
27776 KB |
Output is correct |
114 |
Correct |
89 ms |
25948 KB |
Output is correct |
115 |
Correct |
103 ms |
27928 KB |
Output is correct |
116 |
Correct |
81 ms |
22524 KB |
Output is correct |
117 |
Correct |
130 ms |
27808 KB |
Output is correct |
118 |
Correct |
100 ms |
25080 KB |
Output is correct |
119 |
Correct |
79 ms |
24312 KB |
Output is correct |
120 |
Correct |
133 ms |
27784 KB |
Output is correct |
121 |
Correct |
112 ms |
27728 KB |
Output is correct |
122 |
Correct |
113 ms |
27464 KB |
Output is correct |
123 |
Correct |
102 ms |
27764 KB |
Output is correct |
124 |
Correct |
116 ms |
27832 KB |
Output is correct |
125 |
Correct |
105 ms |
25540 KB |
Output is correct |
126 |
Correct |
76 ms |
26744 KB |
Output is correct |
127 |
Correct |
86 ms |
24912 KB |
Output is correct |
128 |
Correct |
94 ms |
27536 KB |
Output is correct |
129 |
Correct |
109 ms |
28060 KB |
Output is correct |
130 |
Correct |
566 ms |
72756 KB |
Output is correct |
131 |
Correct |
381 ms |
56288 KB |
Output is correct |
132 |
Correct |
571 ms |
72756 KB |
Output is correct |
133 |
Correct |
549 ms |
70812 KB |
Output is correct |
134 |
Correct |
467 ms |
64324 KB |
Output is correct |
135 |
Correct |
572 ms |
73504 KB |
Output is correct |
136 |
Correct |
545 ms |
72464 KB |
Output is correct |
137 |
Correct |
520 ms |
72496 KB |
Output is correct |
138 |
Correct |
548 ms |
72268 KB |
Output is correct |
139 |
Correct |
581 ms |
73292 KB |
Output is correct |
140 |
Correct |
541 ms |
72464 KB |
Output is correct |
141 |
Correct |
563 ms |
73208 KB |
Output is correct |
142 |
Correct |
562 ms |
73172 KB |
Output is correct |
143 |
Correct |
572 ms |
73236 KB |
Output is correct |
144 |
Correct |
563 ms |
72796 KB |
Output is correct |
145 |
Correct |
536 ms |
73232 KB |
Output is correct |
146 |
Correct |
566 ms |
72808 KB |
Output is correct |
147 |
Correct |
577 ms |
73140 KB |
Output is correct |
148 |
Correct |
554 ms |
73228 KB |
Output is correct |
149 |
Correct |
552 ms |
73164 KB |
Output is correct |
150 |
Correct |
261 ms |
68772 KB |
Output is correct |
151 |
Correct |
453 ms |
72044 KB |
Output is correct |
152 |
Correct |
467 ms |
72140 KB |
Output is correct |
153 |
Correct |
359 ms |
74060 KB |
Output is correct |