#include <bits/stdc++.h>
using namespace std;
#define int long long
#define dbg(x) "[" #x " = " << (x) << "]"
struct fenwick_tree{
vector<long long> bit;
fenwick_tree(int n) : bit(n + 1, 0) {}
void update(int i, long long v){
for(; i < (int)bit.size(); i += i & (-i)) bit[i] += v;
}
long long query(int i){
long long sum = 0;
for(; i > 0; i -= i & (-i)) sum += bit[i];
return sum;
}
long long query(int l, int r){
return query(r) - query(l - 1);
}
int find_last(long long target){
int i = 0;
for(int b = 17; b >= 0; --b){
if(i + (1 << b) < (int)bit.size() && target - bit[i + (1 << b)] > 0){
i += (1 << b);
target -= bit[i];
}
}
return i + 1;
}
};
struct min_prefix_segment_tree{ //finding minimum prefix with maximum position
vector<long long> lazy;
vector<pair<long long, int>> st;
min_prefix_segment_tree(int n ): st(n << 2), lazy(n << 2) {}
void build(int id, int l, int r){
if(l == r) st[id] = {0, -l};
else{
int mid = l + r >> 1;
build(id << 1, l, mid);
build(id << 1 | 1, mid + 1, r);
st[id] = min(st[id << 1], st[id << 1 | 1]);
}
}
void apply(int id, long long v){
st[id].first += v;
lazy[id] += v;
}
void lazy_down(int id){
if(lazy[id] != 0){
apply(id << 1, lazy[id]);
apply(id << 1 | 1, lazy[id]);
lazy[id] = 0;
}
}
void update(int id, int l, int r, int u, int v, long long val){
if(u <= l && r <= v) apply(id, val);
else{
int mid = l + r >> 1;
lazy_down(id);
if(u <= mid) update(id << 1, l, mid, u, v, val);
if(mid < v) update(id << 1 | 1, mid + 1, r, u, v, val);
st[id] = min(st[id << 1], st[id << 1 | 1]);
}
}
pair<long long, int> query(int id, int l, int r, int u, int v){
if(u <= l && r <= v) return st[id];
int mid = l + r >> 1;
lazy_down(id);
if(u > mid) return query(id << 1 | 1, mid + 1, r, u, v);
if(mid >= v) return query(id << 1, l, mid, u, v);
return min(query(id << 1, l, mid, u, v), query(id << 1 | 1, mid + 1, r, u, v));
}
};
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef LOCAL
freopen("task.inp", "r", stdin);
freopen("task.out", "w", stdout);
#endif // LOCAL
int N, M, Q;
cin >> N >> M >> Q;
struct info_update{
int type, c, k, id;
};
struct info_query{
int id; long long b;
};
vector<vector<info_update>> updates(N);
vector<vector<info_query>> queries(N);
vector<int> color(Q + 1);
for(int i = 1; i <= Q; ++i){
int t;
cin >> t;
if(t == 1){
int l, r, c, k;
cin >> l >> r >> c >> k;
--l;
updates[l].push_back({+1, c, k, i});
if(r < N) updates[r].push_back({-1, c, k, i});
color[i] = c;
} else if(t == 2){
int l, r, k;
cin >> l >> r >> k;
--l;
updates[l].push_back({+2, -1, k, i});
if(r < N) updates[r].push_back({-2, -1, k, i});
} else if(t == 3){
int a; long long b;
cin >> a >> b;
--a;
queries[a].push_back({b, i});
}
}
min_prefix_segment_tree tr(Q + 1);
fenwick_tree ft(Q), f(Q), g(Q);
tr.build(1, 0, Q);
//ft : 1 and 2
//f : only 1
//g : only 2
vector<int> answer(Q + 1, -1);
for(int i = 0; i < N; ++i){
for(auto [type, c, k, id] : updates[i]){
if(abs(type) == 1){
if(type < 0) tr.update(1, 0, Q, id, Q, -k), f.update(id, -k);
if(type > 0) tr.update(1, 0, Q, id, Q, +k), f.update(id, +k);
} else if(abs(type) == 2){
if(type < 0) tr.update(1, 0, Q, id, Q, +k), g.update(id, -k);
if(type > 0) tr.update(1, 0, Q, id, Q, -k), g.update(id, +k);
} else assert(false);
}
for(auto [b, id] : queries[i]){
long long minPrefix; int from;
tie(minPrefix, from) = tr.query(1, 0, Q, 0, id);
from = -from;
long long f_sum = f.query(id);
long long g_sum = g.query(id);
long long prefixSum = f_sum - g_sum;
long long cur = prefixSum - minPrefix;
if(cur < b){
answer[id] = 0;
} else{
long long loss = (g_sum - g.query(from)) + f.query(from) + b;
answer[id] = color[f.find_last(loss)];
}
}
}
for(int i = 1; i <= Q; ++i){
if(answer[i] != -1) cout << answer[i] << '\n';
}
return 0;
}
Compilation message
foodcourt.cpp: In constructor 'min_prefix_segment_tree::min_prefix_segment_tree(long long int)':
foodcourt.cpp:40:34: warning: 'min_prefix_segment_tree::st' will be initialized after [-Wreorder]
40 | vector<pair<long long, int>> st;
| ^~
foodcourt.cpp:39:23: warning: 'std::vector<long long int> min_prefix_segment_tree::lazy' [-Wreorder]
39 | vector<long long> lazy;
| ^~~~
foodcourt.cpp:42:5: warning: when initialized here [-Wreorder]
42 | min_prefix_segment_tree(int n ): st(n << 2), lazy(n << 2) {}
| ^~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp: In member function 'void min_prefix_segment_tree::build(long long int, long long int, long long int)':
foodcourt.cpp:47:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
47 | int mid = l + r >> 1;
| ~~^~~
foodcourt.cpp: In member function 'void min_prefix_segment_tree::update(long long int, long long int, long long int, long long int, long long int, long long int)':
foodcourt.cpp:70:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
70 | int mid = l + r >> 1;
| ~~^~~
foodcourt.cpp: In member function 'std::pair<long long int, long long int> min_prefix_segment_tree::query(long long int, long long int, long long int, long long int, long long 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:148:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
148 | for(auto [type, c, k, id] : updates[i]){
| ^
foodcourt.cpp:158:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
158 | for(auto [b, id] : queries[i]){
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
592 KB |
Output is correct |
2 |
Correct |
3 ms |
848 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
848 KB |
Output is correct |
5 |
Correct |
1 ms |
592 KB |
Output is correct |
6 |
Correct |
2 ms |
592 KB |
Output is correct |
7 |
Correct |
2 ms |
848 KB |
Output is correct |
8 |
Correct |
2 ms |
848 KB |
Output is correct |
9 |
Correct |
2 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
1016 KB |
Output is correct |
11 |
Correct |
2 ms |
848 KB |
Output is correct |
12 |
Correct |
2 ms |
848 KB |
Output is correct |
13 |
Correct |
2 ms |
592 KB |
Output is correct |
14 |
Correct |
2 ms |
1272 KB |
Output is correct |
15 |
Correct |
2 ms |
848 KB |
Output is correct |
16 |
Correct |
2 ms |
848 KB |
Output is correct |
17 |
Correct |
2 ms |
848 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
848 KB |
Output is correct |
20 |
Correct |
2 ms |
848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
592 KB |
Output is correct |
2 |
Correct |
3 ms |
848 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
848 KB |
Output is correct |
5 |
Correct |
1 ms |
592 KB |
Output is correct |
6 |
Correct |
2 ms |
592 KB |
Output is correct |
7 |
Correct |
2 ms |
848 KB |
Output is correct |
8 |
Correct |
2 ms |
848 KB |
Output is correct |
9 |
Correct |
2 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
1016 KB |
Output is correct |
11 |
Correct |
2 ms |
848 KB |
Output is correct |
12 |
Correct |
2 ms |
848 KB |
Output is correct |
13 |
Correct |
2 ms |
592 KB |
Output is correct |
14 |
Correct |
2 ms |
1272 KB |
Output is correct |
15 |
Correct |
2 ms |
848 KB |
Output is correct |
16 |
Correct |
2 ms |
848 KB |
Output is correct |
17 |
Correct |
2 ms |
848 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
848 KB |
Output is correct |
20 |
Correct |
2 ms |
848 KB |
Output is correct |
21 |
Correct |
3 ms |
848 KB |
Output is correct |
22 |
Correct |
3 ms |
848 KB |
Output is correct |
23 |
Correct |
3 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
848 KB |
Output is correct |
25 |
Correct |
2 ms |
592 KB |
Output is correct |
26 |
Correct |
2 ms |
592 KB |
Output is correct |
27 |
Correct |
2 ms |
848 KB |
Output is correct |
28 |
Correct |
2 ms |
848 KB |
Output is correct |
29 |
Correct |
2 ms |
848 KB |
Output is correct |
30 |
Correct |
3 ms |
848 KB |
Output is correct |
31 |
Correct |
2 ms |
984 KB |
Output is correct |
32 |
Correct |
3 ms |
848 KB |
Output is correct |
33 |
Correct |
2 ms |
848 KB |
Output is correct |
34 |
Correct |
2 ms |
848 KB |
Output is correct |
35 |
Correct |
2 ms |
848 KB |
Output is correct |
36 |
Correct |
2 ms |
848 KB |
Output is correct |
37 |
Correct |
2 ms |
848 KB |
Output is correct |
38 |
Correct |
3 ms |
848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
16456 KB |
Output is correct |
2 |
Correct |
55 ms |
16720 KB |
Output is correct |
3 |
Correct |
52 ms |
16464 KB |
Output is correct |
4 |
Correct |
52 ms |
16464 KB |
Output is correct |
5 |
Correct |
58 ms |
16720 KB |
Output is correct |
6 |
Correct |
57 ms |
16860 KB |
Output is correct |
7 |
Correct |
25 ms |
10820 KB |
Output is correct |
8 |
Correct |
29 ms |
11968 KB |
Output is correct |
9 |
Correct |
58 ms |
16712 KB |
Output is correct |
10 |
Correct |
56 ms |
16712 KB |
Output is correct |
11 |
Correct |
64 ms |
16720 KB |
Output is correct |
12 |
Correct |
56 ms |
16720 KB |
Output is correct |
13 |
Correct |
49 ms |
14160 KB |
Output is correct |
14 |
Correct |
53 ms |
16464 KB |
Output is correct |
15 |
Correct |
57 ms |
16200 KB |
Output is correct |
16 |
Correct |
59 ms |
17248 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
285 ms |
57040 KB |
Output is correct |
2 |
Correct |
236 ms |
50760 KB |
Output is correct |
3 |
Correct |
347 ms |
68432 KB |
Output is correct |
4 |
Correct |
246 ms |
53832 KB |
Output is correct |
5 |
Correct |
221 ms |
51832 KB |
Output is correct |
6 |
Correct |
337 ms |
69704 KB |
Output is correct |
7 |
Correct |
122 ms |
45612 KB |
Output is correct |
8 |
Correct |
133 ms |
48376 KB |
Output is correct |
9 |
Correct |
285 ms |
66372 KB |
Output is correct |
10 |
Correct |
280 ms |
66380 KB |
Output is correct |
11 |
Correct |
277 ms |
69676 KB |
Output is correct |
12 |
Correct |
288 ms |
69972 KB |
Output is correct |
13 |
Correct |
299 ms |
69964 KB |
Output is correct |
14 |
Correct |
278 ms |
69704 KB |
Output is correct |
15 |
Correct |
321 ms |
69712 KB |
Output is correct |
16 |
Correct |
353 ms |
69600 KB |
Output is correct |
17 |
Correct |
349 ms |
69704 KB |
Output is correct |
18 |
Correct |
352 ms |
69704 KB |
Output is correct |
19 |
Correct |
365 ms |
69704 KB |
Output is correct |
20 |
Correct |
345 ms |
69832 KB |
Output is correct |
21 |
Correct |
331 ms |
69704 KB |
Output is correct |
22 |
Correct |
328 ms |
69704 KB |
Output is correct |
23 |
Correct |
307 ms |
69704 KB |
Output is correct |
24 |
Correct |
337 ms |
69648 KB |
Output is correct |
25 |
Correct |
247 ms |
68332 KB |
Output is correct |
26 |
Correct |
248 ms |
72016 KB |
Output is correct |
27 |
Correct |
255 ms |
70472 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
592 KB |
Output is correct |
2 |
Correct |
3 ms |
848 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
848 KB |
Output is correct |
5 |
Correct |
1 ms |
592 KB |
Output is correct |
6 |
Correct |
2 ms |
592 KB |
Output is correct |
7 |
Correct |
2 ms |
848 KB |
Output is correct |
8 |
Correct |
2 ms |
848 KB |
Output is correct |
9 |
Correct |
2 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
1016 KB |
Output is correct |
11 |
Correct |
2 ms |
848 KB |
Output is correct |
12 |
Correct |
2 ms |
848 KB |
Output is correct |
13 |
Correct |
2 ms |
592 KB |
Output is correct |
14 |
Correct |
2 ms |
1272 KB |
Output is correct |
15 |
Correct |
2 ms |
848 KB |
Output is correct |
16 |
Correct |
2 ms |
848 KB |
Output is correct |
17 |
Correct |
2 ms |
848 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
848 KB |
Output is correct |
20 |
Correct |
2 ms |
848 KB |
Output is correct |
21 |
Correct |
56 ms |
16456 KB |
Output is correct |
22 |
Correct |
55 ms |
16720 KB |
Output is correct |
23 |
Correct |
52 ms |
16464 KB |
Output is correct |
24 |
Correct |
52 ms |
16464 KB |
Output is correct |
25 |
Correct |
58 ms |
16720 KB |
Output is correct |
26 |
Correct |
57 ms |
16860 KB |
Output is correct |
27 |
Correct |
25 ms |
10820 KB |
Output is correct |
28 |
Correct |
29 ms |
11968 KB |
Output is correct |
29 |
Correct |
58 ms |
16712 KB |
Output is correct |
30 |
Correct |
56 ms |
16712 KB |
Output is correct |
31 |
Correct |
64 ms |
16720 KB |
Output is correct |
32 |
Correct |
56 ms |
16720 KB |
Output is correct |
33 |
Correct |
49 ms |
14160 KB |
Output is correct |
34 |
Correct |
53 ms |
16464 KB |
Output is correct |
35 |
Correct |
57 ms |
16200 KB |
Output is correct |
36 |
Correct |
59 ms |
17248 KB |
Output is correct |
37 |
Correct |
62 ms |
14920 KB |
Output is correct |
38 |
Correct |
52 ms |
13648 KB |
Output is correct |
39 |
Correct |
23 ms |
9988 KB |
Output is correct |
40 |
Correct |
32 ms |
11696 KB |
Output is correct |
41 |
Correct |
63 ms |
16876 KB |
Output is correct |
42 |
Correct |
67 ms |
16712 KB |
Output is correct |
43 |
Correct |
65 ms |
16712 KB |
Output is correct |
44 |
Correct |
59 ms |
16720 KB |
Output is correct |
45 |
Correct |
63 ms |
16764 KB |
Output is correct |
46 |
Correct |
68 ms |
16720 KB |
Output is correct |
47 |
Correct |
35 ms |
14852 KB |
Output is correct |
48 |
Correct |
55 ms |
17616 KB |
Output is correct |
49 |
Correct |
45 ms |
12112 KB |
Output is correct |
50 |
Correct |
57 ms |
14928 KB |
Output is correct |
51 |
Correct |
76 ms |
16968 KB |
Output is correct |
52 |
Correct |
70 ms |
17032 KB |
Output is correct |
53 |
Correct |
55 ms |
13904 KB |
Output is correct |
54 |
Correct |
80 ms |
17224 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
51 ms |
14408 KB |
Output is correct |
2 |
Correct |
58 ms |
16968 KB |
Output is correct |
3 |
Correct |
72 ms |
17736 KB |
Output is correct |
4 |
Correct |
38 ms |
13384 KB |
Output is correct |
5 |
Correct |
48 ms |
15432 KB |
Output is correct |
6 |
Correct |
58 ms |
17464 KB |
Output is correct |
7 |
Correct |
28 ms |
10692 KB |
Output is correct |
8 |
Correct |
29 ms |
10352 KB |
Output is correct |
9 |
Correct |
49 ms |
15680 KB |
Output is correct |
10 |
Correct |
36 ms |
13292 KB |
Output is correct |
11 |
Correct |
50 ms |
17480 KB |
Output is correct |
12 |
Correct |
50 ms |
17736 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
592 KB |
Output is correct |
2 |
Correct |
3 ms |
848 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
848 KB |
Output is correct |
5 |
Correct |
1 ms |
592 KB |
Output is correct |
6 |
Correct |
2 ms |
592 KB |
Output is correct |
7 |
Correct |
2 ms |
848 KB |
Output is correct |
8 |
Correct |
2 ms |
848 KB |
Output is correct |
9 |
Correct |
2 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
1016 KB |
Output is correct |
11 |
Correct |
2 ms |
848 KB |
Output is correct |
12 |
Correct |
2 ms |
848 KB |
Output is correct |
13 |
Correct |
2 ms |
592 KB |
Output is correct |
14 |
Correct |
2 ms |
1272 KB |
Output is correct |
15 |
Correct |
2 ms |
848 KB |
Output is correct |
16 |
Correct |
2 ms |
848 KB |
Output is correct |
17 |
Correct |
2 ms |
848 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
848 KB |
Output is correct |
20 |
Correct |
2 ms |
848 KB |
Output is correct |
21 |
Correct |
3 ms |
848 KB |
Output is correct |
22 |
Correct |
3 ms |
848 KB |
Output is correct |
23 |
Correct |
3 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
848 KB |
Output is correct |
25 |
Correct |
2 ms |
592 KB |
Output is correct |
26 |
Correct |
2 ms |
592 KB |
Output is correct |
27 |
Correct |
2 ms |
848 KB |
Output is correct |
28 |
Correct |
2 ms |
848 KB |
Output is correct |
29 |
Correct |
2 ms |
848 KB |
Output is correct |
30 |
Correct |
3 ms |
848 KB |
Output is correct |
31 |
Correct |
2 ms |
984 KB |
Output is correct |
32 |
Correct |
3 ms |
848 KB |
Output is correct |
33 |
Correct |
2 ms |
848 KB |
Output is correct |
34 |
Correct |
2 ms |
848 KB |
Output is correct |
35 |
Correct |
2 ms |
848 KB |
Output is correct |
36 |
Correct |
2 ms |
848 KB |
Output is correct |
37 |
Correct |
2 ms |
848 KB |
Output is correct |
38 |
Correct |
3 ms |
848 KB |
Output is correct |
39 |
Correct |
56 ms |
16456 KB |
Output is correct |
40 |
Correct |
55 ms |
16720 KB |
Output is correct |
41 |
Correct |
52 ms |
16464 KB |
Output is correct |
42 |
Correct |
52 ms |
16464 KB |
Output is correct |
43 |
Correct |
58 ms |
16720 KB |
Output is correct |
44 |
Correct |
57 ms |
16860 KB |
Output is correct |
45 |
Correct |
25 ms |
10820 KB |
Output is correct |
46 |
Correct |
29 ms |
11968 KB |
Output is correct |
47 |
Correct |
58 ms |
16712 KB |
Output is correct |
48 |
Correct |
56 ms |
16712 KB |
Output is correct |
49 |
Correct |
64 ms |
16720 KB |
Output is correct |
50 |
Correct |
56 ms |
16720 KB |
Output is correct |
51 |
Correct |
49 ms |
14160 KB |
Output is correct |
52 |
Correct |
53 ms |
16464 KB |
Output is correct |
53 |
Correct |
57 ms |
16200 KB |
Output is correct |
54 |
Correct |
59 ms |
17248 KB |
Output is correct |
55 |
Correct |
62 ms |
14920 KB |
Output is correct |
56 |
Correct |
52 ms |
13648 KB |
Output is correct |
57 |
Correct |
23 ms |
9988 KB |
Output is correct |
58 |
Correct |
32 ms |
11696 KB |
Output is correct |
59 |
Correct |
63 ms |
16876 KB |
Output is correct |
60 |
Correct |
67 ms |
16712 KB |
Output is correct |
61 |
Correct |
65 ms |
16712 KB |
Output is correct |
62 |
Correct |
59 ms |
16720 KB |
Output is correct |
63 |
Correct |
63 ms |
16764 KB |
Output is correct |
64 |
Correct |
68 ms |
16720 KB |
Output is correct |
65 |
Correct |
35 ms |
14852 KB |
Output is correct |
66 |
Correct |
55 ms |
17616 KB |
Output is correct |
67 |
Correct |
45 ms |
12112 KB |
Output is correct |
68 |
Correct |
57 ms |
14928 KB |
Output is correct |
69 |
Correct |
76 ms |
16968 KB |
Output is correct |
70 |
Correct |
70 ms |
17032 KB |
Output is correct |
71 |
Correct |
55 ms |
13904 KB |
Output is correct |
72 |
Correct |
80 ms |
17224 KB |
Output is correct |
73 |
Correct |
51 ms |
14408 KB |
Output is correct |
74 |
Correct |
58 ms |
16968 KB |
Output is correct |
75 |
Correct |
72 ms |
17736 KB |
Output is correct |
76 |
Correct |
38 ms |
13384 KB |
Output is correct |
77 |
Correct |
48 ms |
15432 KB |
Output is correct |
78 |
Correct |
58 ms |
17464 KB |
Output is correct |
79 |
Correct |
28 ms |
10692 KB |
Output is correct |
80 |
Correct |
29 ms |
10352 KB |
Output is correct |
81 |
Correct |
49 ms |
15680 KB |
Output is correct |
82 |
Correct |
36 ms |
13292 KB |
Output is correct |
83 |
Correct |
50 ms |
17480 KB |
Output is correct |
84 |
Correct |
50 ms |
17736 KB |
Output is correct |
85 |
Correct |
61 ms |
16128 KB |
Output is correct |
86 |
Correct |
65 ms |
18000 KB |
Output is correct |
87 |
Correct |
71 ms |
16448 KB |
Output is correct |
88 |
Correct |
62 ms |
18504 KB |
Output is correct |
89 |
Correct |
41 ms |
12880 KB |
Output is correct |
90 |
Correct |
62 ms |
18504 KB |
Output is correct |
91 |
Correct |
53 ms |
14664 KB |
Output is correct |
92 |
Correct |
52 ms |
14160 KB |
Output is correct |
93 |
Correct |
66 ms |
18348 KB |
Output is correct |
94 |
Correct |
70 ms |
18504 KB |
Output is correct |
95 |
Correct |
68 ms |
17808 KB |
Output is correct |
96 |
Correct |
70 ms |
18504 KB |
Output is correct |
97 |
Correct |
75 ms |
18504 KB |
Output is correct |
98 |
Correct |
58 ms |
15440 KB |
Output is correct |
99 |
Correct |
38 ms |
16132 KB |
Output is correct |
100 |
Correct |
47 ms |
15432 KB |
Output is correct |
101 |
Correct |
67 ms |
19016 KB |
Output is correct |
102 |
Correct |
63 ms |
18848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
592 KB |
Output is correct |
2 |
Correct |
3 ms |
848 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
848 KB |
Output is correct |
5 |
Correct |
1 ms |
592 KB |
Output is correct |
6 |
Correct |
2 ms |
592 KB |
Output is correct |
7 |
Correct |
2 ms |
848 KB |
Output is correct |
8 |
Correct |
2 ms |
848 KB |
Output is correct |
9 |
Correct |
2 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
1016 KB |
Output is correct |
11 |
Correct |
2 ms |
848 KB |
Output is correct |
12 |
Correct |
2 ms |
848 KB |
Output is correct |
13 |
Correct |
2 ms |
592 KB |
Output is correct |
14 |
Correct |
2 ms |
1272 KB |
Output is correct |
15 |
Correct |
2 ms |
848 KB |
Output is correct |
16 |
Correct |
2 ms |
848 KB |
Output is correct |
17 |
Correct |
2 ms |
848 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
848 KB |
Output is correct |
20 |
Correct |
2 ms |
848 KB |
Output is correct |
21 |
Correct |
3 ms |
848 KB |
Output is correct |
22 |
Correct |
3 ms |
848 KB |
Output is correct |
23 |
Correct |
3 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
848 KB |
Output is correct |
25 |
Correct |
2 ms |
592 KB |
Output is correct |
26 |
Correct |
2 ms |
592 KB |
Output is correct |
27 |
Correct |
2 ms |
848 KB |
Output is correct |
28 |
Correct |
2 ms |
848 KB |
Output is correct |
29 |
Correct |
2 ms |
848 KB |
Output is correct |
30 |
Correct |
3 ms |
848 KB |
Output is correct |
31 |
Correct |
2 ms |
984 KB |
Output is correct |
32 |
Correct |
3 ms |
848 KB |
Output is correct |
33 |
Correct |
2 ms |
848 KB |
Output is correct |
34 |
Correct |
2 ms |
848 KB |
Output is correct |
35 |
Correct |
2 ms |
848 KB |
Output is correct |
36 |
Correct |
2 ms |
848 KB |
Output is correct |
37 |
Correct |
2 ms |
848 KB |
Output is correct |
38 |
Correct |
3 ms |
848 KB |
Output is correct |
39 |
Correct |
56 ms |
16456 KB |
Output is correct |
40 |
Correct |
55 ms |
16720 KB |
Output is correct |
41 |
Correct |
52 ms |
16464 KB |
Output is correct |
42 |
Correct |
52 ms |
16464 KB |
Output is correct |
43 |
Correct |
58 ms |
16720 KB |
Output is correct |
44 |
Correct |
57 ms |
16860 KB |
Output is correct |
45 |
Correct |
25 ms |
10820 KB |
Output is correct |
46 |
Correct |
29 ms |
11968 KB |
Output is correct |
47 |
Correct |
58 ms |
16712 KB |
Output is correct |
48 |
Correct |
56 ms |
16712 KB |
Output is correct |
49 |
Correct |
64 ms |
16720 KB |
Output is correct |
50 |
Correct |
56 ms |
16720 KB |
Output is correct |
51 |
Correct |
49 ms |
14160 KB |
Output is correct |
52 |
Correct |
53 ms |
16464 KB |
Output is correct |
53 |
Correct |
57 ms |
16200 KB |
Output is correct |
54 |
Correct |
59 ms |
17248 KB |
Output is correct |
55 |
Correct |
285 ms |
57040 KB |
Output is correct |
56 |
Correct |
236 ms |
50760 KB |
Output is correct |
57 |
Correct |
347 ms |
68432 KB |
Output is correct |
58 |
Correct |
246 ms |
53832 KB |
Output is correct |
59 |
Correct |
221 ms |
51832 KB |
Output is correct |
60 |
Correct |
337 ms |
69704 KB |
Output is correct |
61 |
Correct |
122 ms |
45612 KB |
Output is correct |
62 |
Correct |
133 ms |
48376 KB |
Output is correct |
63 |
Correct |
285 ms |
66372 KB |
Output is correct |
64 |
Correct |
280 ms |
66380 KB |
Output is correct |
65 |
Correct |
277 ms |
69676 KB |
Output is correct |
66 |
Correct |
288 ms |
69972 KB |
Output is correct |
67 |
Correct |
299 ms |
69964 KB |
Output is correct |
68 |
Correct |
278 ms |
69704 KB |
Output is correct |
69 |
Correct |
321 ms |
69712 KB |
Output is correct |
70 |
Correct |
353 ms |
69600 KB |
Output is correct |
71 |
Correct |
349 ms |
69704 KB |
Output is correct |
72 |
Correct |
352 ms |
69704 KB |
Output is correct |
73 |
Correct |
365 ms |
69704 KB |
Output is correct |
74 |
Correct |
345 ms |
69832 KB |
Output is correct |
75 |
Correct |
331 ms |
69704 KB |
Output is correct |
76 |
Correct |
328 ms |
69704 KB |
Output is correct |
77 |
Correct |
307 ms |
69704 KB |
Output is correct |
78 |
Correct |
337 ms |
69648 KB |
Output is correct |
79 |
Correct |
247 ms |
68332 KB |
Output is correct |
80 |
Correct |
248 ms |
72016 KB |
Output is correct |
81 |
Correct |
255 ms |
70472 KB |
Output is correct |
82 |
Correct |
62 ms |
14920 KB |
Output is correct |
83 |
Correct |
52 ms |
13648 KB |
Output is correct |
84 |
Correct |
23 ms |
9988 KB |
Output is correct |
85 |
Correct |
32 ms |
11696 KB |
Output is correct |
86 |
Correct |
63 ms |
16876 KB |
Output is correct |
87 |
Correct |
67 ms |
16712 KB |
Output is correct |
88 |
Correct |
65 ms |
16712 KB |
Output is correct |
89 |
Correct |
59 ms |
16720 KB |
Output is correct |
90 |
Correct |
63 ms |
16764 KB |
Output is correct |
91 |
Correct |
68 ms |
16720 KB |
Output is correct |
92 |
Correct |
35 ms |
14852 KB |
Output is correct |
93 |
Correct |
55 ms |
17616 KB |
Output is correct |
94 |
Correct |
45 ms |
12112 KB |
Output is correct |
95 |
Correct |
57 ms |
14928 KB |
Output is correct |
96 |
Correct |
76 ms |
16968 KB |
Output is correct |
97 |
Correct |
70 ms |
17032 KB |
Output is correct |
98 |
Correct |
55 ms |
13904 KB |
Output is correct |
99 |
Correct |
80 ms |
17224 KB |
Output is correct |
100 |
Correct |
51 ms |
14408 KB |
Output is correct |
101 |
Correct |
58 ms |
16968 KB |
Output is correct |
102 |
Correct |
72 ms |
17736 KB |
Output is correct |
103 |
Correct |
38 ms |
13384 KB |
Output is correct |
104 |
Correct |
48 ms |
15432 KB |
Output is correct |
105 |
Correct |
58 ms |
17464 KB |
Output is correct |
106 |
Correct |
28 ms |
10692 KB |
Output is correct |
107 |
Correct |
29 ms |
10352 KB |
Output is correct |
108 |
Correct |
49 ms |
15680 KB |
Output is correct |
109 |
Correct |
36 ms |
13292 KB |
Output is correct |
110 |
Correct |
50 ms |
17480 KB |
Output is correct |
111 |
Correct |
50 ms |
17736 KB |
Output is correct |
112 |
Correct |
61 ms |
16128 KB |
Output is correct |
113 |
Correct |
65 ms |
18000 KB |
Output is correct |
114 |
Correct |
71 ms |
16448 KB |
Output is correct |
115 |
Correct |
62 ms |
18504 KB |
Output is correct |
116 |
Correct |
41 ms |
12880 KB |
Output is correct |
117 |
Correct |
62 ms |
18504 KB |
Output is correct |
118 |
Correct |
53 ms |
14664 KB |
Output is correct |
119 |
Correct |
52 ms |
14160 KB |
Output is correct |
120 |
Correct |
66 ms |
18348 KB |
Output is correct |
121 |
Correct |
70 ms |
18504 KB |
Output is correct |
122 |
Correct |
68 ms |
17808 KB |
Output is correct |
123 |
Correct |
70 ms |
18504 KB |
Output is correct |
124 |
Correct |
75 ms |
18504 KB |
Output is correct |
125 |
Correct |
58 ms |
15440 KB |
Output is correct |
126 |
Correct |
38 ms |
16132 KB |
Output is correct |
127 |
Correct |
47 ms |
15432 KB |
Output is correct |
128 |
Correct |
67 ms |
19016 KB |
Output is correct |
129 |
Correct |
63 ms |
18848 KB |
Output is correct |
130 |
Correct |
352 ms |
68692 KB |
Output is correct |
131 |
Correct |
214 ms |
50504 KB |
Output is correct |
132 |
Correct |
327 ms |
68760 KB |
Output is correct |
133 |
Correct |
284 ms |
67528 KB |
Output is correct |
134 |
Correct |
274 ms |
61308 KB |
Output is correct |
135 |
Correct |
305 ms |
70472 KB |
Output is correct |
136 |
Correct |
263 ms |
67228 KB |
Output is correct |
137 |
Correct |
308 ms |
67144 KB |
Output is correct |
138 |
Correct |
347 ms |
70256 KB |
Output is correct |
139 |
Correct |
359 ms |
70400 KB |
Output is correct |
140 |
Correct |
354 ms |
70216 KB |
Output is correct |
141 |
Correct |
339 ms |
70216 KB |
Output is correct |
142 |
Correct |
331 ms |
70216 KB |
Output is correct |
143 |
Correct |
334 ms |
70256 KB |
Output is correct |
144 |
Correct |
306 ms |
70252 KB |
Output is correct |
145 |
Correct |
294 ms |
70196 KB |
Output is correct |
146 |
Correct |
307 ms |
70172 KB |
Output is correct |
147 |
Correct |
326 ms |
70132 KB |
Output is correct |
148 |
Correct |
314 ms |
70212 KB |
Output is correct |
149 |
Correct |
347 ms |
70112 KB |
Output is correct |
150 |
Correct |
168 ms |
59928 KB |
Output is correct |
151 |
Correct |
278 ms |
72816 KB |
Output is correct |
152 |
Correct |
352 ms |
72652 KB |
Output is correct |
153 |
Correct |
324 ms |
71496 KB |
Output is correct |