#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 25e4;
int N, M, Q;
int ans[MAXN+10];
pll B[MAXN+10];
vector<int> A[MAXN+10];
struct SEG
{
pll tree[MAXN*4+10];
void busy(int node, int tl, int tr)
{
if(tl!=tr)
{
tree[node*2].second=min(tree[node*2].second, tree[node*2].first+tree[node].second);
tree[node*2].first+=tree[node].first;
tree[node*2+1].second=min(tree[node*2+1].second, tree[node*2+1].first+tree[node].second);
tree[node*2+1].first+=tree[node].first;
tree[node]=pll(0, 0);
}
}
void update(int node, int tl, int tr, int l, int r, ll k)
{
busy(node, tl, tr);
if(l<=tl && tr<=r)
{
if(tl!=tr) tree[node]=pll(k, min(0ll, k));
else
{
tree[node].second=min(tree[node].second, tree[node].first+k);
tree[node].first+=k;
}
return;
}
if(r<tl || tr<l) return;
int mid=tl+tr>>1;
update(node*2, tl, mid, l, r, k);
update(node*2+1, mid+1, tr, l, r, k);
}
ll query(int node, int tl, int tr, int pos)
{
busy(node, tl, tr);
if(tl==tr) return tree[node].first-tree[node].second;
int mid=tl+tr>>1;
if(pos<=mid) return query(node*2, tl, mid, pos);
else return query(node*2+1, mid+1, tr, pos);
}
}seg, seg2;
struct SEG2
{
ll tree[MAXN*4+10];
void update(int node, int tl, int tr, int p, ll k)
{
if(tl==tr)
{
tree[node]+=k;
return;
}
int mid=tl+tr>>1;
if(p<=mid) update(node*2, tl, mid, p, k);
else update(node*2+1, mid+1, tr, p, k);
tree[node]=tree[node*2]+tree[node*2+1];
}
int query(int node, int tl, int tr, ll k)
{
if(tl==tr) return tl;
int mid=tl+tr>>1;
if(tree[node*2]>=k) return query(node*2, tl, mid, k);
else return query(node*2+1, mid+1, tr, k-tree[node*2]);
}
}seg3;
int main()
{
scanf("%d%d%d", &N, &M, &Q);
for(int i=1; i<=Q; i++)
{
int t, a, b, c, d; ll e;
scanf("%d", &t);
ans[i]=-1;
if(t==1)
{
scanf("%d%d%d%d", &a, &b, &c, &d);
seg.update(1, 1, N, a, b, d);
seg2.update(1, 1, N, a, b, d);
B[i]=pll(c, d);
A[a].push_back(i);
A[b+1].push_back(-i);
}
else if(t==2)
{
scanf("%d%d%d", &a, &b, &c);
seg.update(1, 1, N, a, b, -c);
}
else
{
scanf("%d%lld", &a, &e);
ans[i]=0;
ll t=seg.query(1, 1, N, a);
if(t>=e)
{
B[i]=pll(-1, seg2.query(1, 1, N, a)-(t-e));
A[a].push_back(i+Q);
}
}
//for(int j=1; j<=N; j++) printf("%lld ", seg2.query(1, 1, N, j)); printf("!\n");
}
for(int i=1; i<=N; i++)
{
sort(A[i].begin(), A[i].end());
for(auto it : A[i])
{
if(it<0)
{
seg3.update(1, 1, Q, -it, -B[-it].second);
}
else if(it<=Q)
{
seg3.update(1, 1, Q, it, B[it].second);
}
else
{
ans[it-Q]=B[seg3.query(1, 1, Q, B[it-Q].second)].first;
}
}
}
for(int i=1; i<=Q; i++) if(ans[i]>=0) printf("%d\n", ans[i]);
}
Compilation message
foodcourt.cpp: In member function 'void SEG::update(int, int, int, int, int, ll)':
foodcourt.cpp:43:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
43 | int mid=tl+tr>>1;
| ~~^~~
foodcourt.cpp: In member function 'll SEG::query(int, int, int, int)':
foodcourt.cpp:51:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
51 | int mid=tl+tr>>1;
| ~~^~~
foodcourt.cpp: In member function 'void SEG2::update(int, int, int, int, ll)':
foodcourt.cpp:67:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
67 | int mid=tl+tr>>1;
| ~~^~~
foodcourt.cpp: In member function 'int SEG2::query(int, int, int, ll)':
foodcourt.cpp:75:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
75 | int mid=tl+tr>>1;
| ~~^~~
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:83:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
83 | scanf("%d%d%d", &N, &M, &Q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:87:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
87 | scanf("%d", &t);
| ~~~~~^~~~~~~~~~
foodcourt.cpp:91:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
91 | scanf("%d%d%d%d", &a, &b, &c, &d);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:100:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
100 | scanf("%d%d%d", &a, &b, &c);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:105:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
105 | scanf("%d%lld", &a, &e);
| ~~~~~^~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
6456 KB |
Output is correct |
2 |
Correct |
5 ms |
6456 KB |
Output is correct |
3 |
Correct |
4 ms |
6356 KB |
Output is correct |
4 |
Correct |
5 ms |
6484 KB |
Output is correct |
5 |
Correct |
4 ms |
6228 KB |
Output is correct |
6 |
Correct |
4 ms |
6228 KB |
Output is correct |
7 |
Correct |
5 ms |
6356 KB |
Output is correct |
8 |
Correct |
5 ms |
6452 KB |
Output is correct |
9 |
Correct |
5 ms |
6456 KB |
Output is correct |
10 |
Correct |
5 ms |
6356 KB |
Output is correct |
11 |
Correct |
5 ms |
6356 KB |
Output is correct |
12 |
Correct |
5 ms |
6356 KB |
Output is correct |
13 |
Correct |
4 ms |
6356 KB |
Output is correct |
14 |
Correct |
4 ms |
6400 KB |
Output is correct |
15 |
Correct |
4 ms |
6356 KB |
Output is correct |
16 |
Correct |
7 ms |
6356 KB |
Output is correct |
17 |
Correct |
5 ms |
6452 KB |
Output is correct |
18 |
Correct |
5 ms |
6388 KB |
Output is correct |
19 |
Correct |
5 ms |
6484 KB |
Output is correct |
20 |
Correct |
6 ms |
6460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
6456 KB |
Output is correct |
2 |
Correct |
5 ms |
6456 KB |
Output is correct |
3 |
Correct |
4 ms |
6356 KB |
Output is correct |
4 |
Correct |
5 ms |
6484 KB |
Output is correct |
5 |
Correct |
4 ms |
6228 KB |
Output is correct |
6 |
Correct |
4 ms |
6228 KB |
Output is correct |
7 |
Correct |
5 ms |
6356 KB |
Output is correct |
8 |
Correct |
5 ms |
6452 KB |
Output is correct |
9 |
Correct |
5 ms |
6456 KB |
Output is correct |
10 |
Correct |
5 ms |
6356 KB |
Output is correct |
11 |
Correct |
5 ms |
6356 KB |
Output is correct |
12 |
Correct |
5 ms |
6356 KB |
Output is correct |
13 |
Correct |
4 ms |
6356 KB |
Output is correct |
14 |
Correct |
4 ms |
6400 KB |
Output is correct |
15 |
Correct |
4 ms |
6356 KB |
Output is correct |
16 |
Correct |
7 ms |
6356 KB |
Output is correct |
17 |
Correct |
5 ms |
6452 KB |
Output is correct |
18 |
Correct |
5 ms |
6388 KB |
Output is correct |
19 |
Correct |
5 ms |
6484 KB |
Output is correct |
20 |
Correct |
6 ms |
6460 KB |
Output is correct |
21 |
Correct |
5 ms |
6404 KB |
Output is correct |
22 |
Correct |
5 ms |
6456 KB |
Output is correct |
23 |
Correct |
5 ms |
6484 KB |
Output is correct |
24 |
Correct |
5 ms |
6460 KB |
Output is correct |
25 |
Correct |
4 ms |
6280 KB |
Output is correct |
26 |
Correct |
5 ms |
6228 KB |
Output is correct |
27 |
Correct |
5 ms |
6484 KB |
Output is correct |
28 |
Correct |
5 ms |
6420 KB |
Output is correct |
29 |
Correct |
5 ms |
6484 KB |
Output is correct |
30 |
Correct |
5 ms |
6484 KB |
Output is correct |
31 |
Correct |
5 ms |
6448 KB |
Output is correct |
32 |
Correct |
5 ms |
6460 KB |
Output is correct |
33 |
Correct |
4 ms |
6460 KB |
Output is correct |
34 |
Correct |
5 ms |
6400 KB |
Output is correct |
35 |
Correct |
5 ms |
6356 KB |
Output is correct |
36 |
Correct |
5 ms |
6356 KB |
Output is correct |
37 |
Correct |
5 ms |
6460 KB |
Output is correct |
38 |
Correct |
5 ms |
6484 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
14756 KB |
Output is correct |
2 |
Correct |
74 ms |
15144 KB |
Output is correct |
3 |
Correct |
79 ms |
14772 KB |
Output is correct |
4 |
Correct |
67 ms |
14812 KB |
Output is correct |
5 |
Correct |
75 ms |
15132 KB |
Output is correct |
6 |
Correct |
76 ms |
15040 KB |
Output is correct |
7 |
Correct |
26 ms |
9508 KB |
Output is correct |
8 |
Correct |
27 ms |
9556 KB |
Output is correct |
9 |
Correct |
67 ms |
14160 KB |
Output is correct |
10 |
Correct |
69 ms |
14948 KB |
Output is correct |
11 |
Correct |
69 ms |
14596 KB |
Output is correct |
12 |
Correct |
70 ms |
14928 KB |
Output is correct |
13 |
Correct |
65 ms |
14468 KB |
Output is correct |
14 |
Correct |
80 ms |
15204 KB |
Output is correct |
15 |
Correct |
85 ms |
15092 KB |
Output is correct |
16 |
Correct |
103 ms |
15444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
452 ms |
40948 KB |
Output is correct |
2 |
Correct |
303 ms |
38092 KB |
Output is correct |
3 |
Correct |
412 ms |
42304 KB |
Output is correct |
4 |
Correct |
361 ms |
39100 KB |
Output is correct |
5 |
Correct |
340 ms |
38868 KB |
Output is correct |
6 |
Correct |
497 ms |
43216 KB |
Output is correct |
7 |
Correct |
105 ms |
20540 KB |
Output is correct |
8 |
Correct |
123 ms |
20392 KB |
Output is correct |
9 |
Correct |
485 ms |
43576 KB |
Output is correct |
10 |
Correct |
548 ms |
43592 KB |
Output is correct |
11 |
Correct |
421 ms |
40396 KB |
Output is correct |
12 |
Correct |
493 ms |
42332 KB |
Output is correct |
13 |
Correct |
484 ms |
40592 KB |
Output is correct |
14 |
Correct |
455 ms |
42336 KB |
Output is correct |
15 |
Correct |
499 ms |
42316 KB |
Output is correct |
16 |
Correct |
447 ms |
42224 KB |
Output is correct |
17 |
Correct |
449 ms |
42312 KB |
Output is correct |
18 |
Correct |
434 ms |
41288 KB |
Output is correct |
19 |
Correct |
486 ms |
42300 KB |
Output is correct |
20 |
Correct |
455 ms |
41696 KB |
Output is correct |
21 |
Correct |
440 ms |
42340 KB |
Output is correct |
22 |
Correct |
461 ms |
42316 KB |
Output is correct |
23 |
Correct |
437 ms |
42288 KB |
Output is correct |
24 |
Correct |
452 ms |
42300 KB |
Output is correct |
25 |
Correct |
352 ms |
39852 KB |
Output is correct |
26 |
Correct |
320 ms |
40156 KB |
Output is correct |
27 |
Correct |
382 ms |
42788 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
6456 KB |
Output is correct |
2 |
Correct |
5 ms |
6456 KB |
Output is correct |
3 |
Correct |
4 ms |
6356 KB |
Output is correct |
4 |
Correct |
5 ms |
6484 KB |
Output is correct |
5 |
Correct |
4 ms |
6228 KB |
Output is correct |
6 |
Correct |
4 ms |
6228 KB |
Output is correct |
7 |
Correct |
5 ms |
6356 KB |
Output is correct |
8 |
Correct |
5 ms |
6452 KB |
Output is correct |
9 |
Correct |
5 ms |
6456 KB |
Output is correct |
10 |
Correct |
5 ms |
6356 KB |
Output is correct |
11 |
Correct |
5 ms |
6356 KB |
Output is correct |
12 |
Correct |
5 ms |
6356 KB |
Output is correct |
13 |
Correct |
4 ms |
6356 KB |
Output is correct |
14 |
Correct |
4 ms |
6400 KB |
Output is correct |
15 |
Correct |
4 ms |
6356 KB |
Output is correct |
16 |
Correct |
7 ms |
6356 KB |
Output is correct |
17 |
Correct |
5 ms |
6452 KB |
Output is correct |
18 |
Correct |
5 ms |
6388 KB |
Output is correct |
19 |
Correct |
5 ms |
6484 KB |
Output is correct |
20 |
Correct |
6 ms |
6460 KB |
Output is correct |
21 |
Correct |
67 ms |
14756 KB |
Output is correct |
22 |
Correct |
74 ms |
15144 KB |
Output is correct |
23 |
Correct |
79 ms |
14772 KB |
Output is correct |
24 |
Correct |
67 ms |
14812 KB |
Output is correct |
25 |
Correct |
75 ms |
15132 KB |
Output is correct |
26 |
Correct |
76 ms |
15040 KB |
Output is correct |
27 |
Correct |
26 ms |
9508 KB |
Output is correct |
28 |
Correct |
27 ms |
9556 KB |
Output is correct |
29 |
Correct |
67 ms |
14160 KB |
Output is correct |
30 |
Correct |
69 ms |
14948 KB |
Output is correct |
31 |
Correct |
69 ms |
14596 KB |
Output is correct |
32 |
Correct |
70 ms |
14928 KB |
Output is correct |
33 |
Correct |
65 ms |
14468 KB |
Output is correct |
34 |
Correct |
80 ms |
15204 KB |
Output is correct |
35 |
Correct |
85 ms |
15092 KB |
Output is correct |
36 |
Correct |
103 ms |
15444 KB |
Output is correct |
37 |
Correct |
78 ms |
14540 KB |
Output is correct |
38 |
Correct |
73 ms |
14368 KB |
Output is correct |
39 |
Correct |
24 ms |
9164 KB |
Output is correct |
40 |
Correct |
28 ms |
9420 KB |
Output is correct |
41 |
Correct |
92 ms |
14396 KB |
Output is correct |
42 |
Correct |
83 ms |
14964 KB |
Output is correct |
43 |
Correct |
89 ms |
14852 KB |
Output is correct |
44 |
Correct |
82 ms |
14724 KB |
Output is correct |
45 |
Correct |
86 ms |
14932 KB |
Output is correct |
46 |
Correct |
87 ms |
14924 KB |
Output is correct |
47 |
Correct |
41 ms |
14136 KB |
Output is correct |
48 |
Correct |
77 ms |
14316 KB |
Output is correct |
49 |
Correct |
75 ms |
13836 KB |
Output is correct |
50 |
Correct |
92 ms |
14420 KB |
Output is correct |
51 |
Correct |
87 ms |
14964 KB |
Output is correct |
52 |
Correct |
85 ms |
14896 KB |
Output is correct |
53 |
Correct |
79 ms |
14736 KB |
Output is correct |
54 |
Correct |
100 ms |
15512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
95 ms |
15388 KB |
Output is correct |
2 |
Correct |
120 ms |
15708 KB |
Output is correct |
3 |
Correct |
103 ms |
15864 KB |
Output is correct |
4 |
Correct |
70 ms |
14612 KB |
Output is correct |
5 |
Correct |
100 ms |
15312 KB |
Output is correct |
6 |
Correct |
101 ms |
15820 KB |
Output is correct |
7 |
Correct |
35 ms |
9976 KB |
Output is correct |
8 |
Correct |
33 ms |
9932 KB |
Output is correct |
9 |
Correct |
54 ms |
15052 KB |
Output is correct |
10 |
Correct |
63 ms |
14156 KB |
Output is correct |
11 |
Correct |
83 ms |
15324 KB |
Output is correct |
12 |
Correct |
92 ms |
15404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
6456 KB |
Output is correct |
2 |
Correct |
5 ms |
6456 KB |
Output is correct |
3 |
Correct |
4 ms |
6356 KB |
Output is correct |
4 |
Correct |
5 ms |
6484 KB |
Output is correct |
5 |
Correct |
4 ms |
6228 KB |
Output is correct |
6 |
Correct |
4 ms |
6228 KB |
Output is correct |
7 |
Correct |
5 ms |
6356 KB |
Output is correct |
8 |
Correct |
5 ms |
6452 KB |
Output is correct |
9 |
Correct |
5 ms |
6456 KB |
Output is correct |
10 |
Correct |
5 ms |
6356 KB |
Output is correct |
11 |
Correct |
5 ms |
6356 KB |
Output is correct |
12 |
Correct |
5 ms |
6356 KB |
Output is correct |
13 |
Correct |
4 ms |
6356 KB |
Output is correct |
14 |
Correct |
4 ms |
6400 KB |
Output is correct |
15 |
Correct |
4 ms |
6356 KB |
Output is correct |
16 |
Correct |
7 ms |
6356 KB |
Output is correct |
17 |
Correct |
5 ms |
6452 KB |
Output is correct |
18 |
Correct |
5 ms |
6388 KB |
Output is correct |
19 |
Correct |
5 ms |
6484 KB |
Output is correct |
20 |
Correct |
6 ms |
6460 KB |
Output is correct |
21 |
Correct |
5 ms |
6404 KB |
Output is correct |
22 |
Correct |
5 ms |
6456 KB |
Output is correct |
23 |
Correct |
5 ms |
6484 KB |
Output is correct |
24 |
Correct |
5 ms |
6460 KB |
Output is correct |
25 |
Correct |
4 ms |
6280 KB |
Output is correct |
26 |
Correct |
5 ms |
6228 KB |
Output is correct |
27 |
Correct |
5 ms |
6484 KB |
Output is correct |
28 |
Correct |
5 ms |
6420 KB |
Output is correct |
29 |
Correct |
5 ms |
6484 KB |
Output is correct |
30 |
Correct |
5 ms |
6484 KB |
Output is correct |
31 |
Correct |
5 ms |
6448 KB |
Output is correct |
32 |
Correct |
5 ms |
6460 KB |
Output is correct |
33 |
Correct |
4 ms |
6460 KB |
Output is correct |
34 |
Correct |
5 ms |
6400 KB |
Output is correct |
35 |
Correct |
5 ms |
6356 KB |
Output is correct |
36 |
Correct |
5 ms |
6356 KB |
Output is correct |
37 |
Correct |
5 ms |
6460 KB |
Output is correct |
38 |
Correct |
5 ms |
6484 KB |
Output is correct |
39 |
Correct |
67 ms |
14756 KB |
Output is correct |
40 |
Correct |
74 ms |
15144 KB |
Output is correct |
41 |
Correct |
79 ms |
14772 KB |
Output is correct |
42 |
Correct |
67 ms |
14812 KB |
Output is correct |
43 |
Correct |
75 ms |
15132 KB |
Output is correct |
44 |
Correct |
76 ms |
15040 KB |
Output is correct |
45 |
Correct |
26 ms |
9508 KB |
Output is correct |
46 |
Correct |
27 ms |
9556 KB |
Output is correct |
47 |
Correct |
67 ms |
14160 KB |
Output is correct |
48 |
Correct |
69 ms |
14948 KB |
Output is correct |
49 |
Correct |
69 ms |
14596 KB |
Output is correct |
50 |
Correct |
70 ms |
14928 KB |
Output is correct |
51 |
Correct |
65 ms |
14468 KB |
Output is correct |
52 |
Correct |
80 ms |
15204 KB |
Output is correct |
53 |
Correct |
85 ms |
15092 KB |
Output is correct |
54 |
Correct |
103 ms |
15444 KB |
Output is correct |
55 |
Correct |
78 ms |
14540 KB |
Output is correct |
56 |
Correct |
73 ms |
14368 KB |
Output is correct |
57 |
Correct |
24 ms |
9164 KB |
Output is correct |
58 |
Correct |
28 ms |
9420 KB |
Output is correct |
59 |
Correct |
92 ms |
14396 KB |
Output is correct |
60 |
Correct |
83 ms |
14964 KB |
Output is correct |
61 |
Correct |
89 ms |
14852 KB |
Output is correct |
62 |
Correct |
82 ms |
14724 KB |
Output is correct |
63 |
Correct |
86 ms |
14932 KB |
Output is correct |
64 |
Correct |
87 ms |
14924 KB |
Output is correct |
65 |
Correct |
41 ms |
14136 KB |
Output is correct |
66 |
Correct |
77 ms |
14316 KB |
Output is correct |
67 |
Correct |
75 ms |
13836 KB |
Output is correct |
68 |
Correct |
92 ms |
14420 KB |
Output is correct |
69 |
Correct |
87 ms |
14964 KB |
Output is correct |
70 |
Correct |
85 ms |
14896 KB |
Output is correct |
71 |
Correct |
79 ms |
14736 KB |
Output is correct |
72 |
Correct |
100 ms |
15512 KB |
Output is correct |
73 |
Correct |
95 ms |
15388 KB |
Output is correct |
74 |
Correct |
120 ms |
15708 KB |
Output is correct |
75 |
Correct |
103 ms |
15864 KB |
Output is correct |
76 |
Correct |
70 ms |
14612 KB |
Output is correct |
77 |
Correct |
100 ms |
15312 KB |
Output is correct |
78 |
Correct |
101 ms |
15820 KB |
Output is correct |
79 |
Correct |
35 ms |
9976 KB |
Output is correct |
80 |
Correct |
33 ms |
9932 KB |
Output is correct |
81 |
Correct |
54 ms |
15052 KB |
Output is correct |
82 |
Correct |
63 ms |
14156 KB |
Output is correct |
83 |
Correct |
83 ms |
15324 KB |
Output is correct |
84 |
Correct |
92 ms |
15404 KB |
Output is correct |
85 |
Correct |
85 ms |
14972 KB |
Output is correct |
86 |
Correct |
91 ms |
15368 KB |
Output is correct |
87 |
Correct |
84 ms |
15188 KB |
Output is correct |
88 |
Correct |
96 ms |
15620 KB |
Output is correct |
89 |
Correct |
63 ms |
13580 KB |
Output is correct |
90 |
Correct |
102 ms |
15536 KB |
Output is correct |
91 |
Correct |
104 ms |
14580 KB |
Output is correct |
92 |
Correct |
66 ms |
14496 KB |
Output is correct |
93 |
Correct |
106 ms |
15456 KB |
Output is correct |
94 |
Correct |
115 ms |
15180 KB |
Output is correct |
95 |
Correct |
102 ms |
15420 KB |
Output is correct |
96 |
Correct |
115 ms |
15436 KB |
Output is correct |
97 |
Correct |
131 ms |
15440 KB |
Output is correct |
98 |
Correct |
90 ms |
14676 KB |
Output is correct |
99 |
Correct |
53 ms |
14680 KB |
Output is correct |
100 |
Correct |
77 ms |
14260 KB |
Output is correct |
101 |
Correct |
92 ms |
14804 KB |
Output is correct |
102 |
Correct |
110 ms |
15660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
6456 KB |
Output is correct |
2 |
Correct |
5 ms |
6456 KB |
Output is correct |
3 |
Correct |
4 ms |
6356 KB |
Output is correct |
4 |
Correct |
5 ms |
6484 KB |
Output is correct |
5 |
Correct |
4 ms |
6228 KB |
Output is correct |
6 |
Correct |
4 ms |
6228 KB |
Output is correct |
7 |
Correct |
5 ms |
6356 KB |
Output is correct |
8 |
Correct |
5 ms |
6452 KB |
Output is correct |
9 |
Correct |
5 ms |
6456 KB |
Output is correct |
10 |
Correct |
5 ms |
6356 KB |
Output is correct |
11 |
Correct |
5 ms |
6356 KB |
Output is correct |
12 |
Correct |
5 ms |
6356 KB |
Output is correct |
13 |
Correct |
4 ms |
6356 KB |
Output is correct |
14 |
Correct |
4 ms |
6400 KB |
Output is correct |
15 |
Correct |
4 ms |
6356 KB |
Output is correct |
16 |
Correct |
7 ms |
6356 KB |
Output is correct |
17 |
Correct |
5 ms |
6452 KB |
Output is correct |
18 |
Correct |
5 ms |
6388 KB |
Output is correct |
19 |
Correct |
5 ms |
6484 KB |
Output is correct |
20 |
Correct |
6 ms |
6460 KB |
Output is correct |
21 |
Correct |
5 ms |
6404 KB |
Output is correct |
22 |
Correct |
5 ms |
6456 KB |
Output is correct |
23 |
Correct |
5 ms |
6484 KB |
Output is correct |
24 |
Correct |
5 ms |
6460 KB |
Output is correct |
25 |
Correct |
4 ms |
6280 KB |
Output is correct |
26 |
Correct |
5 ms |
6228 KB |
Output is correct |
27 |
Correct |
5 ms |
6484 KB |
Output is correct |
28 |
Correct |
5 ms |
6420 KB |
Output is correct |
29 |
Correct |
5 ms |
6484 KB |
Output is correct |
30 |
Correct |
5 ms |
6484 KB |
Output is correct |
31 |
Correct |
5 ms |
6448 KB |
Output is correct |
32 |
Correct |
5 ms |
6460 KB |
Output is correct |
33 |
Correct |
4 ms |
6460 KB |
Output is correct |
34 |
Correct |
5 ms |
6400 KB |
Output is correct |
35 |
Correct |
5 ms |
6356 KB |
Output is correct |
36 |
Correct |
5 ms |
6356 KB |
Output is correct |
37 |
Correct |
5 ms |
6460 KB |
Output is correct |
38 |
Correct |
5 ms |
6484 KB |
Output is correct |
39 |
Correct |
67 ms |
14756 KB |
Output is correct |
40 |
Correct |
74 ms |
15144 KB |
Output is correct |
41 |
Correct |
79 ms |
14772 KB |
Output is correct |
42 |
Correct |
67 ms |
14812 KB |
Output is correct |
43 |
Correct |
75 ms |
15132 KB |
Output is correct |
44 |
Correct |
76 ms |
15040 KB |
Output is correct |
45 |
Correct |
26 ms |
9508 KB |
Output is correct |
46 |
Correct |
27 ms |
9556 KB |
Output is correct |
47 |
Correct |
67 ms |
14160 KB |
Output is correct |
48 |
Correct |
69 ms |
14948 KB |
Output is correct |
49 |
Correct |
69 ms |
14596 KB |
Output is correct |
50 |
Correct |
70 ms |
14928 KB |
Output is correct |
51 |
Correct |
65 ms |
14468 KB |
Output is correct |
52 |
Correct |
80 ms |
15204 KB |
Output is correct |
53 |
Correct |
85 ms |
15092 KB |
Output is correct |
54 |
Correct |
103 ms |
15444 KB |
Output is correct |
55 |
Correct |
452 ms |
40948 KB |
Output is correct |
56 |
Correct |
303 ms |
38092 KB |
Output is correct |
57 |
Correct |
412 ms |
42304 KB |
Output is correct |
58 |
Correct |
361 ms |
39100 KB |
Output is correct |
59 |
Correct |
340 ms |
38868 KB |
Output is correct |
60 |
Correct |
497 ms |
43216 KB |
Output is correct |
61 |
Correct |
105 ms |
20540 KB |
Output is correct |
62 |
Correct |
123 ms |
20392 KB |
Output is correct |
63 |
Correct |
485 ms |
43576 KB |
Output is correct |
64 |
Correct |
548 ms |
43592 KB |
Output is correct |
65 |
Correct |
421 ms |
40396 KB |
Output is correct |
66 |
Correct |
493 ms |
42332 KB |
Output is correct |
67 |
Correct |
484 ms |
40592 KB |
Output is correct |
68 |
Correct |
455 ms |
42336 KB |
Output is correct |
69 |
Correct |
499 ms |
42316 KB |
Output is correct |
70 |
Correct |
447 ms |
42224 KB |
Output is correct |
71 |
Correct |
449 ms |
42312 KB |
Output is correct |
72 |
Correct |
434 ms |
41288 KB |
Output is correct |
73 |
Correct |
486 ms |
42300 KB |
Output is correct |
74 |
Correct |
455 ms |
41696 KB |
Output is correct |
75 |
Correct |
440 ms |
42340 KB |
Output is correct |
76 |
Correct |
461 ms |
42316 KB |
Output is correct |
77 |
Correct |
437 ms |
42288 KB |
Output is correct |
78 |
Correct |
452 ms |
42300 KB |
Output is correct |
79 |
Correct |
352 ms |
39852 KB |
Output is correct |
80 |
Correct |
320 ms |
40156 KB |
Output is correct |
81 |
Correct |
382 ms |
42788 KB |
Output is correct |
82 |
Correct |
78 ms |
14540 KB |
Output is correct |
83 |
Correct |
73 ms |
14368 KB |
Output is correct |
84 |
Correct |
24 ms |
9164 KB |
Output is correct |
85 |
Correct |
28 ms |
9420 KB |
Output is correct |
86 |
Correct |
92 ms |
14396 KB |
Output is correct |
87 |
Correct |
83 ms |
14964 KB |
Output is correct |
88 |
Correct |
89 ms |
14852 KB |
Output is correct |
89 |
Correct |
82 ms |
14724 KB |
Output is correct |
90 |
Correct |
86 ms |
14932 KB |
Output is correct |
91 |
Correct |
87 ms |
14924 KB |
Output is correct |
92 |
Correct |
41 ms |
14136 KB |
Output is correct |
93 |
Correct |
77 ms |
14316 KB |
Output is correct |
94 |
Correct |
75 ms |
13836 KB |
Output is correct |
95 |
Correct |
92 ms |
14420 KB |
Output is correct |
96 |
Correct |
87 ms |
14964 KB |
Output is correct |
97 |
Correct |
85 ms |
14896 KB |
Output is correct |
98 |
Correct |
79 ms |
14736 KB |
Output is correct |
99 |
Correct |
100 ms |
15512 KB |
Output is correct |
100 |
Correct |
95 ms |
15388 KB |
Output is correct |
101 |
Correct |
120 ms |
15708 KB |
Output is correct |
102 |
Correct |
103 ms |
15864 KB |
Output is correct |
103 |
Correct |
70 ms |
14612 KB |
Output is correct |
104 |
Correct |
100 ms |
15312 KB |
Output is correct |
105 |
Correct |
101 ms |
15820 KB |
Output is correct |
106 |
Correct |
35 ms |
9976 KB |
Output is correct |
107 |
Correct |
33 ms |
9932 KB |
Output is correct |
108 |
Correct |
54 ms |
15052 KB |
Output is correct |
109 |
Correct |
63 ms |
14156 KB |
Output is correct |
110 |
Correct |
83 ms |
15324 KB |
Output is correct |
111 |
Correct |
92 ms |
15404 KB |
Output is correct |
112 |
Correct |
85 ms |
14972 KB |
Output is correct |
113 |
Correct |
91 ms |
15368 KB |
Output is correct |
114 |
Correct |
84 ms |
15188 KB |
Output is correct |
115 |
Correct |
96 ms |
15620 KB |
Output is correct |
116 |
Correct |
63 ms |
13580 KB |
Output is correct |
117 |
Correct |
102 ms |
15536 KB |
Output is correct |
118 |
Correct |
104 ms |
14580 KB |
Output is correct |
119 |
Correct |
66 ms |
14496 KB |
Output is correct |
120 |
Correct |
106 ms |
15456 KB |
Output is correct |
121 |
Correct |
115 ms |
15180 KB |
Output is correct |
122 |
Correct |
102 ms |
15420 KB |
Output is correct |
123 |
Correct |
115 ms |
15436 KB |
Output is correct |
124 |
Correct |
131 ms |
15440 KB |
Output is correct |
125 |
Correct |
90 ms |
14676 KB |
Output is correct |
126 |
Correct |
53 ms |
14680 KB |
Output is correct |
127 |
Correct |
77 ms |
14260 KB |
Output is correct |
128 |
Correct |
92 ms |
14804 KB |
Output is correct |
129 |
Correct |
110 ms |
15660 KB |
Output is correct |
130 |
Correct |
518 ms |
42776 KB |
Output is correct |
131 |
Correct |
373 ms |
38448 KB |
Output is correct |
132 |
Correct |
534 ms |
42780 KB |
Output is correct |
133 |
Correct |
561 ms |
43148 KB |
Output is correct |
134 |
Correct |
473 ms |
41520 KB |
Output is correct |
135 |
Correct |
531 ms |
43892 KB |
Output is correct |
136 |
Correct |
530 ms |
44464 KB |
Output is correct |
137 |
Correct |
499 ms |
44424 KB |
Output is correct |
138 |
Correct |
467 ms |
41008 KB |
Output is correct |
139 |
Correct |
504 ms |
43084 KB |
Output is correct |
140 |
Correct |
704 ms |
41608 KB |
Output is correct |
141 |
Correct |
462 ms |
42936 KB |
Output is correct |
142 |
Correct |
534 ms |
42900 KB |
Output is correct |
143 |
Correct |
548 ms |
42828 KB |
Output is correct |
144 |
Correct |
523 ms |
41940 KB |
Output is correct |
145 |
Correct |
557 ms |
42924 KB |
Output is correct |
146 |
Correct |
558 ms |
42340 KB |
Output is correct |
147 |
Correct |
636 ms |
42852 KB |
Output is correct |
148 |
Correct |
559 ms |
42872 KB |
Output is correct |
149 |
Correct |
542 ms |
42848 KB |
Output is correct |
150 |
Correct |
303 ms |
39780 KB |
Output is correct |
151 |
Correct |
367 ms |
40660 KB |
Output is correct |
152 |
Correct |
335 ms |
40740 KB |
Output is correct |
153 |
Correct |
374 ms |
43564 KB |
Output is correct |