#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 250010;
const int INF = INT_MAX;
const int mod = 1e9+7;
const string NAME = "solve";
int n,m,q;
vector<pair<int,ll>> adj[N],events_bit[N],events_seg[N];
int ans[N];
int gr[N];
struct Fenwick{
ll bit[N];
void update(int idx, ll val) {
for(; idx < N; idx += (idx & (-idx))) {
bit[idx] += val;
}
}
ll get(int idx) {
ll res = 0;
for(; idx > 0; idx -= (idx & (-idx))) {
res += bit[idx];
}
return res;
}
int walk(ll val) {
int res = 0;
for(int i = 18 ; i >= 0 ; i--) {
if(res+(1<<i) < N and bit[res+(1<<i)] < val) {
val -= bit[res+(1<<i)];
res += (1<<i);
}
}
return res+1;
}
}bit;
struct Segment{
struct Node{
ll cur = 0;
ll sum = 0;
Node() {};
Node(ll _cur, ll _sum) { cur = _cur; sum = _sum; };
Node operator + (const Node& other) {
return Node(max(this -> cur+other.sum,other.cur),this -> sum+other.sum);
}
}tree[4*N];
void update(int pos, ll val, int id = 1, int l = 1, int r = N-10) {
if(l == r) {
tree[id] = Node(max(0LL,val),val);
return;
}
int mid = l + r >> 1;
if(pos <= mid) {
update(pos,val,id << 1,l,mid);
}
else {
update(pos,val,id << 1 | 1,mid+1,r);
}
tree[id] = tree[id << 1] + tree[id << 1 | 1];
}
Node get(int u, int v, int id = 1, int l = 1, int r = N-10) {
if(r < u or v < l) {
return Node(0,0);
}
if(u <= l and r <= v) {
return tree[id];
}
int mid = l + r >> 1;
return get(u,v,id << 1,l,mid) + get(u,v,id << 1 | 1,mid+1,r);
}
}tree;
signed main()
{
if (fopen((NAME + ".inp").c_str(), "r")) {
freopen((NAME + ".inp").c_str(), "r", stdin);
freopen((NAME + ".out").c_str(), "w", stdout);
}
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m >> q;
for(int i = 1 ; i <= q ; i++) {
int type; cin >> type;
if(type == 1) {
int l,r,c;
ll k; cin >> l >> r >> c >> k;
events_seg[l].push_back({i,k});
events_bit[l].push_back({i,k});
events_seg[r+1].push_back({i,0});
events_bit[r+1].push_back({i,-k});
gr[i] = c;
}
else if(type == 2) {
int l,r;
ll k; cin >> l >> r >> k;
events_seg[l].push_back({i,-k});
events_seg[r+1].push_back({i,0});
}
else {
int a;
ll b; cin >> a >> b;
adj[a].push_back({i,b});
}
}
for(int i = 1 ; i <= q ; i++) {
ans[i] = -1;
}
for(int i = 1 ; i <= n ; i++) {
for(auto p:events_seg[i]) {
tree.update(p.first,p.second);
}
for(auto p:events_bit[i]) {
bit.update(p.first,p.second);
}
for(auto p:adj[i]) {
auto s = tree.get(1,p.first);
if(p.second <= s.cur) {
ll Real = bit.get(p.first) - (s.cur - p.second);
ans[p.first] = gr[bit.walk(Real)];
}
else {
ans[p.first] = 0;
}
}
}
for(int i = 1 ; i <= q ; i++) {
if(ans[i] != -1) {
cout << ans[i] << '\n';
}
}
return 0;
}
Compilation message
foodcourt.cpp: In member function 'void Segment::update(int, long long int, int, int, int)':
foodcourt.cpp:63:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
63 | int mid = l + r >> 1;
| ~~^~~
foodcourt.cpp: In member function 'Segment::Node Segment::get(int, int, int, int, int)':
foodcourt.cpp:80:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
80 | int mid = l + r >> 1;
| ~~^~~
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:89:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
89 | freopen((NAME + ".inp").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:90:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
90 | freopen((NAME + ".out").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
37724 KB |
Output is correct |
2 |
Correct |
10 ms |
37608 KB |
Output is correct |
3 |
Correct |
8 ms |
37724 KB |
Output is correct |
4 |
Correct |
9 ms |
37724 KB |
Output is correct |
5 |
Correct |
8 ms |
37724 KB |
Output is correct |
6 |
Correct |
8 ms |
37720 KB |
Output is correct |
7 |
Correct |
8 ms |
37720 KB |
Output is correct |
8 |
Correct |
9 ms |
37724 KB |
Output is correct |
9 |
Correct |
10 ms |
37724 KB |
Output is correct |
10 |
Correct |
8 ms |
37724 KB |
Output is correct |
11 |
Correct |
10 ms |
37808 KB |
Output is correct |
12 |
Correct |
9 ms |
37720 KB |
Output is correct |
13 |
Correct |
8 ms |
37720 KB |
Output is correct |
14 |
Correct |
8 ms |
37720 KB |
Output is correct |
15 |
Correct |
9 ms |
37724 KB |
Output is correct |
16 |
Correct |
10 ms |
37720 KB |
Output is correct |
17 |
Correct |
9 ms |
37720 KB |
Output is correct |
18 |
Correct |
10 ms |
37724 KB |
Output is correct |
19 |
Correct |
8 ms |
37720 KB |
Output is correct |
20 |
Correct |
8 ms |
37724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
37724 KB |
Output is correct |
2 |
Correct |
10 ms |
37608 KB |
Output is correct |
3 |
Correct |
8 ms |
37724 KB |
Output is correct |
4 |
Correct |
9 ms |
37724 KB |
Output is correct |
5 |
Correct |
8 ms |
37724 KB |
Output is correct |
6 |
Correct |
8 ms |
37720 KB |
Output is correct |
7 |
Correct |
8 ms |
37720 KB |
Output is correct |
8 |
Correct |
9 ms |
37724 KB |
Output is correct |
9 |
Correct |
10 ms |
37724 KB |
Output is correct |
10 |
Correct |
8 ms |
37724 KB |
Output is correct |
11 |
Correct |
10 ms |
37808 KB |
Output is correct |
12 |
Correct |
9 ms |
37720 KB |
Output is correct |
13 |
Correct |
8 ms |
37720 KB |
Output is correct |
14 |
Correct |
8 ms |
37720 KB |
Output is correct |
15 |
Correct |
9 ms |
37724 KB |
Output is correct |
16 |
Correct |
10 ms |
37720 KB |
Output is correct |
17 |
Correct |
9 ms |
37720 KB |
Output is correct |
18 |
Correct |
10 ms |
37724 KB |
Output is correct |
19 |
Correct |
8 ms |
37720 KB |
Output is correct |
20 |
Correct |
8 ms |
37724 KB |
Output is correct |
21 |
Correct |
9 ms |
37656 KB |
Output is correct |
22 |
Correct |
10 ms |
37720 KB |
Output is correct |
23 |
Correct |
9 ms |
37728 KB |
Output is correct |
24 |
Correct |
9 ms |
37724 KB |
Output is correct |
25 |
Correct |
8 ms |
37724 KB |
Output is correct |
26 |
Correct |
8 ms |
37724 KB |
Output is correct |
27 |
Correct |
9 ms |
37724 KB |
Output is correct |
28 |
Correct |
9 ms |
37720 KB |
Output is correct |
29 |
Correct |
8 ms |
37720 KB |
Output is correct |
30 |
Correct |
8 ms |
37724 KB |
Output is correct |
31 |
Correct |
8 ms |
37724 KB |
Output is correct |
32 |
Correct |
9 ms |
37652 KB |
Output is correct |
33 |
Correct |
8 ms |
37720 KB |
Output is correct |
34 |
Correct |
8 ms |
37612 KB |
Output is correct |
35 |
Correct |
8 ms |
37720 KB |
Output is correct |
36 |
Correct |
8 ms |
37724 KB |
Output is correct |
37 |
Correct |
8 ms |
37756 KB |
Output is correct |
38 |
Correct |
8 ms |
37724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
67 ms |
42952 KB |
Output is correct |
2 |
Correct |
64 ms |
43576 KB |
Output is correct |
3 |
Correct |
52 ms |
42836 KB |
Output is correct |
4 |
Correct |
50 ms |
42832 KB |
Output is correct |
5 |
Correct |
54 ms |
43484 KB |
Output is correct |
6 |
Correct |
55 ms |
43604 KB |
Output is correct |
7 |
Correct |
27 ms |
40880 KB |
Output is correct |
8 |
Correct |
28 ms |
41396 KB |
Output is correct |
9 |
Correct |
52 ms |
43176 KB |
Output is correct |
10 |
Correct |
52 ms |
42988 KB |
Output is correct |
11 |
Correct |
59 ms |
43344 KB |
Output is correct |
12 |
Correct |
58 ms |
43096 KB |
Output is correct |
13 |
Correct |
50 ms |
42736 KB |
Output is correct |
14 |
Correct |
61 ms |
43348 KB |
Output is correct |
15 |
Correct |
62 ms |
44540 KB |
Output is correct |
16 |
Correct |
68 ms |
44628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
315 ms |
57376 KB |
Output is correct |
2 |
Correct |
268 ms |
53576 KB |
Output is correct |
3 |
Correct |
322 ms |
59248 KB |
Output is correct |
4 |
Correct |
258 ms |
55492 KB |
Output is correct |
5 |
Correct |
265 ms |
55600 KB |
Output is correct |
6 |
Correct |
376 ms |
62000 KB |
Output is correct |
7 |
Correct |
110 ms |
56116 KB |
Output is correct |
8 |
Correct |
115 ms |
53384 KB |
Output is correct |
9 |
Correct |
328 ms |
60612 KB |
Output is correct |
10 |
Correct |
332 ms |
60720 KB |
Output is correct |
11 |
Correct |
322 ms |
60244 KB |
Output is correct |
12 |
Correct |
320 ms |
60272 KB |
Output is correct |
13 |
Correct |
326 ms |
60328 KB |
Output is correct |
14 |
Correct |
316 ms |
60240 KB |
Output is correct |
15 |
Correct |
336 ms |
60244 KB |
Output is correct |
16 |
Correct |
337 ms |
60152 KB |
Output is correct |
17 |
Correct |
358 ms |
60048 KB |
Output is correct |
18 |
Correct |
382 ms |
60240 KB |
Output is correct |
19 |
Correct |
378 ms |
60540 KB |
Output is correct |
20 |
Correct |
339 ms |
60244 KB |
Output is correct |
21 |
Correct |
342 ms |
60188 KB |
Output is correct |
22 |
Correct |
331 ms |
60228 KB |
Output is correct |
23 |
Correct |
346 ms |
60184 KB |
Output is correct |
24 |
Correct |
324 ms |
60240 KB |
Output is correct |
25 |
Correct |
204 ms |
58708 KB |
Output is correct |
26 |
Correct |
209 ms |
59220 KB |
Output is correct |
27 |
Correct |
268 ms |
64008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
37724 KB |
Output is correct |
2 |
Correct |
10 ms |
37608 KB |
Output is correct |
3 |
Correct |
8 ms |
37724 KB |
Output is correct |
4 |
Correct |
9 ms |
37724 KB |
Output is correct |
5 |
Correct |
8 ms |
37724 KB |
Output is correct |
6 |
Correct |
8 ms |
37720 KB |
Output is correct |
7 |
Correct |
8 ms |
37720 KB |
Output is correct |
8 |
Correct |
9 ms |
37724 KB |
Output is correct |
9 |
Correct |
10 ms |
37724 KB |
Output is correct |
10 |
Correct |
8 ms |
37724 KB |
Output is correct |
11 |
Correct |
10 ms |
37808 KB |
Output is correct |
12 |
Correct |
9 ms |
37720 KB |
Output is correct |
13 |
Correct |
8 ms |
37720 KB |
Output is correct |
14 |
Correct |
8 ms |
37720 KB |
Output is correct |
15 |
Correct |
9 ms |
37724 KB |
Output is correct |
16 |
Correct |
10 ms |
37720 KB |
Output is correct |
17 |
Correct |
9 ms |
37720 KB |
Output is correct |
18 |
Correct |
10 ms |
37724 KB |
Output is correct |
19 |
Correct |
8 ms |
37720 KB |
Output is correct |
20 |
Correct |
8 ms |
37724 KB |
Output is correct |
21 |
Correct |
67 ms |
42952 KB |
Output is correct |
22 |
Correct |
64 ms |
43576 KB |
Output is correct |
23 |
Correct |
52 ms |
42836 KB |
Output is correct |
24 |
Correct |
50 ms |
42832 KB |
Output is correct |
25 |
Correct |
54 ms |
43484 KB |
Output is correct |
26 |
Correct |
55 ms |
43604 KB |
Output is correct |
27 |
Correct |
27 ms |
40880 KB |
Output is correct |
28 |
Correct |
28 ms |
41396 KB |
Output is correct |
29 |
Correct |
52 ms |
43176 KB |
Output is correct |
30 |
Correct |
52 ms |
42988 KB |
Output is correct |
31 |
Correct |
59 ms |
43344 KB |
Output is correct |
32 |
Correct |
58 ms |
43096 KB |
Output is correct |
33 |
Correct |
50 ms |
42736 KB |
Output is correct |
34 |
Correct |
61 ms |
43348 KB |
Output is correct |
35 |
Correct |
62 ms |
44540 KB |
Output is correct |
36 |
Correct |
68 ms |
44628 KB |
Output is correct |
37 |
Correct |
53 ms |
42072 KB |
Output is correct |
38 |
Correct |
46 ms |
42244 KB |
Output is correct |
39 |
Correct |
24 ms |
40800 KB |
Output is correct |
40 |
Correct |
29 ms |
41472 KB |
Output is correct |
41 |
Correct |
79 ms |
43092 KB |
Output is correct |
42 |
Correct |
60 ms |
42912 KB |
Output is correct |
43 |
Correct |
58 ms |
43064 KB |
Output is correct |
44 |
Correct |
54 ms |
43084 KB |
Output is correct |
45 |
Correct |
57 ms |
43064 KB |
Output is correct |
46 |
Correct |
55 ms |
42896 KB |
Output is correct |
47 |
Correct |
36 ms |
41528 KB |
Output is correct |
48 |
Correct |
46 ms |
42704 KB |
Output is correct |
49 |
Correct |
40 ms |
41308 KB |
Output is correct |
50 |
Correct |
52 ms |
42320 KB |
Output is correct |
51 |
Correct |
58 ms |
43128 KB |
Output is correct |
52 |
Correct |
55 ms |
43092 KB |
Output is correct |
53 |
Correct |
45 ms |
43096 KB |
Output is correct |
54 |
Correct |
58 ms |
44628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
43020 KB |
Output is correct |
2 |
Correct |
57 ms |
43604 KB |
Output is correct |
3 |
Correct |
66 ms |
43668 KB |
Output is correct |
4 |
Correct |
44 ms |
41816 KB |
Output is correct |
5 |
Correct |
52 ms |
42844 KB |
Output is correct |
6 |
Correct |
60 ms |
43612 KB |
Output is correct |
7 |
Correct |
31 ms |
41268 KB |
Output is correct |
8 |
Correct |
30 ms |
41024 KB |
Output is correct |
9 |
Correct |
42 ms |
42128 KB |
Output is correct |
10 |
Correct |
37 ms |
41552 KB |
Output is correct |
11 |
Correct |
51 ms |
42836 KB |
Output is correct |
12 |
Correct |
51 ms |
43092 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
37724 KB |
Output is correct |
2 |
Correct |
10 ms |
37608 KB |
Output is correct |
3 |
Correct |
8 ms |
37724 KB |
Output is correct |
4 |
Correct |
9 ms |
37724 KB |
Output is correct |
5 |
Correct |
8 ms |
37724 KB |
Output is correct |
6 |
Correct |
8 ms |
37720 KB |
Output is correct |
7 |
Correct |
8 ms |
37720 KB |
Output is correct |
8 |
Correct |
9 ms |
37724 KB |
Output is correct |
9 |
Correct |
10 ms |
37724 KB |
Output is correct |
10 |
Correct |
8 ms |
37724 KB |
Output is correct |
11 |
Correct |
10 ms |
37808 KB |
Output is correct |
12 |
Correct |
9 ms |
37720 KB |
Output is correct |
13 |
Correct |
8 ms |
37720 KB |
Output is correct |
14 |
Correct |
8 ms |
37720 KB |
Output is correct |
15 |
Correct |
9 ms |
37724 KB |
Output is correct |
16 |
Correct |
10 ms |
37720 KB |
Output is correct |
17 |
Correct |
9 ms |
37720 KB |
Output is correct |
18 |
Correct |
10 ms |
37724 KB |
Output is correct |
19 |
Correct |
8 ms |
37720 KB |
Output is correct |
20 |
Correct |
8 ms |
37724 KB |
Output is correct |
21 |
Correct |
9 ms |
37656 KB |
Output is correct |
22 |
Correct |
10 ms |
37720 KB |
Output is correct |
23 |
Correct |
9 ms |
37728 KB |
Output is correct |
24 |
Correct |
9 ms |
37724 KB |
Output is correct |
25 |
Correct |
8 ms |
37724 KB |
Output is correct |
26 |
Correct |
8 ms |
37724 KB |
Output is correct |
27 |
Correct |
9 ms |
37724 KB |
Output is correct |
28 |
Correct |
9 ms |
37720 KB |
Output is correct |
29 |
Correct |
8 ms |
37720 KB |
Output is correct |
30 |
Correct |
8 ms |
37724 KB |
Output is correct |
31 |
Correct |
8 ms |
37724 KB |
Output is correct |
32 |
Correct |
9 ms |
37652 KB |
Output is correct |
33 |
Correct |
8 ms |
37720 KB |
Output is correct |
34 |
Correct |
8 ms |
37612 KB |
Output is correct |
35 |
Correct |
8 ms |
37720 KB |
Output is correct |
36 |
Correct |
8 ms |
37724 KB |
Output is correct |
37 |
Correct |
8 ms |
37756 KB |
Output is correct |
38 |
Correct |
8 ms |
37724 KB |
Output is correct |
39 |
Correct |
67 ms |
42952 KB |
Output is correct |
40 |
Correct |
64 ms |
43576 KB |
Output is correct |
41 |
Correct |
52 ms |
42836 KB |
Output is correct |
42 |
Correct |
50 ms |
42832 KB |
Output is correct |
43 |
Correct |
54 ms |
43484 KB |
Output is correct |
44 |
Correct |
55 ms |
43604 KB |
Output is correct |
45 |
Correct |
27 ms |
40880 KB |
Output is correct |
46 |
Correct |
28 ms |
41396 KB |
Output is correct |
47 |
Correct |
52 ms |
43176 KB |
Output is correct |
48 |
Correct |
52 ms |
42988 KB |
Output is correct |
49 |
Correct |
59 ms |
43344 KB |
Output is correct |
50 |
Correct |
58 ms |
43096 KB |
Output is correct |
51 |
Correct |
50 ms |
42736 KB |
Output is correct |
52 |
Correct |
61 ms |
43348 KB |
Output is correct |
53 |
Correct |
62 ms |
44540 KB |
Output is correct |
54 |
Correct |
68 ms |
44628 KB |
Output is correct |
55 |
Correct |
53 ms |
42072 KB |
Output is correct |
56 |
Correct |
46 ms |
42244 KB |
Output is correct |
57 |
Correct |
24 ms |
40800 KB |
Output is correct |
58 |
Correct |
29 ms |
41472 KB |
Output is correct |
59 |
Correct |
79 ms |
43092 KB |
Output is correct |
60 |
Correct |
60 ms |
42912 KB |
Output is correct |
61 |
Correct |
58 ms |
43064 KB |
Output is correct |
62 |
Correct |
54 ms |
43084 KB |
Output is correct |
63 |
Correct |
57 ms |
43064 KB |
Output is correct |
64 |
Correct |
55 ms |
42896 KB |
Output is correct |
65 |
Correct |
36 ms |
41528 KB |
Output is correct |
66 |
Correct |
46 ms |
42704 KB |
Output is correct |
67 |
Correct |
40 ms |
41308 KB |
Output is correct |
68 |
Correct |
52 ms |
42320 KB |
Output is correct |
69 |
Correct |
58 ms |
43128 KB |
Output is correct |
70 |
Correct |
55 ms |
43092 KB |
Output is correct |
71 |
Correct |
45 ms |
43096 KB |
Output is correct |
72 |
Correct |
58 ms |
44628 KB |
Output is correct |
73 |
Correct |
52 ms |
43020 KB |
Output is correct |
74 |
Correct |
57 ms |
43604 KB |
Output is correct |
75 |
Correct |
66 ms |
43668 KB |
Output is correct |
76 |
Correct |
44 ms |
41816 KB |
Output is correct |
77 |
Correct |
52 ms |
42844 KB |
Output is correct |
78 |
Correct |
60 ms |
43612 KB |
Output is correct |
79 |
Correct |
31 ms |
41268 KB |
Output is correct |
80 |
Correct |
30 ms |
41024 KB |
Output is correct |
81 |
Correct |
42 ms |
42128 KB |
Output is correct |
82 |
Correct |
37 ms |
41552 KB |
Output is correct |
83 |
Correct |
51 ms |
42836 KB |
Output is correct |
84 |
Correct |
51 ms |
43092 KB |
Output is correct |
85 |
Correct |
52 ms |
42692 KB |
Output is correct |
86 |
Correct |
59 ms |
43348 KB |
Output is correct |
87 |
Correct |
55 ms |
43092 KB |
Output is correct |
88 |
Correct |
72 ms |
44064 KB |
Output is correct |
89 |
Correct |
42 ms |
41564 KB |
Output is correct |
90 |
Correct |
63 ms |
43604 KB |
Output is correct |
91 |
Correct |
47 ms |
42324 KB |
Output is correct |
92 |
Correct |
47 ms |
42040 KB |
Output is correct |
93 |
Correct |
58 ms |
43496 KB |
Output is correct |
94 |
Correct |
55 ms |
43352 KB |
Output is correct |
95 |
Correct |
58 ms |
43276 KB |
Output is correct |
96 |
Correct |
57 ms |
43348 KB |
Output is correct |
97 |
Correct |
58 ms |
43344 KB |
Output is correct |
98 |
Correct |
49 ms |
42592 KB |
Output is correct |
99 |
Correct |
36 ms |
41656 KB |
Output is correct |
100 |
Correct |
40 ms |
41816 KB |
Output is correct |
101 |
Correct |
48 ms |
43136 KB |
Output is correct |
102 |
Correct |
53 ms |
44632 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
37724 KB |
Output is correct |
2 |
Correct |
10 ms |
37608 KB |
Output is correct |
3 |
Correct |
8 ms |
37724 KB |
Output is correct |
4 |
Correct |
9 ms |
37724 KB |
Output is correct |
5 |
Correct |
8 ms |
37724 KB |
Output is correct |
6 |
Correct |
8 ms |
37720 KB |
Output is correct |
7 |
Correct |
8 ms |
37720 KB |
Output is correct |
8 |
Correct |
9 ms |
37724 KB |
Output is correct |
9 |
Correct |
10 ms |
37724 KB |
Output is correct |
10 |
Correct |
8 ms |
37724 KB |
Output is correct |
11 |
Correct |
10 ms |
37808 KB |
Output is correct |
12 |
Correct |
9 ms |
37720 KB |
Output is correct |
13 |
Correct |
8 ms |
37720 KB |
Output is correct |
14 |
Correct |
8 ms |
37720 KB |
Output is correct |
15 |
Correct |
9 ms |
37724 KB |
Output is correct |
16 |
Correct |
10 ms |
37720 KB |
Output is correct |
17 |
Correct |
9 ms |
37720 KB |
Output is correct |
18 |
Correct |
10 ms |
37724 KB |
Output is correct |
19 |
Correct |
8 ms |
37720 KB |
Output is correct |
20 |
Correct |
8 ms |
37724 KB |
Output is correct |
21 |
Correct |
9 ms |
37656 KB |
Output is correct |
22 |
Correct |
10 ms |
37720 KB |
Output is correct |
23 |
Correct |
9 ms |
37728 KB |
Output is correct |
24 |
Correct |
9 ms |
37724 KB |
Output is correct |
25 |
Correct |
8 ms |
37724 KB |
Output is correct |
26 |
Correct |
8 ms |
37724 KB |
Output is correct |
27 |
Correct |
9 ms |
37724 KB |
Output is correct |
28 |
Correct |
9 ms |
37720 KB |
Output is correct |
29 |
Correct |
8 ms |
37720 KB |
Output is correct |
30 |
Correct |
8 ms |
37724 KB |
Output is correct |
31 |
Correct |
8 ms |
37724 KB |
Output is correct |
32 |
Correct |
9 ms |
37652 KB |
Output is correct |
33 |
Correct |
8 ms |
37720 KB |
Output is correct |
34 |
Correct |
8 ms |
37612 KB |
Output is correct |
35 |
Correct |
8 ms |
37720 KB |
Output is correct |
36 |
Correct |
8 ms |
37724 KB |
Output is correct |
37 |
Correct |
8 ms |
37756 KB |
Output is correct |
38 |
Correct |
8 ms |
37724 KB |
Output is correct |
39 |
Correct |
67 ms |
42952 KB |
Output is correct |
40 |
Correct |
64 ms |
43576 KB |
Output is correct |
41 |
Correct |
52 ms |
42836 KB |
Output is correct |
42 |
Correct |
50 ms |
42832 KB |
Output is correct |
43 |
Correct |
54 ms |
43484 KB |
Output is correct |
44 |
Correct |
55 ms |
43604 KB |
Output is correct |
45 |
Correct |
27 ms |
40880 KB |
Output is correct |
46 |
Correct |
28 ms |
41396 KB |
Output is correct |
47 |
Correct |
52 ms |
43176 KB |
Output is correct |
48 |
Correct |
52 ms |
42988 KB |
Output is correct |
49 |
Correct |
59 ms |
43344 KB |
Output is correct |
50 |
Correct |
58 ms |
43096 KB |
Output is correct |
51 |
Correct |
50 ms |
42736 KB |
Output is correct |
52 |
Correct |
61 ms |
43348 KB |
Output is correct |
53 |
Correct |
62 ms |
44540 KB |
Output is correct |
54 |
Correct |
68 ms |
44628 KB |
Output is correct |
55 |
Correct |
315 ms |
57376 KB |
Output is correct |
56 |
Correct |
268 ms |
53576 KB |
Output is correct |
57 |
Correct |
322 ms |
59248 KB |
Output is correct |
58 |
Correct |
258 ms |
55492 KB |
Output is correct |
59 |
Correct |
265 ms |
55600 KB |
Output is correct |
60 |
Correct |
376 ms |
62000 KB |
Output is correct |
61 |
Correct |
110 ms |
56116 KB |
Output is correct |
62 |
Correct |
115 ms |
53384 KB |
Output is correct |
63 |
Correct |
328 ms |
60612 KB |
Output is correct |
64 |
Correct |
332 ms |
60720 KB |
Output is correct |
65 |
Correct |
322 ms |
60244 KB |
Output is correct |
66 |
Correct |
320 ms |
60272 KB |
Output is correct |
67 |
Correct |
326 ms |
60328 KB |
Output is correct |
68 |
Correct |
316 ms |
60240 KB |
Output is correct |
69 |
Correct |
336 ms |
60244 KB |
Output is correct |
70 |
Correct |
337 ms |
60152 KB |
Output is correct |
71 |
Correct |
358 ms |
60048 KB |
Output is correct |
72 |
Correct |
382 ms |
60240 KB |
Output is correct |
73 |
Correct |
378 ms |
60540 KB |
Output is correct |
74 |
Correct |
339 ms |
60244 KB |
Output is correct |
75 |
Correct |
342 ms |
60188 KB |
Output is correct |
76 |
Correct |
331 ms |
60228 KB |
Output is correct |
77 |
Correct |
346 ms |
60184 KB |
Output is correct |
78 |
Correct |
324 ms |
60240 KB |
Output is correct |
79 |
Correct |
204 ms |
58708 KB |
Output is correct |
80 |
Correct |
209 ms |
59220 KB |
Output is correct |
81 |
Correct |
268 ms |
64008 KB |
Output is correct |
82 |
Correct |
53 ms |
42072 KB |
Output is correct |
83 |
Correct |
46 ms |
42244 KB |
Output is correct |
84 |
Correct |
24 ms |
40800 KB |
Output is correct |
85 |
Correct |
29 ms |
41472 KB |
Output is correct |
86 |
Correct |
79 ms |
43092 KB |
Output is correct |
87 |
Correct |
60 ms |
42912 KB |
Output is correct |
88 |
Correct |
58 ms |
43064 KB |
Output is correct |
89 |
Correct |
54 ms |
43084 KB |
Output is correct |
90 |
Correct |
57 ms |
43064 KB |
Output is correct |
91 |
Correct |
55 ms |
42896 KB |
Output is correct |
92 |
Correct |
36 ms |
41528 KB |
Output is correct |
93 |
Correct |
46 ms |
42704 KB |
Output is correct |
94 |
Correct |
40 ms |
41308 KB |
Output is correct |
95 |
Correct |
52 ms |
42320 KB |
Output is correct |
96 |
Correct |
58 ms |
43128 KB |
Output is correct |
97 |
Correct |
55 ms |
43092 KB |
Output is correct |
98 |
Correct |
45 ms |
43096 KB |
Output is correct |
99 |
Correct |
58 ms |
44628 KB |
Output is correct |
100 |
Correct |
52 ms |
43020 KB |
Output is correct |
101 |
Correct |
57 ms |
43604 KB |
Output is correct |
102 |
Correct |
66 ms |
43668 KB |
Output is correct |
103 |
Correct |
44 ms |
41816 KB |
Output is correct |
104 |
Correct |
52 ms |
42844 KB |
Output is correct |
105 |
Correct |
60 ms |
43612 KB |
Output is correct |
106 |
Correct |
31 ms |
41268 KB |
Output is correct |
107 |
Correct |
30 ms |
41024 KB |
Output is correct |
108 |
Correct |
42 ms |
42128 KB |
Output is correct |
109 |
Correct |
37 ms |
41552 KB |
Output is correct |
110 |
Correct |
51 ms |
42836 KB |
Output is correct |
111 |
Correct |
51 ms |
43092 KB |
Output is correct |
112 |
Correct |
52 ms |
42692 KB |
Output is correct |
113 |
Correct |
59 ms |
43348 KB |
Output is correct |
114 |
Correct |
55 ms |
43092 KB |
Output is correct |
115 |
Correct |
72 ms |
44064 KB |
Output is correct |
116 |
Correct |
42 ms |
41564 KB |
Output is correct |
117 |
Correct |
63 ms |
43604 KB |
Output is correct |
118 |
Correct |
47 ms |
42324 KB |
Output is correct |
119 |
Correct |
47 ms |
42040 KB |
Output is correct |
120 |
Correct |
58 ms |
43496 KB |
Output is correct |
121 |
Correct |
55 ms |
43352 KB |
Output is correct |
122 |
Correct |
58 ms |
43276 KB |
Output is correct |
123 |
Correct |
57 ms |
43348 KB |
Output is correct |
124 |
Correct |
58 ms |
43344 KB |
Output is correct |
125 |
Correct |
49 ms |
42592 KB |
Output is correct |
126 |
Correct |
36 ms |
41656 KB |
Output is correct |
127 |
Correct |
40 ms |
41816 KB |
Output is correct |
128 |
Correct |
48 ms |
43136 KB |
Output is correct |
129 |
Correct |
53 ms |
44632 KB |
Output is correct |
130 |
Correct |
310 ms |
59824 KB |
Output is correct |
131 |
Correct |
225 ms |
53832 KB |
Output is correct |
132 |
Correct |
302 ms |
59732 KB |
Output is correct |
133 |
Correct |
302 ms |
61776 KB |
Output is correct |
134 |
Correct |
271 ms |
58964 KB |
Output is correct |
135 |
Correct |
331 ms |
62712 KB |
Output is correct |
136 |
Correct |
329 ms |
61520 KB |
Output is correct |
137 |
Correct |
327 ms |
61504 KB |
Output is correct |
138 |
Correct |
295 ms |
61012 KB |
Output is correct |
139 |
Correct |
332 ms |
60940 KB |
Output is correct |
140 |
Correct |
301 ms |
60756 KB |
Output is correct |
141 |
Correct |
306 ms |
60756 KB |
Output is correct |
142 |
Correct |
310 ms |
60848 KB |
Output is correct |
143 |
Correct |
332 ms |
60656 KB |
Output is correct |
144 |
Correct |
337 ms |
60888 KB |
Output is correct |
145 |
Correct |
308 ms |
60864 KB |
Output is correct |
146 |
Correct |
335 ms |
60840 KB |
Output is correct |
147 |
Correct |
307 ms |
60760 KB |
Output is correct |
148 |
Correct |
348 ms |
61276 KB |
Output is correct |
149 |
Correct |
318 ms |
60756 KB |
Output is correct |
150 |
Correct |
144 ms |
56208 KB |
Output is correct |
151 |
Correct |
202 ms |
59736 KB |
Output is correct |
152 |
Correct |
207 ms |
59912 KB |
Output is correct |
153 |
Correct |
253 ms |
64988 KB |
Output is correct |