#include <bits/stdc++.h>
using namespace std;
// #define x first
// #define y second
#define int long long
pair<int,int> tree[2000000];
void merge(pair<int,int> &a,pair<int,int> b){
int cut = min(a.second,b.first);
a.second-=cut;
b.first-=cut;
a.first+=b.first;
a.second+=b.second;
}
int n;
void update(int qL,int qR,pair<int,int> qu,int x=1,int l=1,int r=n){
if(qR<l or r<qL)return;
if(qL<=l and r<=qR){
merge(tree[x],qu);
return;
}
merge(tree[2*x],tree[x]);
merge(tree[2*x+1],tree[x]);
tree[x] = {0,0};
int mid = (l+r)/2;
update(qL,qR,qu,2*x,l,mid);
update(qL,qR,qu,2*x+1,mid+1,r);
}
int get(int qu,int x=1,int l=1,int r=n){
if(qu<l or r<qu)return 0;
if(l==r){
return tree[x].second;
}
merge(tree[2*x],tree[x]);
merge(tree[2*x+1],tree[x]);
tree[x] = {0,0};
int mid = (l+r)/2;
return get(qu,2*x,l,mid)+get(qu,2*x+1,mid+1,r);
}
struct fenwick{
vector<int> tree;
fenwick(int n):tree(n+1){}
int get(int x){
int ans = 0;
while(x){
ans+=tree[x];
x-=x&-x;
}
return ans;
}
void update(int x,int k){
while(x<tree.size()){
tree[x]+=k;
x+=x&-x;
}
}
};
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int m,q;
cin >> n >> m >> q;
fenwick addedamt(n);
vector<vector<pair<int,int>>> queries(n+1);
vector<vector<pair<int,bool>>> events(n+2);
vector<pair<int,int>> addq(q+1);
int out = 0;
for(int i=1;i<=q;i++){
int type;cin>>type;
if(type==1){
int l,r,c,k;cin>>l>>r>>c>>k;
update(l,r,{0,k});
addedamt.update(l,k);
addedamt.update(r+1,-k);
events[l].emplace_back(i,true);
events[r+1].emplace_back(i,false);
addq[i] = {c,k};
} else if(type==2){
int l,r,k;cin>>l>>r>>k;
update(l,r,{k,0});
} else {
int a,b;cin>>a>>b;
int act = b+addedamt.get(a)-get(a);
if(act>addedamt.get(a))++out;
else queries[a].emplace_back(act,++out);
}
}
vector<int> ans(out+1);
fenwick curr(q+1);
for(int i=1;i<=n;i++){
for(auto&[idx,type]:events[i]){
if(type){
curr.update(idx,addq[idx].second);
} else {
curr.update(idx,-addq[idx].second);
}
}
for(auto&[act,idx]:queries[i]){
int last = 0;
for(int jump = 131072;jump;jump/=2){
if(last+jump>q)continue;
if(curr.get(last+jump)<act)last+=jump;
}
last++;
ans[idx] = addq[last].first;
}
}
for(int i=1;i<=out;i++)cout<<ans[i]<<'\n';
}
Compilation message
foodcourt.cpp: In member function 'void fenwick::update(long long int, long long int)':
foodcourt.cpp:58:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
58 | while(x<tree.size()){
| ~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
716 KB |
Output is correct |
8 |
Correct |
2 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
716 KB |
Output is correct |
8 |
Correct |
2 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
1 ms |
604 KB |
Output is correct |
22 |
Correct |
2 ms |
600 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
604 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
1 ms |
604 KB |
Output is correct |
29 |
Correct |
1 ms |
604 KB |
Output is correct |
30 |
Correct |
2 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
688 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
8832 KB |
Output is correct |
2 |
Correct |
36 ms |
9296 KB |
Output is correct |
3 |
Correct |
38 ms |
8780 KB |
Output is correct |
4 |
Correct |
40 ms |
8784 KB |
Output is correct |
5 |
Correct |
38 ms |
9340 KB |
Output is correct |
6 |
Correct |
38 ms |
9300 KB |
Output is correct |
7 |
Correct |
19 ms |
2828 KB |
Output is correct |
8 |
Correct |
13 ms |
2828 KB |
Output is correct |
9 |
Correct |
39 ms |
8868 KB |
Output is correct |
10 |
Correct |
42 ms |
9020 KB |
Output is correct |
11 |
Correct |
39 ms |
9040 KB |
Output is correct |
12 |
Correct |
38 ms |
9044 KB |
Output is correct |
13 |
Correct |
35 ms |
8144 KB |
Output is correct |
14 |
Correct |
40 ms |
9752 KB |
Output is correct |
15 |
Correct |
54 ms |
9228 KB |
Output is correct |
16 |
Correct |
43 ms |
10320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
265 ms |
32852 KB |
Output is correct |
2 |
Correct |
178 ms |
28752 KB |
Output is correct |
3 |
Correct |
285 ms |
35244 KB |
Output is correct |
4 |
Correct |
211 ms |
32592 KB |
Output is correct |
5 |
Correct |
215 ms |
29476 KB |
Output is correct |
6 |
Correct |
301 ms |
36504 KB |
Output is correct |
7 |
Correct |
56 ms |
10676 KB |
Output is correct |
8 |
Correct |
61 ms |
11016 KB |
Output is correct |
9 |
Correct |
258 ms |
38224 KB |
Output is correct |
10 |
Correct |
299 ms |
38160 KB |
Output is correct |
11 |
Correct |
250 ms |
35152 KB |
Output is correct |
12 |
Correct |
254 ms |
35060 KB |
Output is correct |
13 |
Correct |
261 ms |
35100 KB |
Output is correct |
14 |
Correct |
287 ms |
35404 KB |
Output is correct |
15 |
Correct |
256 ms |
35164 KB |
Output is correct |
16 |
Correct |
261 ms |
35000 KB |
Output is correct |
17 |
Correct |
274 ms |
35152 KB |
Output is correct |
18 |
Correct |
283 ms |
35292 KB |
Output is correct |
19 |
Correct |
287 ms |
35116 KB |
Output is correct |
20 |
Correct |
256 ms |
35152 KB |
Output is correct |
21 |
Correct |
269 ms |
35016 KB |
Output is correct |
22 |
Correct |
277 ms |
35152 KB |
Output is correct |
23 |
Correct |
277 ms |
35120 KB |
Output is correct |
24 |
Correct |
300 ms |
35096 KB |
Output is correct |
25 |
Correct |
201 ms |
31684 KB |
Output is correct |
26 |
Correct |
212 ms |
35112 KB |
Output is correct |
27 |
Correct |
182 ms |
37968 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
716 KB |
Output is correct |
8 |
Correct |
2 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
33 ms |
8832 KB |
Output is correct |
22 |
Correct |
36 ms |
9296 KB |
Output is correct |
23 |
Correct |
38 ms |
8780 KB |
Output is correct |
24 |
Correct |
40 ms |
8784 KB |
Output is correct |
25 |
Correct |
38 ms |
9340 KB |
Output is correct |
26 |
Correct |
38 ms |
9300 KB |
Output is correct |
27 |
Correct |
19 ms |
2828 KB |
Output is correct |
28 |
Correct |
13 ms |
2828 KB |
Output is correct |
29 |
Correct |
39 ms |
8868 KB |
Output is correct |
30 |
Correct |
42 ms |
9020 KB |
Output is correct |
31 |
Correct |
39 ms |
9040 KB |
Output is correct |
32 |
Correct |
38 ms |
9044 KB |
Output is correct |
33 |
Correct |
35 ms |
8144 KB |
Output is correct |
34 |
Correct |
40 ms |
9752 KB |
Output is correct |
35 |
Correct |
54 ms |
9228 KB |
Output is correct |
36 |
Correct |
43 ms |
10320 KB |
Output is correct |
37 |
Correct |
60 ms |
8788 KB |
Output is correct |
38 |
Correct |
47 ms |
8528 KB |
Output is correct |
39 |
Correct |
12 ms |
2600 KB |
Output is correct |
40 |
Correct |
13 ms |
2928 KB |
Output is correct |
41 |
Correct |
62 ms |
9252 KB |
Output is correct |
42 |
Correct |
61 ms |
9300 KB |
Output is correct |
43 |
Correct |
55 ms |
9320 KB |
Output is correct |
44 |
Correct |
51 ms |
9424 KB |
Output is correct |
45 |
Correct |
51 ms |
9296 KB |
Output is correct |
46 |
Correct |
52 ms |
9300 KB |
Output is correct |
47 |
Correct |
27 ms |
8832 KB |
Output is correct |
48 |
Correct |
47 ms |
9300 KB |
Output is correct |
49 |
Correct |
36 ms |
7256 KB |
Output is correct |
50 |
Correct |
44 ms |
8796 KB |
Output is correct |
51 |
Correct |
62 ms |
9408 KB |
Output is correct |
52 |
Correct |
51 ms |
9356 KB |
Output is correct |
53 |
Correct |
30 ms |
9048 KB |
Output is correct |
54 |
Correct |
38 ms |
10468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
57 ms |
9764 KB |
Output is correct |
2 |
Correct |
59 ms |
9548 KB |
Output is correct |
3 |
Correct |
68 ms |
10396 KB |
Output is correct |
4 |
Correct |
44 ms |
8788 KB |
Output is correct |
5 |
Correct |
56 ms |
9552 KB |
Output is correct |
6 |
Correct |
61 ms |
10240 KB |
Output is correct |
7 |
Correct |
17 ms |
3276 KB |
Output is correct |
8 |
Correct |
16 ms |
3508 KB |
Output is correct |
9 |
Correct |
34 ms |
9592 KB |
Output is correct |
10 |
Correct |
36 ms |
8664 KB |
Output is correct |
11 |
Correct |
55 ms |
10064 KB |
Output is correct |
12 |
Correct |
60 ms |
10068 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
716 KB |
Output is correct |
8 |
Correct |
2 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
1 ms |
604 KB |
Output is correct |
22 |
Correct |
2 ms |
600 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
604 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
1 ms |
604 KB |
Output is correct |
29 |
Correct |
1 ms |
604 KB |
Output is correct |
30 |
Correct |
2 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
688 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
2 ms |
604 KB |
Output is correct |
39 |
Correct |
33 ms |
8832 KB |
Output is correct |
40 |
Correct |
36 ms |
9296 KB |
Output is correct |
41 |
Correct |
38 ms |
8780 KB |
Output is correct |
42 |
Correct |
40 ms |
8784 KB |
Output is correct |
43 |
Correct |
38 ms |
9340 KB |
Output is correct |
44 |
Correct |
38 ms |
9300 KB |
Output is correct |
45 |
Correct |
19 ms |
2828 KB |
Output is correct |
46 |
Correct |
13 ms |
2828 KB |
Output is correct |
47 |
Correct |
39 ms |
8868 KB |
Output is correct |
48 |
Correct |
42 ms |
9020 KB |
Output is correct |
49 |
Correct |
39 ms |
9040 KB |
Output is correct |
50 |
Correct |
38 ms |
9044 KB |
Output is correct |
51 |
Correct |
35 ms |
8144 KB |
Output is correct |
52 |
Correct |
40 ms |
9752 KB |
Output is correct |
53 |
Correct |
54 ms |
9228 KB |
Output is correct |
54 |
Correct |
43 ms |
10320 KB |
Output is correct |
55 |
Correct |
60 ms |
8788 KB |
Output is correct |
56 |
Correct |
47 ms |
8528 KB |
Output is correct |
57 |
Correct |
12 ms |
2600 KB |
Output is correct |
58 |
Correct |
13 ms |
2928 KB |
Output is correct |
59 |
Correct |
62 ms |
9252 KB |
Output is correct |
60 |
Correct |
61 ms |
9300 KB |
Output is correct |
61 |
Correct |
55 ms |
9320 KB |
Output is correct |
62 |
Correct |
51 ms |
9424 KB |
Output is correct |
63 |
Correct |
51 ms |
9296 KB |
Output is correct |
64 |
Correct |
52 ms |
9300 KB |
Output is correct |
65 |
Correct |
27 ms |
8832 KB |
Output is correct |
66 |
Correct |
47 ms |
9300 KB |
Output is correct |
67 |
Correct |
36 ms |
7256 KB |
Output is correct |
68 |
Correct |
44 ms |
8796 KB |
Output is correct |
69 |
Correct |
62 ms |
9408 KB |
Output is correct |
70 |
Correct |
51 ms |
9356 KB |
Output is correct |
71 |
Correct |
30 ms |
9048 KB |
Output is correct |
72 |
Correct |
38 ms |
10468 KB |
Output is correct |
73 |
Correct |
57 ms |
9764 KB |
Output is correct |
74 |
Correct |
59 ms |
9548 KB |
Output is correct |
75 |
Correct |
68 ms |
10396 KB |
Output is correct |
76 |
Correct |
44 ms |
8788 KB |
Output is correct |
77 |
Correct |
56 ms |
9552 KB |
Output is correct |
78 |
Correct |
61 ms |
10240 KB |
Output is correct |
79 |
Correct |
17 ms |
3276 KB |
Output is correct |
80 |
Correct |
16 ms |
3508 KB |
Output is correct |
81 |
Correct |
34 ms |
9592 KB |
Output is correct |
82 |
Correct |
36 ms |
8664 KB |
Output is correct |
83 |
Correct |
55 ms |
10064 KB |
Output is correct |
84 |
Correct |
60 ms |
10068 KB |
Output is correct |
85 |
Correct |
48 ms |
8276 KB |
Output is correct |
86 |
Correct |
56 ms |
9300 KB |
Output is correct |
87 |
Correct |
53 ms |
9040 KB |
Output is correct |
88 |
Correct |
63 ms |
9808 KB |
Output is correct |
89 |
Correct |
37 ms |
7504 KB |
Output is correct |
90 |
Correct |
55 ms |
9300 KB |
Output is correct |
91 |
Correct |
51 ms |
7508 KB |
Output is correct |
92 |
Correct |
44 ms |
7504 KB |
Output is correct |
93 |
Correct |
60 ms |
9300 KB |
Output is correct |
94 |
Correct |
57 ms |
9384 KB |
Output is correct |
95 |
Correct |
55 ms |
9044 KB |
Output is correct |
96 |
Correct |
59 ms |
9276 KB |
Output is correct |
97 |
Correct |
60 ms |
9260 KB |
Output is correct |
98 |
Correct |
48 ms |
7764 KB |
Output is correct |
99 |
Correct |
35 ms |
8816 KB |
Output is correct |
100 |
Correct |
44 ms |
8276 KB |
Output is correct |
101 |
Correct |
54 ms |
9692 KB |
Output is correct |
102 |
Correct |
44 ms |
10088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
716 KB |
Output is correct |
8 |
Correct |
2 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
1 ms |
604 KB |
Output is correct |
22 |
Correct |
2 ms |
600 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
604 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
1 ms |
604 KB |
Output is correct |
29 |
Correct |
1 ms |
604 KB |
Output is correct |
30 |
Correct |
2 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
688 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
2 ms |
604 KB |
Output is correct |
39 |
Correct |
33 ms |
8832 KB |
Output is correct |
40 |
Correct |
36 ms |
9296 KB |
Output is correct |
41 |
Correct |
38 ms |
8780 KB |
Output is correct |
42 |
Correct |
40 ms |
8784 KB |
Output is correct |
43 |
Correct |
38 ms |
9340 KB |
Output is correct |
44 |
Correct |
38 ms |
9300 KB |
Output is correct |
45 |
Correct |
19 ms |
2828 KB |
Output is correct |
46 |
Correct |
13 ms |
2828 KB |
Output is correct |
47 |
Correct |
39 ms |
8868 KB |
Output is correct |
48 |
Correct |
42 ms |
9020 KB |
Output is correct |
49 |
Correct |
39 ms |
9040 KB |
Output is correct |
50 |
Correct |
38 ms |
9044 KB |
Output is correct |
51 |
Correct |
35 ms |
8144 KB |
Output is correct |
52 |
Correct |
40 ms |
9752 KB |
Output is correct |
53 |
Correct |
54 ms |
9228 KB |
Output is correct |
54 |
Correct |
43 ms |
10320 KB |
Output is correct |
55 |
Correct |
265 ms |
32852 KB |
Output is correct |
56 |
Correct |
178 ms |
28752 KB |
Output is correct |
57 |
Correct |
285 ms |
35244 KB |
Output is correct |
58 |
Correct |
211 ms |
32592 KB |
Output is correct |
59 |
Correct |
215 ms |
29476 KB |
Output is correct |
60 |
Correct |
301 ms |
36504 KB |
Output is correct |
61 |
Correct |
56 ms |
10676 KB |
Output is correct |
62 |
Correct |
61 ms |
11016 KB |
Output is correct |
63 |
Correct |
258 ms |
38224 KB |
Output is correct |
64 |
Correct |
299 ms |
38160 KB |
Output is correct |
65 |
Correct |
250 ms |
35152 KB |
Output is correct |
66 |
Correct |
254 ms |
35060 KB |
Output is correct |
67 |
Correct |
261 ms |
35100 KB |
Output is correct |
68 |
Correct |
287 ms |
35404 KB |
Output is correct |
69 |
Correct |
256 ms |
35164 KB |
Output is correct |
70 |
Correct |
261 ms |
35000 KB |
Output is correct |
71 |
Correct |
274 ms |
35152 KB |
Output is correct |
72 |
Correct |
283 ms |
35292 KB |
Output is correct |
73 |
Correct |
287 ms |
35116 KB |
Output is correct |
74 |
Correct |
256 ms |
35152 KB |
Output is correct |
75 |
Correct |
269 ms |
35016 KB |
Output is correct |
76 |
Correct |
277 ms |
35152 KB |
Output is correct |
77 |
Correct |
277 ms |
35120 KB |
Output is correct |
78 |
Correct |
300 ms |
35096 KB |
Output is correct |
79 |
Correct |
201 ms |
31684 KB |
Output is correct |
80 |
Correct |
212 ms |
35112 KB |
Output is correct |
81 |
Correct |
182 ms |
37968 KB |
Output is correct |
82 |
Correct |
60 ms |
8788 KB |
Output is correct |
83 |
Correct |
47 ms |
8528 KB |
Output is correct |
84 |
Correct |
12 ms |
2600 KB |
Output is correct |
85 |
Correct |
13 ms |
2928 KB |
Output is correct |
86 |
Correct |
62 ms |
9252 KB |
Output is correct |
87 |
Correct |
61 ms |
9300 KB |
Output is correct |
88 |
Correct |
55 ms |
9320 KB |
Output is correct |
89 |
Correct |
51 ms |
9424 KB |
Output is correct |
90 |
Correct |
51 ms |
9296 KB |
Output is correct |
91 |
Correct |
52 ms |
9300 KB |
Output is correct |
92 |
Correct |
27 ms |
8832 KB |
Output is correct |
93 |
Correct |
47 ms |
9300 KB |
Output is correct |
94 |
Correct |
36 ms |
7256 KB |
Output is correct |
95 |
Correct |
44 ms |
8796 KB |
Output is correct |
96 |
Correct |
62 ms |
9408 KB |
Output is correct |
97 |
Correct |
51 ms |
9356 KB |
Output is correct |
98 |
Correct |
30 ms |
9048 KB |
Output is correct |
99 |
Correct |
38 ms |
10468 KB |
Output is correct |
100 |
Correct |
57 ms |
9764 KB |
Output is correct |
101 |
Correct |
59 ms |
9548 KB |
Output is correct |
102 |
Correct |
68 ms |
10396 KB |
Output is correct |
103 |
Correct |
44 ms |
8788 KB |
Output is correct |
104 |
Correct |
56 ms |
9552 KB |
Output is correct |
105 |
Correct |
61 ms |
10240 KB |
Output is correct |
106 |
Correct |
17 ms |
3276 KB |
Output is correct |
107 |
Correct |
16 ms |
3508 KB |
Output is correct |
108 |
Correct |
34 ms |
9592 KB |
Output is correct |
109 |
Correct |
36 ms |
8664 KB |
Output is correct |
110 |
Correct |
55 ms |
10064 KB |
Output is correct |
111 |
Correct |
60 ms |
10068 KB |
Output is correct |
112 |
Correct |
48 ms |
8276 KB |
Output is correct |
113 |
Correct |
56 ms |
9300 KB |
Output is correct |
114 |
Correct |
53 ms |
9040 KB |
Output is correct |
115 |
Correct |
63 ms |
9808 KB |
Output is correct |
116 |
Correct |
37 ms |
7504 KB |
Output is correct |
117 |
Correct |
55 ms |
9300 KB |
Output is correct |
118 |
Correct |
51 ms |
7508 KB |
Output is correct |
119 |
Correct |
44 ms |
7504 KB |
Output is correct |
120 |
Correct |
60 ms |
9300 KB |
Output is correct |
121 |
Correct |
57 ms |
9384 KB |
Output is correct |
122 |
Correct |
55 ms |
9044 KB |
Output is correct |
123 |
Correct |
59 ms |
9276 KB |
Output is correct |
124 |
Correct |
60 ms |
9260 KB |
Output is correct |
125 |
Correct |
48 ms |
7764 KB |
Output is correct |
126 |
Correct |
35 ms |
8816 KB |
Output is correct |
127 |
Correct |
44 ms |
8276 KB |
Output is correct |
128 |
Correct |
54 ms |
9692 KB |
Output is correct |
129 |
Correct |
44 ms |
10088 KB |
Output is correct |
130 |
Correct |
284 ms |
35092 KB |
Output is correct |
131 |
Correct |
205 ms |
28284 KB |
Output is correct |
132 |
Correct |
301 ms |
35464 KB |
Output is correct |
133 |
Correct |
288 ms |
35764 KB |
Output is correct |
134 |
Correct |
255 ms |
34128 KB |
Output is correct |
135 |
Correct |
287 ms |
36876 KB |
Output is correct |
136 |
Correct |
314 ms |
38908 KB |
Output is correct |
137 |
Correct |
299 ms |
38736 KB |
Output is correct |
138 |
Correct |
264 ms |
35408 KB |
Output is correct |
139 |
Correct |
289 ms |
35332 KB |
Output is correct |
140 |
Correct |
263 ms |
35168 KB |
Output is correct |
141 |
Correct |
290 ms |
35264 KB |
Output is correct |
142 |
Correct |
305 ms |
35412 KB |
Output is correct |
143 |
Correct |
292 ms |
35188 KB |
Output is correct |
144 |
Correct |
273 ms |
35412 KB |
Output is correct |
145 |
Correct |
264 ms |
35408 KB |
Output is correct |
146 |
Correct |
315 ms |
35404 KB |
Output is correct |
147 |
Correct |
289 ms |
35212 KB |
Output is correct |
148 |
Correct |
290 ms |
35212 KB |
Output is correct |
149 |
Correct |
263 ms |
35408 KB |
Output is correct |
150 |
Correct |
117 ms |
33376 KB |
Output is correct |
151 |
Correct |
242 ms |
35376 KB |
Output is correct |
152 |
Correct |
229 ms |
35412 KB |
Output is correct |
153 |
Correct |
194 ms |
38144 KB |
Output is correct |