//Autor: Bartłomiej Czarkowski
#include <bits/stdc++.h>
using namespace std;
struct SegTreePlus {
int com;
vector <long long> st;
SegTreePlus(int n) {
com = 1;
while (com < n) {
com <<= 1;
}
st.resize(com << 1);
--com;
}
void Insert(int a, int b, int w) {
a += com;
b += com;
while (a <= b) {
if (a&1) {
st[a++] += w;
}
if (!(b&1)) {
st[b--] += w;
}
a >>= 1;
b >>= 1;
}
}
long long Query(int x) {
x += com;
long long ret = 0;
while (x) {
ret += st[x];
x >>= 1;
}
return ret;
}
};
struct SegTreeFind {
int com;
vector <long long> st;
SegTreeFind(int n) {
com = 1;
while (com < n) {
com <<= 1;
}
st.resize(com << 1);
--com;
}
void Insert(int x, int w) {
x += com;
st[x] = w;
x >>= 1;
while (x) {
st[x] = st[x * 2] + st[x * 2 + 1];
x >>= 1;
}
}
int SubFind(int x, int l, int r, long long w) {
if (l == r) {
return l;
}
if (st[x * 2] >= w) {
return SubFind(x * 2, l, (l + r) / 2, w);
}
return SubFind(x * 2 + 1, (l + r) / 2 + 1, r, w - st[x * 2]);
}
int Find(long long w) {
if (st[1] < w) {
return -1;
}
return SubFind(1, 1, com + 1, w);
}
};
struct SegTreeMerge {
struct node {
long long off, out;
};
int com;
vector <node> st;
SegTreeMerge(int n) {
com = 1;
while (com < n) {
com <<= 1;
}
st.resize(com << 1);
--com;
}
node merge(node p, node q) {
if (p.out >= q.off) {
return {p.off, p.out - q.off + q.out};
}
return {p.off + q.off - p.out, q.out};
}
void Insert(int x, int w) {
x += com;
if (w < 0) {
st[x] = {-w, 0};
}
else {
st[x] = {0, w};
}
x >>= 1;
while (x) {
st[x] = merge(st[x * 2], st[x * 2 + 1]);
x >>= 1;
}
}
long long Query(int a, int b) {
a += com;
b += com;
node ret = {0, 0};
vector <int> rg;
while (a <= b) {
if (a&1) {
ret = merge(ret, st[a]);
++a;
}
if (!(b&1)) {
rg.push_back(b);
--b;
}
a >>= 1;
b >>= 1;
}
reverse(rg.begin(), rg.end());
for (int i : rg) {
ret = merge(ret, st[i]);
}
return ret.off;
}
};
const int N = 251'000;
int n, m, q;
long long war[N];
long long wej[N][5];
vector <pair <int, int> > v[N], vv[N];
vector <int> que[N];
int odp[N];
int main() {
scanf("%d%d%d", &n, &m, &q);
SegTreePlus off(n);
for (int i = 1; i <= q; ++i) {
scanf("%lld", &wej[i][0]);
if (wej[i][0] == 1) { // dodanie d ludzi na przedziale od a do b z grupy c
scanf("%lld%lld%lld%lld", &wej[i][1], &wej[i][2], &wej[i][3], &wej[i][4]);
v[wej[i][1]].push_back({i, wej[i][4]});
v[wej[i][2] + 1].push_back({i, 0});
vv[wej[i][1]].push_back({i, wej[i][4]});
vv[wej[i][2] + 1].push_back({i, 0});
}
else if (wej[i][0] == 2) { // zabranie c ludzi z przedziału od a do b
scanf("%lld%lld%lld", &wej[i][1], &wej[i][2], &wej[i][3]);
v[wej[i][1]].push_back({i, -wej[i][3]});
v[wej[i][2] + 1].push_back({i, 0});
off.Insert(wej[i][1], wej[i][2], wej[i][3]);
}
else { // pytanie o a-tą pozycję i p-tą osobę
scanf("%lld%lld", &wej[i][1], &wej[i][2]);
que[wej[i][1]].push_back(i);
war[i] += wej[i][2] + off.Query(wej[i][1]);
}
}
SegTreeMerge eat(q);
for (int i = 1; i <= n; ++i) {
for (auto j : v[i]) {
eat.Insert(j.first, j.second);
}
for (int j : que[i]) {
war[j] -= eat.Query(1, j);
}
}
SegTreeFind customers(q);
for (int i = 1; i <= n; ++ i) {
for (auto j : vv[i]) {
customers.Insert(j.first, j.second);
}
for (int j : que[i]) {
odp[j] = customers.Find(war[j]);
if (odp[j] > j) {
odp[j] = -1;
}
}
}
for (int i = 1; i <= q; ++i) {
if (odp[i] == 0) {
continue;
}
if (odp[i] == -1) {
printf("0\n");
continue;
}
printf("%lld\n", wej[odp[i]][3]);
}
return 0;
}
Compilation message
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:162:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
162 | scanf("%d%d%d", &n, &m, &q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:167:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
167 | scanf("%lld", &wej[i][0]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:169:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
169 | scanf("%lld%lld%lld%lld", &wej[i][1], &wej[i][2], &wej[i][3], &wej[i][4]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:176:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
176 | scanf("%lld%lld%lld", &wej[i][1], &wej[i][2], &wej[i][3]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:182:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
182 | scanf("%lld%lld", &wej[i][1], &wej[i][2]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
18252 KB |
Output is correct |
2 |
Correct |
12 ms |
18252 KB |
Output is correct |
3 |
Correct |
11 ms |
18264 KB |
Output is correct |
4 |
Correct |
11 ms |
18376 KB |
Output is correct |
5 |
Correct |
10 ms |
18284 KB |
Output is correct |
6 |
Correct |
13 ms |
18136 KB |
Output is correct |
7 |
Correct |
16 ms |
18276 KB |
Output is correct |
8 |
Correct |
11 ms |
18264 KB |
Output is correct |
9 |
Correct |
11 ms |
18264 KB |
Output is correct |
10 |
Correct |
10 ms |
18296 KB |
Output is correct |
11 |
Correct |
11 ms |
18280 KB |
Output is correct |
12 |
Correct |
11 ms |
18264 KB |
Output is correct |
13 |
Correct |
10 ms |
18264 KB |
Output is correct |
14 |
Correct |
13 ms |
18272 KB |
Output is correct |
15 |
Correct |
11 ms |
18380 KB |
Output is correct |
16 |
Correct |
11 ms |
18260 KB |
Output is correct |
17 |
Correct |
10 ms |
18268 KB |
Output is correct |
18 |
Correct |
11 ms |
18264 KB |
Output is correct |
19 |
Correct |
10 ms |
18276 KB |
Output is correct |
20 |
Correct |
11 ms |
18388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
18252 KB |
Output is correct |
2 |
Correct |
12 ms |
18252 KB |
Output is correct |
3 |
Correct |
11 ms |
18264 KB |
Output is correct |
4 |
Correct |
11 ms |
18376 KB |
Output is correct |
5 |
Correct |
10 ms |
18284 KB |
Output is correct |
6 |
Correct |
13 ms |
18136 KB |
Output is correct |
7 |
Correct |
16 ms |
18276 KB |
Output is correct |
8 |
Correct |
11 ms |
18264 KB |
Output is correct |
9 |
Correct |
11 ms |
18264 KB |
Output is correct |
10 |
Correct |
10 ms |
18296 KB |
Output is correct |
11 |
Correct |
11 ms |
18280 KB |
Output is correct |
12 |
Correct |
11 ms |
18264 KB |
Output is correct |
13 |
Correct |
10 ms |
18264 KB |
Output is correct |
14 |
Correct |
13 ms |
18272 KB |
Output is correct |
15 |
Correct |
11 ms |
18380 KB |
Output is correct |
16 |
Correct |
11 ms |
18260 KB |
Output is correct |
17 |
Correct |
10 ms |
18268 KB |
Output is correct |
18 |
Correct |
11 ms |
18264 KB |
Output is correct |
19 |
Correct |
10 ms |
18276 KB |
Output is correct |
20 |
Correct |
11 ms |
18388 KB |
Output is correct |
21 |
Correct |
11 ms |
18252 KB |
Output is correct |
22 |
Correct |
11 ms |
18380 KB |
Output is correct |
23 |
Correct |
11 ms |
18256 KB |
Output is correct |
24 |
Correct |
11 ms |
18404 KB |
Output is correct |
25 |
Correct |
11 ms |
18392 KB |
Output is correct |
26 |
Correct |
10 ms |
18192 KB |
Output is correct |
27 |
Correct |
11 ms |
18276 KB |
Output is correct |
28 |
Correct |
12 ms |
18404 KB |
Output is correct |
29 |
Correct |
11 ms |
18392 KB |
Output is correct |
30 |
Correct |
13 ms |
18392 KB |
Output is correct |
31 |
Correct |
11 ms |
18392 KB |
Output is correct |
32 |
Correct |
11 ms |
18392 KB |
Output is correct |
33 |
Correct |
10 ms |
18316 KB |
Output is correct |
34 |
Correct |
11 ms |
18264 KB |
Output is correct |
35 |
Correct |
10 ms |
18264 KB |
Output is correct |
36 |
Correct |
11 ms |
18264 KB |
Output is correct |
37 |
Correct |
10 ms |
18244 KB |
Output is correct |
38 |
Correct |
11 ms |
18404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
77 ms |
28612 KB |
Output is correct |
2 |
Correct |
80 ms |
29248 KB |
Output is correct |
3 |
Correct |
77 ms |
28932 KB |
Output is correct |
4 |
Correct |
94 ms |
28936 KB |
Output is correct |
5 |
Correct |
82 ms |
29372 KB |
Output is correct |
6 |
Correct |
80 ms |
29252 KB |
Output is correct |
7 |
Correct |
42 ms |
25568 KB |
Output is correct |
8 |
Correct |
43 ms |
25748 KB |
Output is correct |
9 |
Correct |
78 ms |
29008 KB |
Output is correct |
10 |
Correct |
79 ms |
28996 KB |
Output is correct |
11 |
Correct |
76 ms |
28996 KB |
Output is correct |
12 |
Correct |
75 ms |
29048 KB |
Output is correct |
13 |
Correct |
65 ms |
28276 KB |
Output is correct |
14 |
Correct |
77 ms |
29276 KB |
Output is correct |
15 |
Correct |
74 ms |
29380 KB |
Output is correct |
16 |
Correct |
84 ms |
29780 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
389 ms |
57668 KB |
Output is correct |
2 |
Correct |
326 ms |
53452 KB |
Output is correct |
3 |
Correct |
452 ms |
60108 KB |
Output is correct |
4 |
Correct |
322 ms |
54716 KB |
Output is correct |
5 |
Correct |
299 ms |
54340 KB |
Output is correct |
6 |
Correct |
448 ms |
61264 KB |
Output is correct |
7 |
Correct |
148 ms |
47884 KB |
Output is correct |
8 |
Correct |
156 ms |
48496 KB |
Output is correct |
9 |
Correct |
453 ms |
60996 KB |
Output is correct |
10 |
Correct |
439 ms |
66780 KB |
Output is correct |
11 |
Correct |
413 ms |
66068 KB |
Output is correct |
12 |
Correct |
423 ms |
66068 KB |
Output is correct |
13 |
Correct |
433 ms |
66024 KB |
Output is correct |
14 |
Correct |
421 ms |
66076 KB |
Output is correct |
15 |
Correct |
437 ms |
65996 KB |
Output is correct |
16 |
Correct |
441 ms |
65980 KB |
Output is correct |
17 |
Correct |
468 ms |
66164 KB |
Output is correct |
18 |
Correct |
449 ms |
66128 KB |
Output is correct |
19 |
Correct |
442 ms |
66060 KB |
Output is correct |
20 |
Correct |
425 ms |
66024 KB |
Output is correct |
21 |
Correct |
432 ms |
66040 KB |
Output is correct |
22 |
Correct |
444 ms |
66124 KB |
Output is correct |
23 |
Correct |
438 ms |
66004 KB |
Output is correct |
24 |
Correct |
454 ms |
66204 KB |
Output is correct |
25 |
Correct |
307 ms |
61168 KB |
Output is correct |
26 |
Correct |
305 ms |
61836 KB |
Output is correct |
27 |
Correct |
322 ms |
65224 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
18252 KB |
Output is correct |
2 |
Correct |
12 ms |
18252 KB |
Output is correct |
3 |
Correct |
11 ms |
18264 KB |
Output is correct |
4 |
Correct |
11 ms |
18376 KB |
Output is correct |
5 |
Correct |
10 ms |
18284 KB |
Output is correct |
6 |
Correct |
13 ms |
18136 KB |
Output is correct |
7 |
Correct |
16 ms |
18276 KB |
Output is correct |
8 |
Correct |
11 ms |
18264 KB |
Output is correct |
9 |
Correct |
11 ms |
18264 KB |
Output is correct |
10 |
Correct |
10 ms |
18296 KB |
Output is correct |
11 |
Correct |
11 ms |
18280 KB |
Output is correct |
12 |
Correct |
11 ms |
18264 KB |
Output is correct |
13 |
Correct |
10 ms |
18264 KB |
Output is correct |
14 |
Correct |
13 ms |
18272 KB |
Output is correct |
15 |
Correct |
11 ms |
18380 KB |
Output is correct |
16 |
Correct |
11 ms |
18260 KB |
Output is correct |
17 |
Correct |
10 ms |
18268 KB |
Output is correct |
18 |
Correct |
11 ms |
18264 KB |
Output is correct |
19 |
Correct |
10 ms |
18276 KB |
Output is correct |
20 |
Correct |
11 ms |
18388 KB |
Output is correct |
21 |
Correct |
77 ms |
28612 KB |
Output is correct |
22 |
Correct |
80 ms |
29248 KB |
Output is correct |
23 |
Correct |
77 ms |
28932 KB |
Output is correct |
24 |
Correct |
94 ms |
28936 KB |
Output is correct |
25 |
Correct |
82 ms |
29372 KB |
Output is correct |
26 |
Correct |
80 ms |
29252 KB |
Output is correct |
27 |
Correct |
42 ms |
25568 KB |
Output is correct |
28 |
Correct |
43 ms |
25748 KB |
Output is correct |
29 |
Correct |
78 ms |
29008 KB |
Output is correct |
30 |
Correct |
79 ms |
28996 KB |
Output is correct |
31 |
Correct |
76 ms |
28996 KB |
Output is correct |
32 |
Correct |
75 ms |
29048 KB |
Output is correct |
33 |
Correct |
65 ms |
28276 KB |
Output is correct |
34 |
Correct |
77 ms |
29276 KB |
Output is correct |
35 |
Correct |
74 ms |
29380 KB |
Output is correct |
36 |
Correct |
84 ms |
29780 KB |
Output is correct |
37 |
Correct |
74 ms |
28328 KB |
Output is correct |
38 |
Correct |
72 ms |
27940 KB |
Output is correct |
39 |
Correct |
36 ms |
25268 KB |
Output is correct |
40 |
Correct |
42 ms |
25920 KB |
Output is correct |
41 |
Correct |
77 ms |
29024 KB |
Output is correct |
42 |
Correct |
99 ms |
29004 KB |
Output is correct |
43 |
Correct |
92 ms |
28984 KB |
Output is correct |
44 |
Correct |
84 ms |
28996 KB |
Output is correct |
45 |
Correct |
84 ms |
29192 KB |
Output is correct |
46 |
Correct |
89 ms |
28992 KB |
Output is correct |
47 |
Correct |
53 ms |
27524 KB |
Output is correct |
48 |
Correct |
64 ms |
27960 KB |
Output is correct |
49 |
Correct |
67 ms |
27052 KB |
Output is correct |
50 |
Correct |
85 ms |
28192 KB |
Output is correct |
51 |
Correct |
81 ms |
29140 KB |
Output is correct |
52 |
Correct |
80 ms |
29108 KB |
Output is correct |
53 |
Correct |
64 ms |
28228 KB |
Output is correct |
54 |
Correct |
88 ms |
29760 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
83 ms |
28376 KB |
Output is correct |
2 |
Correct |
93 ms |
29252 KB |
Output is correct |
3 |
Correct |
92 ms |
29448 KB |
Output is correct |
4 |
Correct |
79 ms |
27460 KB |
Output is correct |
5 |
Correct |
82 ms |
28456 KB |
Output is correct |
6 |
Correct |
89 ms |
29360 KB |
Output is correct |
7 |
Correct |
48 ms |
25784 KB |
Output is correct |
8 |
Correct |
45 ms |
25472 KB |
Output is correct |
9 |
Correct |
63 ms |
27628 KB |
Output is correct |
10 |
Correct |
52 ms |
26568 KB |
Output is correct |
11 |
Correct |
71 ms |
28124 KB |
Output is correct |
12 |
Correct |
69 ms |
28100 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
18252 KB |
Output is correct |
2 |
Correct |
12 ms |
18252 KB |
Output is correct |
3 |
Correct |
11 ms |
18264 KB |
Output is correct |
4 |
Correct |
11 ms |
18376 KB |
Output is correct |
5 |
Correct |
10 ms |
18284 KB |
Output is correct |
6 |
Correct |
13 ms |
18136 KB |
Output is correct |
7 |
Correct |
16 ms |
18276 KB |
Output is correct |
8 |
Correct |
11 ms |
18264 KB |
Output is correct |
9 |
Correct |
11 ms |
18264 KB |
Output is correct |
10 |
Correct |
10 ms |
18296 KB |
Output is correct |
11 |
Correct |
11 ms |
18280 KB |
Output is correct |
12 |
Correct |
11 ms |
18264 KB |
Output is correct |
13 |
Correct |
10 ms |
18264 KB |
Output is correct |
14 |
Correct |
13 ms |
18272 KB |
Output is correct |
15 |
Correct |
11 ms |
18380 KB |
Output is correct |
16 |
Correct |
11 ms |
18260 KB |
Output is correct |
17 |
Correct |
10 ms |
18268 KB |
Output is correct |
18 |
Correct |
11 ms |
18264 KB |
Output is correct |
19 |
Correct |
10 ms |
18276 KB |
Output is correct |
20 |
Correct |
11 ms |
18388 KB |
Output is correct |
21 |
Correct |
11 ms |
18252 KB |
Output is correct |
22 |
Correct |
11 ms |
18380 KB |
Output is correct |
23 |
Correct |
11 ms |
18256 KB |
Output is correct |
24 |
Correct |
11 ms |
18404 KB |
Output is correct |
25 |
Correct |
11 ms |
18392 KB |
Output is correct |
26 |
Correct |
10 ms |
18192 KB |
Output is correct |
27 |
Correct |
11 ms |
18276 KB |
Output is correct |
28 |
Correct |
12 ms |
18404 KB |
Output is correct |
29 |
Correct |
11 ms |
18392 KB |
Output is correct |
30 |
Correct |
13 ms |
18392 KB |
Output is correct |
31 |
Correct |
11 ms |
18392 KB |
Output is correct |
32 |
Correct |
11 ms |
18392 KB |
Output is correct |
33 |
Correct |
10 ms |
18316 KB |
Output is correct |
34 |
Correct |
11 ms |
18264 KB |
Output is correct |
35 |
Correct |
10 ms |
18264 KB |
Output is correct |
36 |
Correct |
11 ms |
18264 KB |
Output is correct |
37 |
Correct |
10 ms |
18244 KB |
Output is correct |
38 |
Correct |
11 ms |
18404 KB |
Output is correct |
39 |
Correct |
77 ms |
28612 KB |
Output is correct |
40 |
Correct |
80 ms |
29248 KB |
Output is correct |
41 |
Correct |
77 ms |
28932 KB |
Output is correct |
42 |
Correct |
94 ms |
28936 KB |
Output is correct |
43 |
Correct |
82 ms |
29372 KB |
Output is correct |
44 |
Correct |
80 ms |
29252 KB |
Output is correct |
45 |
Correct |
42 ms |
25568 KB |
Output is correct |
46 |
Correct |
43 ms |
25748 KB |
Output is correct |
47 |
Correct |
78 ms |
29008 KB |
Output is correct |
48 |
Correct |
79 ms |
28996 KB |
Output is correct |
49 |
Correct |
76 ms |
28996 KB |
Output is correct |
50 |
Correct |
75 ms |
29048 KB |
Output is correct |
51 |
Correct |
65 ms |
28276 KB |
Output is correct |
52 |
Correct |
77 ms |
29276 KB |
Output is correct |
53 |
Correct |
74 ms |
29380 KB |
Output is correct |
54 |
Correct |
84 ms |
29780 KB |
Output is correct |
55 |
Correct |
74 ms |
28328 KB |
Output is correct |
56 |
Correct |
72 ms |
27940 KB |
Output is correct |
57 |
Correct |
36 ms |
25268 KB |
Output is correct |
58 |
Correct |
42 ms |
25920 KB |
Output is correct |
59 |
Correct |
77 ms |
29024 KB |
Output is correct |
60 |
Correct |
99 ms |
29004 KB |
Output is correct |
61 |
Correct |
92 ms |
28984 KB |
Output is correct |
62 |
Correct |
84 ms |
28996 KB |
Output is correct |
63 |
Correct |
84 ms |
29192 KB |
Output is correct |
64 |
Correct |
89 ms |
28992 KB |
Output is correct |
65 |
Correct |
53 ms |
27524 KB |
Output is correct |
66 |
Correct |
64 ms |
27960 KB |
Output is correct |
67 |
Correct |
67 ms |
27052 KB |
Output is correct |
68 |
Correct |
85 ms |
28192 KB |
Output is correct |
69 |
Correct |
81 ms |
29140 KB |
Output is correct |
70 |
Correct |
80 ms |
29108 KB |
Output is correct |
71 |
Correct |
64 ms |
28228 KB |
Output is correct |
72 |
Correct |
88 ms |
29760 KB |
Output is correct |
73 |
Correct |
83 ms |
28376 KB |
Output is correct |
74 |
Correct |
93 ms |
29252 KB |
Output is correct |
75 |
Correct |
92 ms |
29448 KB |
Output is correct |
76 |
Correct |
79 ms |
27460 KB |
Output is correct |
77 |
Correct |
82 ms |
28456 KB |
Output is correct |
78 |
Correct |
89 ms |
29360 KB |
Output is correct |
79 |
Correct |
48 ms |
25784 KB |
Output is correct |
80 |
Correct |
45 ms |
25472 KB |
Output is correct |
81 |
Correct |
63 ms |
27628 KB |
Output is correct |
82 |
Correct |
52 ms |
26568 KB |
Output is correct |
83 |
Correct |
71 ms |
28124 KB |
Output is correct |
84 |
Correct |
69 ms |
28100 KB |
Output is correct |
85 |
Correct |
97 ms |
28256 KB |
Output is correct |
86 |
Correct |
87 ms |
28932 KB |
Output is correct |
87 |
Correct |
80 ms |
28484 KB |
Output is correct |
88 |
Correct |
88 ms |
29268 KB |
Output is correct |
89 |
Correct |
58 ms |
26880 KB |
Output is correct |
90 |
Correct |
82 ms |
29056 KB |
Output is correct |
91 |
Correct |
70 ms |
27724 KB |
Output is correct |
92 |
Correct |
68 ms |
27588 KB |
Output is correct |
93 |
Correct |
88 ms |
28992 KB |
Output is correct |
94 |
Correct |
95 ms |
29032 KB |
Output is correct |
95 |
Correct |
80 ms |
28868 KB |
Output is correct |
96 |
Correct |
87 ms |
29088 KB |
Output is correct |
97 |
Correct |
94 ms |
28996 KB |
Output is correct |
98 |
Correct |
76 ms |
27860 KB |
Output is correct |
99 |
Correct |
56 ms |
27316 KB |
Output is correct |
100 |
Correct |
58 ms |
26948 KB |
Output is correct |
101 |
Correct |
66 ms |
27980 KB |
Output is correct |
102 |
Correct |
74 ms |
28832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
18252 KB |
Output is correct |
2 |
Correct |
12 ms |
18252 KB |
Output is correct |
3 |
Correct |
11 ms |
18264 KB |
Output is correct |
4 |
Correct |
11 ms |
18376 KB |
Output is correct |
5 |
Correct |
10 ms |
18284 KB |
Output is correct |
6 |
Correct |
13 ms |
18136 KB |
Output is correct |
7 |
Correct |
16 ms |
18276 KB |
Output is correct |
8 |
Correct |
11 ms |
18264 KB |
Output is correct |
9 |
Correct |
11 ms |
18264 KB |
Output is correct |
10 |
Correct |
10 ms |
18296 KB |
Output is correct |
11 |
Correct |
11 ms |
18280 KB |
Output is correct |
12 |
Correct |
11 ms |
18264 KB |
Output is correct |
13 |
Correct |
10 ms |
18264 KB |
Output is correct |
14 |
Correct |
13 ms |
18272 KB |
Output is correct |
15 |
Correct |
11 ms |
18380 KB |
Output is correct |
16 |
Correct |
11 ms |
18260 KB |
Output is correct |
17 |
Correct |
10 ms |
18268 KB |
Output is correct |
18 |
Correct |
11 ms |
18264 KB |
Output is correct |
19 |
Correct |
10 ms |
18276 KB |
Output is correct |
20 |
Correct |
11 ms |
18388 KB |
Output is correct |
21 |
Correct |
11 ms |
18252 KB |
Output is correct |
22 |
Correct |
11 ms |
18380 KB |
Output is correct |
23 |
Correct |
11 ms |
18256 KB |
Output is correct |
24 |
Correct |
11 ms |
18404 KB |
Output is correct |
25 |
Correct |
11 ms |
18392 KB |
Output is correct |
26 |
Correct |
10 ms |
18192 KB |
Output is correct |
27 |
Correct |
11 ms |
18276 KB |
Output is correct |
28 |
Correct |
12 ms |
18404 KB |
Output is correct |
29 |
Correct |
11 ms |
18392 KB |
Output is correct |
30 |
Correct |
13 ms |
18392 KB |
Output is correct |
31 |
Correct |
11 ms |
18392 KB |
Output is correct |
32 |
Correct |
11 ms |
18392 KB |
Output is correct |
33 |
Correct |
10 ms |
18316 KB |
Output is correct |
34 |
Correct |
11 ms |
18264 KB |
Output is correct |
35 |
Correct |
10 ms |
18264 KB |
Output is correct |
36 |
Correct |
11 ms |
18264 KB |
Output is correct |
37 |
Correct |
10 ms |
18244 KB |
Output is correct |
38 |
Correct |
11 ms |
18404 KB |
Output is correct |
39 |
Correct |
77 ms |
28612 KB |
Output is correct |
40 |
Correct |
80 ms |
29248 KB |
Output is correct |
41 |
Correct |
77 ms |
28932 KB |
Output is correct |
42 |
Correct |
94 ms |
28936 KB |
Output is correct |
43 |
Correct |
82 ms |
29372 KB |
Output is correct |
44 |
Correct |
80 ms |
29252 KB |
Output is correct |
45 |
Correct |
42 ms |
25568 KB |
Output is correct |
46 |
Correct |
43 ms |
25748 KB |
Output is correct |
47 |
Correct |
78 ms |
29008 KB |
Output is correct |
48 |
Correct |
79 ms |
28996 KB |
Output is correct |
49 |
Correct |
76 ms |
28996 KB |
Output is correct |
50 |
Correct |
75 ms |
29048 KB |
Output is correct |
51 |
Correct |
65 ms |
28276 KB |
Output is correct |
52 |
Correct |
77 ms |
29276 KB |
Output is correct |
53 |
Correct |
74 ms |
29380 KB |
Output is correct |
54 |
Correct |
84 ms |
29780 KB |
Output is correct |
55 |
Correct |
389 ms |
57668 KB |
Output is correct |
56 |
Correct |
326 ms |
53452 KB |
Output is correct |
57 |
Correct |
452 ms |
60108 KB |
Output is correct |
58 |
Correct |
322 ms |
54716 KB |
Output is correct |
59 |
Correct |
299 ms |
54340 KB |
Output is correct |
60 |
Correct |
448 ms |
61264 KB |
Output is correct |
61 |
Correct |
148 ms |
47884 KB |
Output is correct |
62 |
Correct |
156 ms |
48496 KB |
Output is correct |
63 |
Correct |
453 ms |
60996 KB |
Output is correct |
64 |
Correct |
439 ms |
66780 KB |
Output is correct |
65 |
Correct |
413 ms |
66068 KB |
Output is correct |
66 |
Correct |
423 ms |
66068 KB |
Output is correct |
67 |
Correct |
433 ms |
66024 KB |
Output is correct |
68 |
Correct |
421 ms |
66076 KB |
Output is correct |
69 |
Correct |
437 ms |
65996 KB |
Output is correct |
70 |
Correct |
441 ms |
65980 KB |
Output is correct |
71 |
Correct |
468 ms |
66164 KB |
Output is correct |
72 |
Correct |
449 ms |
66128 KB |
Output is correct |
73 |
Correct |
442 ms |
66060 KB |
Output is correct |
74 |
Correct |
425 ms |
66024 KB |
Output is correct |
75 |
Correct |
432 ms |
66040 KB |
Output is correct |
76 |
Correct |
444 ms |
66124 KB |
Output is correct |
77 |
Correct |
438 ms |
66004 KB |
Output is correct |
78 |
Correct |
454 ms |
66204 KB |
Output is correct |
79 |
Correct |
307 ms |
61168 KB |
Output is correct |
80 |
Correct |
305 ms |
61836 KB |
Output is correct |
81 |
Correct |
322 ms |
65224 KB |
Output is correct |
82 |
Correct |
74 ms |
28328 KB |
Output is correct |
83 |
Correct |
72 ms |
27940 KB |
Output is correct |
84 |
Correct |
36 ms |
25268 KB |
Output is correct |
85 |
Correct |
42 ms |
25920 KB |
Output is correct |
86 |
Correct |
77 ms |
29024 KB |
Output is correct |
87 |
Correct |
99 ms |
29004 KB |
Output is correct |
88 |
Correct |
92 ms |
28984 KB |
Output is correct |
89 |
Correct |
84 ms |
28996 KB |
Output is correct |
90 |
Correct |
84 ms |
29192 KB |
Output is correct |
91 |
Correct |
89 ms |
28992 KB |
Output is correct |
92 |
Correct |
53 ms |
27524 KB |
Output is correct |
93 |
Correct |
64 ms |
27960 KB |
Output is correct |
94 |
Correct |
67 ms |
27052 KB |
Output is correct |
95 |
Correct |
85 ms |
28192 KB |
Output is correct |
96 |
Correct |
81 ms |
29140 KB |
Output is correct |
97 |
Correct |
80 ms |
29108 KB |
Output is correct |
98 |
Correct |
64 ms |
28228 KB |
Output is correct |
99 |
Correct |
88 ms |
29760 KB |
Output is correct |
100 |
Correct |
83 ms |
28376 KB |
Output is correct |
101 |
Correct |
93 ms |
29252 KB |
Output is correct |
102 |
Correct |
92 ms |
29448 KB |
Output is correct |
103 |
Correct |
79 ms |
27460 KB |
Output is correct |
104 |
Correct |
82 ms |
28456 KB |
Output is correct |
105 |
Correct |
89 ms |
29360 KB |
Output is correct |
106 |
Correct |
48 ms |
25784 KB |
Output is correct |
107 |
Correct |
45 ms |
25472 KB |
Output is correct |
108 |
Correct |
63 ms |
27628 KB |
Output is correct |
109 |
Correct |
52 ms |
26568 KB |
Output is correct |
110 |
Correct |
71 ms |
28124 KB |
Output is correct |
111 |
Correct |
69 ms |
28100 KB |
Output is correct |
112 |
Correct |
97 ms |
28256 KB |
Output is correct |
113 |
Correct |
87 ms |
28932 KB |
Output is correct |
114 |
Correct |
80 ms |
28484 KB |
Output is correct |
115 |
Correct |
88 ms |
29268 KB |
Output is correct |
116 |
Correct |
58 ms |
26880 KB |
Output is correct |
117 |
Correct |
82 ms |
29056 KB |
Output is correct |
118 |
Correct |
70 ms |
27724 KB |
Output is correct |
119 |
Correct |
68 ms |
27588 KB |
Output is correct |
120 |
Correct |
88 ms |
28992 KB |
Output is correct |
121 |
Correct |
95 ms |
29032 KB |
Output is correct |
122 |
Correct |
80 ms |
28868 KB |
Output is correct |
123 |
Correct |
87 ms |
29088 KB |
Output is correct |
124 |
Correct |
94 ms |
28996 KB |
Output is correct |
125 |
Correct |
76 ms |
27860 KB |
Output is correct |
126 |
Correct |
56 ms |
27316 KB |
Output is correct |
127 |
Correct |
58 ms |
26948 KB |
Output is correct |
128 |
Correct |
66 ms |
27980 KB |
Output is correct |
129 |
Correct |
74 ms |
28832 KB |
Output is correct |
130 |
Correct |
445 ms |
66296 KB |
Output is correct |
131 |
Correct |
302 ms |
57616 KB |
Output is correct |
132 |
Correct |
433 ms |
66384 KB |
Output is correct |
133 |
Correct |
418 ms |
66544 KB |
Output is correct |
134 |
Correct |
367 ms |
63288 KB |
Output is correct |
135 |
Correct |
446 ms |
68060 KB |
Output is correct |
136 |
Correct |
457 ms |
67780 KB |
Output is correct |
137 |
Correct |
469 ms |
67736 KB |
Output is correct |
138 |
Correct |
414 ms |
66760 KB |
Output is correct |
139 |
Correct |
429 ms |
66852 KB |
Output is correct |
140 |
Correct |
424 ms |
66716 KB |
Output is correct |
141 |
Correct |
448 ms |
66756 KB |
Output is correct |
142 |
Correct |
435 ms |
66752 KB |
Output is correct |
143 |
Correct |
438 ms |
66744 KB |
Output is correct |
144 |
Correct |
431 ms |
66740 KB |
Output is correct |
145 |
Correct |
423 ms |
66696 KB |
Output is correct |
146 |
Correct |
487 ms |
66760 KB |
Output is correct |
147 |
Correct |
455 ms |
66672 KB |
Output is correct |
148 |
Correct |
453 ms |
66692 KB |
Output is correct |
149 |
Correct |
452 ms |
66612 KB |
Output is correct |
150 |
Correct |
232 ms |
59932 KB |
Output is correct |
151 |
Correct |
316 ms |
62348 KB |
Output is correct |
152 |
Correct |
339 ms |
62432 KB |
Output is correct |
153 |
Correct |
340 ms |
66136 KB |
Output is correct |