#include<bits/stdc++.h>
#define TASKNAME "codeforce"
#define pb push_back
#define pli pair<ll,ll>
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
using ll=long long;
const ll maxN=3e5;
const ll inf=1e18;
const ll mod=1e9+7;
struct node
{
ll sum,pre;
node()
{
sum=0,pre=0;
}
node operator+(const node&o)
{
node ans;
ans.sum=sum+o.sum;
ans.pre=min(pre,sum+o.pre);
return ans;
}
}st[4*maxN];
ll q;
void update(ll pos,ll val,ll id=1,ll l=1,ll r=q)
{
if(l==r)
{
st[id].sum+=val;
st[id].pre=min(st[id].sum,0ll);
return;
}
ll mid=l+r>>1;
if(pos<=mid) update(pos,val,id*2,l,mid);
else update(pos,val,id*2+1,mid+1,r);
st[id]=st[id*2]+st[id*2+1];
}
node get(ll i,ll j,ll id=1,ll l=1,ll r=q)
{
if(j<l||r<i) return node();
if(i<=l&&r<=j) return st[id];
ll mid=l+r>>1;
return get(i,j,id*2,l,mid)+get(i,j,id*2+1,mid+1,r);
}
ll seg[4*maxN];
void upd(ll pos,ll val,ll id=1,ll l=1,ll r=q)
{
if(l==r)
{
seg[id]+=val;
return;
}
ll mid=l+r>>1;
if(pos<=mid) upd(pos,val,id*2,l,mid);
else upd(pos,val,id*2+1,mid+1,r);
seg[id]=seg[id*2]+seg[id*2+1];
}
ll gt(ll i,ll j,ll id=1,ll l=1,ll r=q)
{
if(j<l||r<i) return 0;
if(i<=l&&r<=j) return seg[id];
ll mid=l+r>>1;
return gt(i,j,id*2,l,mid)+gt(i,j,id*2+1,mid+1,r);
}
ll quer(ll x)
{
ll l=1,r=q,id=1;
while(true)
{
ll mid=l+r>>1;
if(l==r) return l;
if(x>seg[id*2])
{
x-=seg[id*2];
id=id*2+1;
l=mid+1;
}
else
{
id=id*2;
r=mid;
}
}
}
ll n,m,c[maxN];
vector<pli>in[maxN],add[maxN],vec[maxN];
ll ans[maxN];
ll vc[maxN];
void solve()
{
cin >> n >> m >> q;
for(int i=1;i<=q;i++)
{
ll t;
cin >> t;
vc[i]=t;
if(t==1)
{
ll l,r,k;
cin >> l >> r >> c[i] >> k;
in[l].pb({i,k});
in[r+1].pb({i,-k});
add[l].pb({i,k});
add[r+1].pb({i,-k});
}
else if(t==2)
{
ll l,r,k;
cin >> l >> r >> k;
in[l].pb({i,-k});
in[r+1].pb({i,k});
}
else
{
ll a,b;
cin >> a >> b;
vec[a].pb({i,b});
}
}
for(int i=1;i<=n;i++)
{
for(auto zz:in[i])
{
update(zz.fi,zz.se);
}
for(auto zz:add[i])
{
upd(zz.fi,zz.se);
}
for(auto zz:vec[i])
{
auto cc=get(1,zz.fi);
ll con=cc.sum-cc.pre;
if(con>=zz.se)
{
ll dm=gt(1,zz.fi)-(con-zz.se);
ans[zz.fi]=c[quer(dm)];
}
else
{
ans[zz.fi]=0;
}
}
}
for(int i=1;i<=q;i++)
{
if(vc[i]==3)
{
cout << ans[i]<<'\n';
}
}
}
int main()
{
fastio
//freopen(TASKNAME".INP","r",stdin);
//freopen(TASKNAME".OUT","w",stdout);
solve();
}
Compilation message
foodcourt.cpp: In function 'void update(ll, ll, ll, ll, ll)':
foodcourt.cpp:37:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
37 | ll mid=l+r>>1;
| ~^~
foodcourt.cpp: In function 'node get(ll, ll, ll, ll, ll)':
foodcourt.cpp:46:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
46 | ll mid=l+r>>1;
| ~^~
foodcourt.cpp: In function 'void upd(ll, ll, ll, ll, ll)':
foodcourt.cpp:57:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
57 | ll mid=l+r>>1;
| ~^~
foodcourt.cpp: In function 'll gt(ll, ll, ll, ll, ll)':
foodcourt.cpp:66:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
66 | ll mid=l+r>>1;
| ~^~
foodcourt.cpp: In function 'll quer(ll)':
foodcourt.cpp:74:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
74 | ll mid=l+r>>1;
| ~^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
40404 KB |
Output is correct |
2 |
Correct |
22 ms |
40404 KB |
Output is correct |
3 |
Correct |
20 ms |
40396 KB |
Output is correct |
4 |
Correct |
20 ms |
40476 KB |
Output is correct |
5 |
Correct |
19 ms |
40464 KB |
Output is correct |
6 |
Correct |
19 ms |
40452 KB |
Output is correct |
7 |
Correct |
20 ms |
40392 KB |
Output is correct |
8 |
Correct |
20 ms |
40396 KB |
Output is correct |
9 |
Correct |
21 ms |
40480 KB |
Output is correct |
10 |
Correct |
23 ms |
40472 KB |
Output is correct |
11 |
Correct |
23 ms |
40512 KB |
Output is correct |
12 |
Correct |
21 ms |
40432 KB |
Output is correct |
13 |
Correct |
20 ms |
40468 KB |
Output is correct |
14 |
Correct |
20 ms |
40404 KB |
Output is correct |
15 |
Correct |
20 ms |
40396 KB |
Output is correct |
16 |
Correct |
20 ms |
40404 KB |
Output is correct |
17 |
Correct |
19 ms |
40404 KB |
Output is correct |
18 |
Correct |
20 ms |
40504 KB |
Output is correct |
19 |
Correct |
21 ms |
40500 KB |
Output is correct |
20 |
Correct |
21 ms |
40564 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
40404 KB |
Output is correct |
2 |
Correct |
22 ms |
40404 KB |
Output is correct |
3 |
Correct |
20 ms |
40396 KB |
Output is correct |
4 |
Correct |
20 ms |
40476 KB |
Output is correct |
5 |
Correct |
19 ms |
40464 KB |
Output is correct |
6 |
Correct |
19 ms |
40452 KB |
Output is correct |
7 |
Correct |
20 ms |
40392 KB |
Output is correct |
8 |
Correct |
20 ms |
40396 KB |
Output is correct |
9 |
Correct |
21 ms |
40480 KB |
Output is correct |
10 |
Correct |
23 ms |
40472 KB |
Output is correct |
11 |
Correct |
23 ms |
40512 KB |
Output is correct |
12 |
Correct |
21 ms |
40432 KB |
Output is correct |
13 |
Correct |
20 ms |
40468 KB |
Output is correct |
14 |
Correct |
20 ms |
40404 KB |
Output is correct |
15 |
Correct |
20 ms |
40396 KB |
Output is correct |
16 |
Correct |
20 ms |
40404 KB |
Output is correct |
17 |
Correct |
19 ms |
40404 KB |
Output is correct |
18 |
Correct |
20 ms |
40504 KB |
Output is correct |
19 |
Correct |
21 ms |
40500 KB |
Output is correct |
20 |
Correct |
21 ms |
40564 KB |
Output is correct |
21 |
Correct |
21 ms |
40424 KB |
Output is correct |
22 |
Correct |
22 ms |
40456 KB |
Output is correct |
23 |
Correct |
23 ms |
40528 KB |
Output is correct |
24 |
Correct |
24 ms |
40432 KB |
Output is correct |
25 |
Correct |
26 ms |
40404 KB |
Output is correct |
26 |
Correct |
19 ms |
40436 KB |
Output is correct |
27 |
Correct |
20 ms |
40404 KB |
Output is correct |
28 |
Correct |
20 ms |
40532 KB |
Output is correct |
29 |
Correct |
20 ms |
40464 KB |
Output is correct |
30 |
Correct |
24 ms |
40532 KB |
Output is correct |
31 |
Correct |
20 ms |
40468 KB |
Output is correct |
32 |
Correct |
22 ms |
40404 KB |
Output is correct |
33 |
Correct |
19 ms |
40464 KB |
Output is correct |
34 |
Correct |
21 ms |
40424 KB |
Output is correct |
35 |
Correct |
22 ms |
40392 KB |
Output is correct |
36 |
Correct |
20 ms |
40448 KB |
Output is correct |
37 |
Correct |
20 ms |
40468 KB |
Output is correct |
38 |
Correct |
24 ms |
40520 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
97 ms |
46936 KB |
Output is correct |
2 |
Correct |
114 ms |
48716 KB |
Output is correct |
3 |
Correct |
100 ms |
48068 KB |
Output is correct |
4 |
Correct |
99 ms |
48056 KB |
Output is correct |
5 |
Correct |
120 ms |
48804 KB |
Output is correct |
6 |
Correct |
125 ms |
48684 KB |
Output is correct |
7 |
Correct |
48 ms |
45968 KB |
Output is correct |
8 |
Correct |
49 ms |
46248 KB |
Output is correct |
9 |
Correct |
98 ms |
47840 KB |
Output is correct |
10 |
Correct |
100 ms |
48300 KB |
Output is correct |
11 |
Correct |
100 ms |
48204 KB |
Output is correct |
12 |
Correct |
101 ms |
48388 KB |
Output is correct |
13 |
Correct |
90 ms |
47720 KB |
Output is correct |
14 |
Correct |
104 ms |
48676 KB |
Output is correct |
15 |
Correct |
113 ms |
49872 KB |
Output is correct |
16 |
Correct |
118 ms |
50020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
446 ms |
64440 KB |
Output is correct |
2 |
Correct |
348 ms |
60664 KB |
Output is correct |
3 |
Correct |
469 ms |
66396 KB |
Output is correct |
4 |
Correct |
363 ms |
62348 KB |
Output is correct |
5 |
Correct |
371 ms |
62316 KB |
Output is correct |
6 |
Correct |
525 ms |
68684 KB |
Output is correct |
7 |
Correct |
151 ms |
61560 KB |
Output is correct |
8 |
Correct |
158 ms |
62136 KB |
Output is correct |
9 |
Correct |
478 ms |
67532 KB |
Output is correct |
10 |
Correct |
502 ms |
67356 KB |
Output is correct |
11 |
Correct |
459 ms |
64168 KB |
Output is correct |
12 |
Correct |
465 ms |
67124 KB |
Output is correct |
13 |
Correct |
520 ms |
64376 KB |
Output is correct |
14 |
Correct |
491 ms |
67296 KB |
Output is correct |
15 |
Correct |
478 ms |
67024 KB |
Output is correct |
16 |
Correct |
498 ms |
67068 KB |
Output is correct |
17 |
Correct |
490 ms |
67128 KB |
Output is correct |
18 |
Correct |
513 ms |
65504 KB |
Output is correct |
19 |
Correct |
509 ms |
67112 KB |
Output is correct |
20 |
Correct |
532 ms |
65976 KB |
Output is correct |
21 |
Correct |
484 ms |
67148 KB |
Output is correct |
22 |
Correct |
498 ms |
67048 KB |
Output is correct |
23 |
Correct |
494 ms |
67280 KB |
Output is correct |
24 |
Correct |
488 ms |
67020 KB |
Output is correct |
25 |
Correct |
341 ms |
65992 KB |
Output is correct |
26 |
Correct |
350 ms |
66380 KB |
Output is correct |
27 |
Correct |
369 ms |
70268 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
40404 KB |
Output is correct |
2 |
Correct |
22 ms |
40404 KB |
Output is correct |
3 |
Correct |
20 ms |
40396 KB |
Output is correct |
4 |
Correct |
20 ms |
40476 KB |
Output is correct |
5 |
Correct |
19 ms |
40464 KB |
Output is correct |
6 |
Correct |
19 ms |
40452 KB |
Output is correct |
7 |
Correct |
20 ms |
40392 KB |
Output is correct |
8 |
Correct |
20 ms |
40396 KB |
Output is correct |
9 |
Correct |
21 ms |
40480 KB |
Output is correct |
10 |
Correct |
23 ms |
40472 KB |
Output is correct |
11 |
Correct |
23 ms |
40512 KB |
Output is correct |
12 |
Correct |
21 ms |
40432 KB |
Output is correct |
13 |
Correct |
20 ms |
40468 KB |
Output is correct |
14 |
Correct |
20 ms |
40404 KB |
Output is correct |
15 |
Correct |
20 ms |
40396 KB |
Output is correct |
16 |
Correct |
20 ms |
40404 KB |
Output is correct |
17 |
Correct |
19 ms |
40404 KB |
Output is correct |
18 |
Correct |
20 ms |
40504 KB |
Output is correct |
19 |
Correct |
21 ms |
40500 KB |
Output is correct |
20 |
Correct |
21 ms |
40564 KB |
Output is correct |
21 |
Correct |
97 ms |
46936 KB |
Output is correct |
22 |
Correct |
114 ms |
48716 KB |
Output is correct |
23 |
Correct |
100 ms |
48068 KB |
Output is correct |
24 |
Correct |
99 ms |
48056 KB |
Output is correct |
25 |
Correct |
120 ms |
48804 KB |
Output is correct |
26 |
Correct |
125 ms |
48684 KB |
Output is correct |
27 |
Correct |
48 ms |
45968 KB |
Output is correct |
28 |
Correct |
49 ms |
46248 KB |
Output is correct |
29 |
Correct |
98 ms |
47840 KB |
Output is correct |
30 |
Correct |
100 ms |
48300 KB |
Output is correct |
31 |
Correct |
100 ms |
48204 KB |
Output is correct |
32 |
Correct |
101 ms |
48388 KB |
Output is correct |
33 |
Correct |
90 ms |
47720 KB |
Output is correct |
34 |
Correct |
104 ms |
48676 KB |
Output is correct |
35 |
Correct |
113 ms |
49872 KB |
Output is correct |
36 |
Correct |
118 ms |
50020 KB |
Output is correct |
37 |
Correct |
86 ms |
47284 KB |
Output is correct |
38 |
Correct |
92 ms |
47300 KB |
Output is correct |
39 |
Correct |
49 ms |
45420 KB |
Output is correct |
40 |
Correct |
53 ms |
46312 KB |
Output is correct |
41 |
Correct |
112 ms |
47464 KB |
Output is correct |
42 |
Correct |
102 ms |
48200 KB |
Output is correct |
43 |
Correct |
108 ms |
48164 KB |
Output is correct |
44 |
Correct |
103 ms |
47804 KB |
Output is correct |
45 |
Correct |
113 ms |
48232 KB |
Output is correct |
46 |
Correct |
114 ms |
48204 KB |
Output is correct |
47 |
Correct |
61 ms |
46896 KB |
Output is correct |
48 |
Correct |
83 ms |
47980 KB |
Output is correct |
49 |
Correct |
78 ms |
46272 KB |
Output is correct |
50 |
Correct |
102 ms |
47300 KB |
Output is correct |
51 |
Correct |
97 ms |
48276 KB |
Output is correct |
52 |
Correct |
100 ms |
48292 KB |
Output is correct |
53 |
Correct |
91 ms |
48064 KB |
Output is correct |
54 |
Correct |
108 ms |
50004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
96 ms |
46804 KB |
Output is correct |
2 |
Correct |
114 ms |
48796 KB |
Output is correct |
3 |
Correct |
107 ms |
48964 KB |
Output is correct |
4 |
Correct |
84 ms |
46672 KB |
Output is correct |
5 |
Correct |
116 ms |
47820 KB |
Output is correct |
6 |
Correct |
103 ms |
48912 KB |
Output is correct |
7 |
Correct |
53 ms |
46368 KB |
Output is correct |
8 |
Correct |
53 ms |
45996 KB |
Output is correct |
9 |
Correct |
76 ms |
47400 KB |
Output is correct |
10 |
Correct |
83 ms |
46392 KB |
Output is correct |
11 |
Correct |
90 ms |
48148 KB |
Output is correct |
12 |
Correct |
90 ms |
48188 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
40404 KB |
Output is correct |
2 |
Correct |
22 ms |
40404 KB |
Output is correct |
3 |
Correct |
20 ms |
40396 KB |
Output is correct |
4 |
Correct |
20 ms |
40476 KB |
Output is correct |
5 |
Correct |
19 ms |
40464 KB |
Output is correct |
6 |
Correct |
19 ms |
40452 KB |
Output is correct |
7 |
Correct |
20 ms |
40392 KB |
Output is correct |
8 |
Correct |
20 ms |
40396 KB |
Output is correct |
9 |
Correct |
21 ms |
40480 KB |
Output is correct |
10 |
Correct |
23 ms |
40472 KB |
Output is correct |
11 |
Correct |
23 ms |
40512 KB |
Output is correct |
12 |
Correct |
21 ms |
40432 KB |
Output is correct |
13 |
Correct |
20 ms |
40468 KB |
Output is correct |
14 |
Correct |
20 ms |
40404 KB |
Output is correct |
15 |
Correct |
20 ms |
40396 KB |
Output is correct |
16 |
Correct |
20 ms |
40404 KB |
Output is correct |
17 |
Correct |
19 ms |
40404 KB |
Output is correct |
18 |
Correct |
20 ms |
40504 KB |
Output is correct |
19 |
Correct |
21 ms |
40500 KB |
Output is correct |
20 |
Correct |
21 ms |
40564 KB |
Output is correct |
21 |
Correct |
21 ms |
40424 KB |
Output is correct |
22 |
Correct |
22 ms |
40456 KB |
Output is correct |
23 |
Correct |
23 ms |
40528 KB |
Output is correct |
24 |
Correct |
24 ms |
40432 KB |
Output is correct |
25 |
Correct |
26 ms |
40404 KB |
Output is correct |
26 |
Correct |
19 ms |
40436 KB |
Output is correct |
27 |
Correct |
20 ms |
40404 KB |
Output is correct |
28 |
Correct |
20 ms |
40532 KB |
Output is correct |
29 |
Correct |
20 ms |
40464 KB |
Output is correct |
30 |
Correct |
24 ms |
40532 KB |
Output is correct |
31 |
Correct |
20 ms |
40468 KB |
Output is correct |
32 |
Correct |
22 ms |
40404 KB |
Output is correct |
33 |
Correct |
19 ms |
40464 KB |
Output is correct |
34 |
Correct |
21 ms |
40424 KB |
Output is correct |
35 |
Correct |
22 ms |
40392 KB |
Output is correct |
36 |
Correct |
20 ms |
40448 KB |
Output is correct |
37 |
Correct |
20 ms |
40468 KB |
Output is correct |
38 |
Correct |
24 ms |
40520 KB |
Output is correct |
39 |
Correct |
97 ms |
46936 KB |
Output is correct |
40 |
Correct |
114 ms |
48716 KB |
Output is correct |
41 |
Correct |
100 ms |
48068 KB |
Output is correct |
42 |
Correct |
99 ms |
48056 KB |
Output is correct |
43 |
Correct |
120 ms |
48804 KB |
Output is correct |
44 |
Correct |
125 ms |
48684 KB |
Output is correct |
45 |
Correct |
48 ms |
45968 KB |
Output is correct |
46 |
Correct |
49 ms |
46248 KB |
Output is correct |
47 |
Correct |
98 ms |
47840 KB |
Output is correct |
48 |
Correct |
100 ms |
48300 KB |
Output is correct |
49 |
Correct |
100 ms |
48204 KB |
Output is correct |
50 |
Correct |
101 ms |
48388 KB |
Output is correct |
51 |
Correct |
90 ms |
47720 KB |
Output is correct |
52 |
Correct |
104 ms |
48676 KB |
Output is correct |
53 |
Correct |
113 ms |
49872 KB |
Output is correct |
54 |
Correct |
118 ms |
50020 KB |
Output is correct |
55 |
Correct |
86 ms |
47284 KB |
Output is correct |
56 |
Correct |
92 ms |
47300 KB |
Output is correct |
57 |
Correct |
49 ms |
45420 KB |
Output is correct |
58 |
Correct |
53 ms |
46312 KB |
Output is correct |
59 |
Correct |
112 ms |
47464 KB |
Output is correct |
60 |
Correct |
102 ms |
48200 KB |
Output is correct |
61 |
Correct |
108 ms |
48164 KB |
Output is correct |
62 |
Correct |
103 ms |
47804 KB |
Output is correct |
63 |
Correct |
113 ms |
48232 KB |
Output is correct |
64 |
Correct |
114 ms |
48204 KB |
Output is correct |
65 |
Correct |
61 ms |
46896 KB |
Output is correct |
66 |
Correct |
83 ms |
47980 KB |
Output is correct |
67 |
Correct |
78 ms |
46272 KB |
Output is correct |
68 |
Correct |
102 ms |
47300 KB |
Output is correct |
69 |
Correct |
97 ms |
48276 KB |
Output is correct |
70 |
Correct |
100 ms |
48292 KB |
Output is correct |
71 |
Correct |
91 ms |
48064 KB |
Output is correct |
72 |
Correct |
108 ms |
50004 KB |
Output is correct |
73 |
Correct |
96 ms |
46804 KB |
Output is correct |
74 |
Correct |
114 ms |
48796 KB |
Output is correct |
75 |
Correct |
107 ms |
48964 KB |
Output is correct |
76 |
Correct |
84 ms |
46672 KB |
Output is correct |
77 |
Correct |
116 ms |
47820 KB |
Output is correct |
78 |
Correct |
103 ms |
48912 KB |
Output is correct |
79 |
Correct |
53 ms |
46368 KB |
Output is correct |
80 |
Correct |
53 ms |
45996 KB |
Output is correct |
81 |
Correct |
76 ms |
47400 KB |
Output is correct |
82 |
Correct |
83 ms |
46392 KB |
Output is correct |
83 |
Correct |
90 ms |
48148 KB |
Output is correct |
84 |
Correct |
90 ms |
48188 KB |
Output is correct |
85 |
Correct |
97 ms |
47816 KB |
Output is correct |
86 |
Correct |
117 ms |
48488 KB |
Output is correct |
87 |
Correct |
107 ms |
48200 KB |
Output is correct |
88 |
Correct |
116 ms |
49168 KB |
Output is correct |
89 |
Correct |
77 ms |
45656 KB |
Output is correct |
90 |
Correct |
103 ms |
48796 KB |
Output is correct |
91 |
Correct |
100 ms |
47308 KB |
Output is correct |
92 |
Correct |
105 ms |
47052 KB |
Output is correct |
93 |
Correct |
102 ms |
48668 KB |
Output is correct |
94 |
Correct |
109 ms |
48392 KB |
Output is correct |
95 |
Correct |
109 ms |
48584 KB |
Output is correct |
96 |
Correct |
116 ms |
48828 KB |
Output is correct |
97 |
Correct |
118 ms |
48740 KB |
Output is correct |
98 |
Correct |
100 ms |
47556 KB |
Output is correct |
99 |
Correct |
64 ms |
46916 KB |
Output is correct |
100 |
Correct |
78 ms |
46924 KB |
Output is correct |
101 |
Correct |
90 ms |
48380 KB |
Output is correct |
102 |
Correct |
93 ms |
49568 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
40404 KB |
Output is correct |
2 |
Correct |
22 ms |
40404 KB |
Output is correct |
3 |
Correct |
20 ms |
40396 KB |
Output is correct |
4 |
Correct |
20 ms |
40476 KB |
Output is correct |
5 |
Correct |
19 ms |
40464 KB |
Output is correct |
6 |
Correct |
19 ms |
40452 KB |
Output is correct |
7 |
Correct |
20 ms |
40392 KB |
Output is correct |
8 |
Correct |
20 ms |
40396 KB |
Output is correct |
9 |
Correct |
21 ms |
40480 KB |
Output is correct |
10 |
Correct |
23 ms |
40472 KB |
Output is correct |
11 |
Correct |
23 ms |
40512 KB |
Output is correct |
12 |
Correct |
21 ms |
40432 KB |
Output is correct |
13 |
Correct |
20 ms |
40468 KB |
Output is correct |
14 |
Correct |
20 ms |
40404 KB |
Output is correct |
15 |
Correct |
20 ms |
40396 KB |
Output is correct |
16 |
Correct |
20 ms |
40404 KB |
Output is correct |
17 |
Correct |
19 ms |
40404 KB |
Output is correct |
18 |
Correct |
20 ms |
40504 KB |
Output is correct |
19 |
Correct |
21 ms |
40500 KB |
Output is correct |
20 |
Correct |
21 ms |
40564 KB |
Output is correct |
21 |
Correct |
21 ms |
40424 KB |
Output is correct |
22 |
Correct |
22 ms |
40456 KB |
Output is correct |
23 |
Correct |
23 ms |
40528 KB |
Output is correct |
24 |
Correct |
24 ms |
40432 KB |
Output is correct |
25 |
Correct |
26 ms |
40404 KB |
Output is correct |
26 |
Correct |
19 ms |
40436 KB |
Output is correct |
27 |
Correct |
20 ms |
40404 KB |
Output is correct |
28 |
Correct |
20 ms |
40532 KB |
Output is correct |
29 |
Correct |
20 ms |
40464 KB |
Output is correct |
30 |
Correct |
24 ms |
40532 KB |
Output is correct |
31 |
Correct |
20 ms |
40468 KB |
Output is correct |
32 |
Correct |
22 ms |
40404 KB |
Output is correct |
33 |
Correct |
19 ms |
40464 KB |
Output is correct |
34 |
Correct |
21 ms |
40424 KB |
Output is correct |
35 |
Correct |
22 ms |
40392 KB |
Output is correct |
36 |
Correct |
20 ms |
40448 KB |
Output is correct |
37 |
Correct |
20 ms |
40468 KB |
Output is correct |
38 |
Correct |
24 ms |
40520 KB |
Output is correct |
39 |
Correct |
97 ms |
46936 KB |
Output is correct |
40 |
Correct |
114 ms |
48716 KB |
Output is correct |
41 |
Correct |
100 ms |
48068 KB |
Output is correct |
42 |
Correct |
99 ms |
48056 KB |
Output is correct |
43 |
Correct |
120 ms |
48804 KB |
Output is correct |
44 |
Correct |
125 ms |
48684 KB |
Output is correct |
45 |
Correct |
48 ms |
45968 KB |
Output is correct |
46 |
Correct |
49 ms |
46248 KB |
Output is correct |
47 |
Correct |
98 ms |
47840 KB |
Output is correct |
48 |
Correct |
100 ms |
48300 KB |
Output is correct |
49 |
Correct |
100 ms |
48204 KB |
Output is correct |
50 |
Correct |
101 ms |
48388 KB |
Output is correct |
51 |
Correct |
90 ms |
47720 KB |
Output is correct |
52 |
Correct |
104 ms |
48676 KB |
Output is correct |
53 |
Correct |
113 ms |
49872 KB |
Output is correct |
54 |
Correct |
118 ms |
50020 KB |
Output is correct |
55 |
Correct |
446 ms |
64440 KB |
Output is correct |
56 |
Correct |
348 ms |
60664 KB |
Output is correct |
57 |
Correct |
469 ms |
66396 KB |
Output is correct |
58 |
Correct |
363 ms |
62348 KB |
Output is correct |
59 |
Correct |
371 ms |
62316 KB |
Output is correct |
60 |
Correct |
525 ms |
68684 KB |
Output is correct |
61 |
Correct |
151 ms |
61560 KB |
Output is correct |
62 |
Correct |
158 ms |
62136 KB |
Output is correct |
63 |
Correct |
478 ms |
67532 KB |
Output is correct |
64 |
Correct |
502 ms |
67356 KB |
Output is correct |
65 |
Correct |
459 ms |
64168 KB |
Output is correct |
66 |
Correct |
465 ms |
67124 KB |
Output is correct |
67 |
Correct |
520 ms |
64376 KB |
Output is correct |
68 |
Correct |
491 ms |
67296 KB |
Output is correct |
69 |
Correct |
478 ms |
67024 KB |
Output is correct |
70 |
Correct |
498 ms |
67068 KB |
Output is correct |
71 |
Correct |
490 ms |
67128 KB |
Output is correct |
72 |
Correct |
513 ms |
65504 KB |
Output is correct |
73 |
Correct |
509 ms |
67112 KB |
Output is correct |
74 |
Correct |
532 ms |
65976 KB |
Output is correct |
75 |
Correct |
484 ms |
67148 KB |
Output is correct |
76 |
Correct |
498 ms |
67048 KB |
Output is correct |
77 |
Correct |
494 ms |
67280 KB |
Output is correct |
78 |
Correct |
488 ms |
67020 KB |
Output is correct |
79 |
Correct |
341 ms |
65992 KB |
Output is correct |
80 |
Correct |
350 ms |
66380 KB |
Output is correct |
81 |
Correct |
369 ms |
70268 KB |
Output is correct |
82 |
Correct |
86 ms |
47284 KB |
Output is correct |
83 |
Correct |
92 ms |
47300 KB |
Output is correct |
84 |
Correct |
49 ms |
45420 KB |
Output is correct |
85 |
Correct |
53 ms |
46312 KB |
Output is correct |
86 |
Correct |
112 ms |
47464 KB |
Output is correct |
87 |
Correct |
102 ms |
48200 KB |
Output is correct |
88 |
Correct |
108 ms |
48164 KB |
Output is correct |
89 |
Correct |
103 ms |
47804 KB |
Output is correct |
90 |
Correct |
113 ms |
48232 KB |
Output is correct |
91 |
Correct |
114 ms |
48204 KB |
Output is correct |
92 |
Correct |
61 ms |
46896 KB |
Output is correct |
93 |
Correct |
83 ms |
47980 KB |
Output is correct |
94 |
Correct |
78 ms |
46272 KB |
Output is correct |
95 |
Correct |
102 ms |
47300 KB |
Output is correct |
96 |
Correct |
97 ms |
48276 KB |
Output is correct |
97 |
Correct |
100 ms |
48292 KB |
Output is correct |
98 |
Correct |
91 ms |
48064 KB |
Output is correct |
99 |
Correct |
108 ms |
50004 KB |
Output is correct |
100 |
Correct |
96 ms |
46804 KB |
Output is correct |
101 |
Correct |
114 ms |
48796 KB |
Output is correct |
102 |
Correct |
107 ms |
48964 KB |
Output is correct |
103 |
Correct |
84 ms |
46672 KB |
Output is correct |
104 |
Correct |
116 ms |
47820 KB |
Output is correct |
105 |
Correct |
103 ms |
48912 KB |
Output is correct |
106 |
Correct |
53 ms |
46368 KB |
Output is correct |
107 |
Correct |
53 ms |
45996 KB |
Output is correct |
108 |
Correct |
76 ms |
47400 KB |
Output is correct |
109 |
Correct |
83 ms |
46392 KB |
Output is correct |
110 |
Correct |
90 ms |
48148 KB |
Output is correct |
111 |
Correct |
90 ms |
48188 KB |
Output is correct |
112 |
Correct |
97 ms |
47816 KB |
Output is correct |
113 |
Correct |
117 ms |
48488 KB |
Output is correct |
114 |
Correct |
107 ms |
48200 KB |
Output is correct |
115 |
Correct |
116 ms |
49168 KB |
Output is correct |
116 |
Correct |
77 ms |
45656 KB |
Output is correct |
117 |
Correct |
103 ms |
48796 KB |
Output is correct |
118 |
Correct |
100 ms |
47308 KB |
Output is correct |
119 |
Correct |
105 ms |
47052 KB |
Output is correct |
120 |
Correct |
102 ms |
48668 KB |
Output is correct |
121 |
Correct |
109 ms |
48392 KB |
Output is correct |
122 |
Correct |
109 ms |
48584 KB |
Output is correct |
123 |
Correct |
116 ms |
48828 KB |
Output is correct |
124 |
Correct |
118 ms |
48740 KB |
Output is correct |
125 |
Correct |
100 ms |
47556 KB |
Output is correct |
126 |
Correct |
64 ms |
46916 KB |
Output is correct |
127 |
Correct |
78 ms |
46924 KB |
Output is correct |
128 |
Correct |
90 ms |
48380 KB |
Output is correct |
129 |
Correct |
93 ms |
49568 KB |
Output is correct |
130 |
Correct |
496 ms |
72520 KB |
Output is correct |
131 |
Correct |
340 ms |
64840 KB |
Output is correct |
132 |
Correct |
483 ms |
72808 KB |
Output is correct |
133 |
Correct |
475 ms |
73920 KB |
Output is correct |
134 |
Correct |
448 ms |
70804 KB |
Output is correct |
135 |
Correct |
507 ms |
75276 KB |
Output is correct |
136 |
Correct |
479 ms |
74240 KB |
Output is correct |
137 |
Correct |
475 ms |
74212 KB |
Output is correct |
138 |
Correct |
506 ms |
70676 KB |
Output is correct |
139 |
Correct |
531 ms |
73516 KB |
Output is correct |
140 |
Correct |
460 ms |
71220 KB |
Output is correct |
141 |
Correct |
481 ms |
73584 KB |
Output is correct |
142 |
Correct |
485 ms |
73424 KB |
Output is correct |
143 |
Correct |
477 ms |
73384 KB |
Output is correct |
144 |
Correct |
455 ms |
71976 KB |
Output is correct |
145 |
Correct |
483 ms |
73676 KB |
Output is correct |
146 |
Correct |
459 ms |
72528 KB |
Output is correct |
147 |
Correct |
474 ms |
73384 KB |
Output is correct |
148 |
Correct |
506 ms |
73424 KB |
Output is correct |
149 |
Correct |
505 ms |
73548 KB |
Output is correct |
150 |
Correct |
224 ms |
68328 KB |
Output is correct |
151 |
Correct |
337 ms |
72388 KB |
Output is correct |
152 |
Correct |
381 ms |
72580 KB |
Output is correct |
153 |
Correct |
391 ms |
76656 KB |
Output is correct |