//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 PerSegTreePlus {
struct node {
int l, r;
long long w;
};
int com;
vector <node> st;
vector <int> day;
PerSegTreePlus(int n) {
com = 1;
while (com < n) {
com <<= 1;
}
st.resize(1);
day.resize(1);
}
int SubInsert(int x, int l, int r, int ll, int rr, int w) {
if (r < ll || rr < l) {
return x;
}
if (ll <= l && r <= rr) {
st.push_back({st[x].l, st[x].r, st[x].w+w});
return st.size() - 1;
}
st.push_back(st[x]);
x = st.size() - 1;
int y = SubInsert(st[x].l, l, (l + r) / 2, ll, rr, w);
st[x].l = y;
y = SubInsert(st[x].r, (l + r) / 2 + 1, r, ll, rr, w);
st[x].r = y;
return x;
}
long long SubQuery(int x, int l, int r, int p) {
if (l == r) {
return st[x].w;
}
if (p <= (l + r) / 2) {
return st[x].w + SubQuery(st[x].l, l, (l + r) / 2, p);
}
return st[x].w + SubQuery(st[x].r, (l + r) / 2 + 1, r, p);
}
void Insert(int x, int l, int r, int w) {
day.push_back(SubInsert(day[x], 1, com, l, r, w));
}
long long Query(int x, int p) {
return SubQuery(day[x], 1, com, p);
}
};
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, a, b, c, d, ile;
long long war[N];
long long wej[N][5];
int zap[N]; // z jakiej grupy byli dodani ludzie w tym dodaniu;
vector <pair <int, int> > v[N];
vector <int> que[N];
int main() {
scanf("%d%d%d", &n, &m, &q);
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});
}
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});
}
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);
}
}
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);
}
}
SegTreePlus off(n);
PerSegTreePlus customers(n);
for (int i = 1; i <= q; ++i) {
if (wej[i][0] == 1) { // dodanie d ludzi na przedziale od a do b z grupy c
customers.Insert(ile, wej[i][1], wej[i][2], wej[i][4]);
++ile;
zap[ile] = wej[i][3];
}
else if (wej[i][0] == 2) { // zabranie c ludzi z przedziału od a do b
off.Insert(wej[i][1], wej[i][2], wej[i][3]);
}
else { // pytanie o a-tą pozycję i p-tą osobę
a = wej[i][1];
long long p = wej[i][2] + off.Query(a) - war[i];
if (customers.Query(ile, a) < p) { // nie ma tylu ludzi
printf("0\n");
continue;
}
int bp = 0, bk = ile, bs;
while (bk - bp > 1) {
bs = (bp + bk) / 2;
if (customers.Query(bs, a) < p) {
bp = bs;
}
else {
bk = bs;
}
}
printf("%d\n", zap[bk]);
}
}
return 0;
}
Compilation message
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:176:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
176 | scanf("%d%d%d", &n, &m, &q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:178:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
178 | scanf("%lld", &wej[i][0]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:180:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
180 | scanf("%lld%lld%lld%lld", &wej[i][1], &wej[i][2], &wej[i][3], &wej[i][4]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:185:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
185 | scanf("%lld%lld%lld", &wej[i][1], &wej[i][2], &wej[i][3]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:190:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
190 | scanf("%lld%lld", &wej[i][1], &wej[i][2]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12624 KB |
Output is correct |
2 |
Correct |
8 ms |
12988 KB |
Output is correct |
3 |
Correct |
8 ms |
12960 KB |
Output is correct |
4 |
Correct |
9 ms |
13000 KB |
Output is correct |
5 |
Correct |
8 ms |
12240 KB |
Output is correct |
6 |
Correct |
7 ms |
12364 KB |
Output is correct |
7 |
Correct |
8 ms |
13000 KB |
Output is correct |
8 |
Correct |
8 ms |
13000 KB |
Output is correct |
9 |
Correct |
8 ms |
13000 KB |
Output is correct |
10 |
Correct |
12 ms |
12984 KB |
Output is correct |
11 |
Correct |
9 ms |
12992 KB |
Output is correct |
12 |
Correct |
8 ms |
13008 KB |
Output is correct |
13 |
Correct |
8 ms |
12748 KB |
Output is correct |
14 |
Correct |
8 ms |
12748 KB |
Output is correct |
15 |
Correct |
8 ms |
12632 KB |
Output is correct |
16 |
Correct |
8 ms |
13000 KB |
Output is correct |
17 |
Correct |
8 ms |
13008 KB |
Output is correct |
18 |
Correct |
8 ms |
13000 KB |
Output is correct |
19 |
Correct |
9 ms |
12988 KB |
Output is correct |
20 |
Correct |
9 ms |
13000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12624 KB |
Output is correct |
2 |
Correct |
8 ms |
12988 KB |
Output is correct |
3 |
Correct |
8 ms |
12960 KB |
Output is correct |
4 |
Correct |
9 ms |
13000 KB |
Output is correct |
5 |
Correct |
8 ms |
12240 KB |
Output is correct |
6 |
Correct |
7 ms |
12364 KB |
Output is correct |
7 |
Correct |
8 ms |
13000 KB |
Output is correct |
8 |
Correct |
8 ms |
13000 KB |
Output is correct |
9 |
Correct |
8 ms |
13000 KB |
Output is correct |
10 |
Correct |
12 ms |
12984 KB |
Output is correct |
11 |
Correct |
9 ms |
12992 KB |
Output is correct |
12 |
Correct |
8 ms |
13008 KB |
Output is correct |
13 |
Correct |
8 ms |
12748 KB |
Output is correct |
14 |
Correct |
8 ms |
12748 KB |
Output is correct |
15 |
Correct |
8 ms |
12632 KB |
Output is correct |
16 |
Correct |
8 ms |
13000 KB |
Output is correct |
17 |
Correct |
8 ms |
13008 KB |
Output is correct |
18 |
Correct |
8 ms |
13000 KB |
Output is correct |
19 |
Correct |
9 ms |
12988 KB |
Output is correct |
20 |
Correct |
9 ms |
13000 KB |
Output is correct |
21 |
Correct |
8 ms |
12976 KB |
Output is correct |
22 |
Correct |
9 ms |
12996 KB |
Output is correct |
23 |
Correct |
8 ms |
13000 KB |
Output is correct |
24 |
Correct |
10 ms |
12992 KB |
Output is correct |
25 |
Correct |
7 ms |
12236 KB |
Output is correct |
26 |
Correct |
10 ms |
12292 KB |
Output is correct |
27 |
Correct |
8 ms |
13000 KB |
Output is correct |
28 |
Correct |
8 ms |
13000 KB |
Output is correct |
29 |
Correct |
9 ms |
12988 KB |
Output is correct |
30 |
Correct |
9 ms |
13000 KB |
Output is correct |
31 |
Correct |
8 ms |
12992 KB |
Output is correct |
32 |
Correct |
10 ms |
13000 KB |
Output is correct |
33 |
Correct |
8 ms |
12748 KB |
Output is correct |
34 |
Correct |
8 ms |
12748 KB |
Output is correct |
35 |
Correct |
8 ms |
13012 KB |
Output is correct |
36 |
Correct |
8 ms |
13004 KB |
Output is correct |
37 |
Correct |
8 ms |
13016 KB |
Output is correct |
38 |
Correct |
9 ms |
13000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
73 ms |
28828 KB |
Output is correct |
2 |
Correct |
94 ms |
38476 KB |
Output is correct |
3 |
Correct |
76 ms |
30000 KB |
Output is correct |
4 |
Correct |
78 ms |
30032 KB |
Output is correct |
5 |
Correct |
83 ms |
38448 KB |
Output is correct |
6 |
Correct |
84 ms |
38520 KB |
Output is correct |
7 |
Correct |
37 ms |
19388 KB |
Output is correct |
8 |
Correct |
38 ms |
19576 KB |
Output is correct |
9 |
Correct |
79 ms |
30164 KB |
Output is correct |
10 |
Correct |
76 ms |
30160 KB |
Output is correct |
11 |
Correct |
75 ms |
30080 KB |
Output is correct |
12 |
Correct |
74 ms |
30156 KB |
Output is correct |
13 |
Correct |
77 ms |
37552 KB |
Output is correct |
14 |
Correct |
88 ms |
38316 KB |
Output is correct |
15 |
Correct |
98 ms |
55000 KB |
Output is correct |
16 |
Correct |
99 ms |
55228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
592 ms |
109364 KB |
Output is correct |
2 |
Correct |
454 ms |
110032 KB |
Output is correct |
3 |
Correct |
654 ms |
117040 KB |
Output is correct |
4 |
Correct |
611 ms |
176684 KB |
Output is correct |
5 |
Correct |
594 ms |
176616 KB |
Output is correct |
6 |
Correct |
864 ms |
183584 KB |
Output is correct |
7 |
Correct |
140 ms |
43276 KB |
Output is correct |
8 |
Correct |
143 ms |
42644 KB |
Output is correct |
9 |
Execution timed out |
1099 ms |
183204 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12624 KB |
Output is correct |
2 |
Correct |
8 ms |
12988 KB |
Output is correct |
3 |
Correct |
8 ms |
12960 KB |
Output is correct |
4 |
Correct |
9 ms |
13000 KB |
Output is correct |
5 |
Correct |
8 ms |
12240 KB |
Output is correct |
6 |
Correct |
7 ms |
12364 KB |
Output is correct |
7 |
Correct |
8 ms |
13000 KB |
Output is correct |
8 |
Correct |
8 ms |
13000 KB |
Output is correct |
9 |
Correct |
8 ms |
13000 KB |
Output is correct |
10 |
Correct |
12 ms |
12984 KB |
Output is correct |
11 |
Correct |
9 ms |
12992 KB |
Output is correct |
12 |
Correct |
8 ms |
13008 KB |
Output is correct |
13 |
Correct |
8 ms |
12748 KB |
Output is correct |
14 |
Correct |
8 ms |
12748 KB |
Output is correct |
15 |
Correct |
8 ms |
12632 KB |
Output is correct |
16 |
Correct |
8 ms |
13000 KB |
Output is correct |
17 |
Correct |
8 ms |
13008 KB |
Output is correct |
18 |
Correct |
8 ms |
13000 KB |
Output is correct |
19 |
Correct |
9 ms |
12988 KB |
Output is correct |
20 |
Correct |
9 ms |
13000 KB |
Output is correct |
21 |
Correct |
73 ms |
28828 KB |
Output is correct |
22 |
Correct |
94 ms |
38476 KB |
Output is correct |
23 |
Correct |
76 ms |
30000 KB |
Output is correct |
24 |
Correct |
78 ms |
30032 KB |
Output is correct |
25 |
Correct |
83 ms |
38448 KB |
Output is correct |
26 |
Correct |
84 ms |
38520 KB |
Output is correct |
27 |
Correct |
37 ms |
19388 KB |
Output is correct |
28 |
Correct |
38 ms |
19576 KB |
Output is correct |
29 |
Correct |
79 ms |
30164 KB |
Output is correct |
30 |
Correct |
76 ms |
30160 KB |
Output is correct |
31 |
Correct |
75 ms |
30080 KB |
Output is correct |
32 |
Correct |
74 ms |
30156 KB |
Output is correct |
33 |
Correct |
77 ms |
37552 KB |
Output is correct |
34 |
Correct |
88 ms |
38316 KB |
Output is correct |
35 |
Correct |
98 ms |
55000 KB |
Output is correct |
36 |
Correct |
99 ms |
55228 KB |
Output is correct |
37 |
Correct |
104 ms |
37512 KB |
Output is correct |
38 |
Correct |
109 ms |
53516 KB |
Output is correct |
39 |
Correct |
33 ms |
18812 KB |
Output is correct |
40 |
Correct |
40 ms |
19992 KB |
Output is correct |
41 |
Correct |
128 ms |
54668 KB |
Output is correct |
42 |
Correct |
126 ms |
54796 KB |
Output is correct |
43 |
Correct |
115 ms |
54760 KB |
Output is correct |
44 |
Correct |
131 ms |
54932 KB |
Output is correct |
45 |
Correct |
120 ms |
54784 KB |
Output is correct |
46 |
Correct |
119 ms |
54772 KB |
Output is correct |
47 |
Correct |
67 ms |
28924 KB |
Output is correct |
48 |
Correct |
101 ms |
54200 KB |
Output is correct |
49 |
Correct |
75 ms |
36296 KB |
Output is correct |
50 |
Correct |
90 ms |
37296 KB |
Output is correct |
51 |
Correct |
114 ms |
54736 KB |
Output is correct |
52 |
Correct |
113 ms |
54728 KB |
Output is correct |
53 |
Correct |
75 ms |
37152 KB |
Output is correct |
54 |
Correct |
102 ms |
55280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
180 ms |
53144 KB |
Output is correct |
2 |
Correct |
191 ms |
53464 KB |
Output is correct |
3 |
Correct |
204 ms |
53780 KB |
Output is correct |
4 |
Correct |
122 ms |
35572 KB |
Output is correct |
5 |
Correct |
155 ms |
52952 KB |
Output is correct |
6 |
Correct |
189 ms |
53644 KB |
Output is correct |
7 |
Correct |
44 ms |
18424 KB |
Output is correct |
8 |
Correct |
43 ms |
18664 KB |
Output is correct |
9 |
Correct |
103 ms |
36428 KB |
Output is correct |
10 |
Correct |
98 ms |
51712 KB |
Output is correct |
11 |
Correct |
147 ms |
53020 KB |
Output is correct |
12 |
Correct |
144 ms |
52912 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12624 KB |
Output is correct |
2 |
Correct |
8 ms |
12988 KB |
Output is correct |
3 |
Correct |
8 ms |
12960 KB |
Output is correct |
4 |
Correct |
9 ms |
13000 KB |
Output is correct |
5 |
Correct |
8 ms |
12240 KB |
Output is correct |
6 |
Correct |
7 ms |
12364 KB |
Output is correct |
7 |
Correct |
8 ms |
13000 KB |
Output is correct |
8 |
Correct |
8 ms |
13000 KB |
Output is correct |
9 |
Correct |
8 ms |
13000 KB |
Output is correct |
10 |
Correct |
12 ms |
12984 KB |
Output is correct |
11 |
Correct |
9 ms |
12992 KB |
Output is correct |
12 |
Correct |
8 ms |
13008 KB |
Output is correct |
13 |
Correct |
8 ms |
12748 KB |
Output is correct |
14 |
Correct |
8 ms |
12748 KB |
Output is correct |
15 |
Correct |
8 ms |
12632 KB |
Output is correct |
16 |
Correct |
8 ms |
13000 KB |
Output is correct |
17 |
Correct |
8 ms |
13008 KB |
Output is correct |
18 |
Correct |
8 ms |
13000 KB |
Output is correct |
19 |
Correct |
9 ms |
12988 KB |
Output is correct |
20 |
Correct |
9 ms |
13000 KB |
Output is correct |
21 |
Correct |
8 ms |
12976 KB |
Output is correct |
22 |
Correct |
9 ms |
12996 KB |
Output is correct |
23 |
Correct |
8 ms |
13000 KB |
Output is correct |
24 |
Correct |
10 ms |
12992 KB |
Output is correct |
25 |
Correct |
7 ms |
12236 KB |
Output is correct |
26 |
Correct |
10 ms |
12292 KB |
Output is correct |
27 |
Correct |
8 ms |
13000 KB |
Output is correct |
28 |
Correct |
8 ms |
13000 KB |
Output is correct |
29 |
Correct |
9 ms |
12988 KB |
Output is correct |
30 |
Correct |
9 ms |
13000 KB |
Output is correct |
31 |
Correct |
8 ms |
12992 KB |
Output is correct |
32 |
Correct |
10 ms |
13000 KB |
Output is correct |
33 |
Correct |
8 ms |
12748 KB |
Output is correct |
34 |
Correct |
8 ms |
12748 KB |
Output is correct |
35 |
Correct |
8 ms |
13012 KB |
Output is correct |
36 |
Correct |
8 ms |
13004 KB |
Output is correct |
37 |
Correct |
8 ms |
13016 KB |
Output is correct |
38 |
Correct |
9 ms |
13000 KB |
Output is correct |
39 |
Correct |
73 ms |
28828 KB |
Output is correct |
40 |
Correct |
94 ms |
38476 KB |
Output is correct |
41 |
Correct |
76 ms |
30000 KB |
Output is correct |
42 |
Correct |
78 ms |
30032 KB |
Output is correct |
43 |
Correct |
83 ms |
38448 KB |
Output is correct |
44 |
Correct |
84 ms |
38520 KB |
Output is correct |
45 |
Correct |
37 ms |
19388 KB |
Output is correct |
46 |
Correct |
38 ms |
19576 KB |
Output is correct |
47 |
Correct |
79 ms |
30164 KB |
Output is correct |
48 |
Correct |
76 ms |
30160 KB |
Output is correct |
49 |
Correct |
75 ms |
30080 KB |
Output is correct |
50 |
Correct |
74 ms |
30156 KB |
Output is correct |
51 |
Correct |
77 ms |
37552 KB |
Output is correct |
52 |
Correct |
88 ms |
38316 KB |
Output is correct |
53 |
Correct |
98 ms |
55000 KB |
Output is correct |
54 |
Correct |
99 ms |
55228 KB |
Output is correct |
55 |
Correct |
104 ms |
37512 KB |
Output is correct |
56 |
Correct |
109 ms |
53516 KB |
Output is correct |
57 |
Correct |
33 ms |
18812 KB |
Output is correct |
58 |
Correct |
40 ms |
19992 KB |
Output is correct |
59 |
Correct |
128 ms |
54668 KB |
Output is correct |
60 |
Correct |
126 ms |
54796 KB |
Output is correct |
61 |
Correct |
115 ms |
54760 KB |
Output is correct |
62 |
Correct |
131 ms |
54932 KB |
Output is correct |
63 |
Correct |
120 ms |
54784 KB |
Output is correct |
64 |
Correct |
119 ms |
54772 KB |
Output is correct |
65 |
Correct |
67 ms |
28924 KB |
Output is correct |
66 |
Correct |
101 ms |
54200 KB |
Output is correct |
67 |
Correct |
75 ms |
36296 KB |
Output is correct |
68 |
Correct |
90 ms |
37296 KB |
Output is correct |
69 |
Correct |
114 ms |
54736 KB |
Output is correct |
70 |
Correct |
113 ms |
54728 KB |
Output is correct |
71 |
Correct |
75 ms |
37152 KB |
Output is correct |
72 |
Correct |
102 ms |
55280 KB |
Output is correct |
73 |
Correct |
180 ms |
53144 KB |
Output is correct |
74 |
Correct |
191 ms |
53464 KB |
Output is correct |
75 |
Correct |
204 ms |
53780 KB |
Output is correct |
76 |
Correct |
122 ms |
35572 KB |
Output is correct |
77 |
Correct |
155 ms |
52952 KB |
Output is correct |
78 |
Correct |
189 ms |
53644 KB |
Output is correct |
79 |
Correct |
44 ms |
18424 KB |
Output is correct |
80 |
Correct |
43 ms |
18664 KB |
Output is correct |
81 |
Correct |
103 ms |
36428 KB |
Output is correct |
82 |
Correct |
98 ms |
51712 KB |
Output is correct |
83 |
Correct |
147 ms |
53020 KB |
Output is correct |
84 |
Correct |
144 ms |
52912 KB |
Output is correct |
85 |
Correct |
110 ms |
37948 KB |
Output is correct |
86 |
Correct |
123 ms |
38700 KB |
Output is correct |
87 |
Correct |
144 ms |
54520 KB |
Output is correct |
88 |
Correct |
151 ms |
55264 KB |
Output is correct |
89 |
Correct |
90 ms |
36508 KB |
Output is correct |
90 |
Correct |
134 ms |
55216 KB |
Output is correct |
91 |
Correct |
90 ms |
37368 KB |
Output is correct |
92 |
Correct |
89 ms |
37044 KB |
Output is correct |
93 |
Correct |
134 ms |
55384 KB |
Output is correct |
94 |
Correct |
131 ms |
55300 KB |
Output is correct |
95 |
Correct |
122 ms |
38440 KB |
Output is correct |
96 |
Correct |
124 ms |
55260 KB |
Output is correct |
97 |
Correct |
119 ms |
55280 KB |
Output is correct |
98 |
Correct |
97 ms |
37556 KB |
Output is correct |
99 |
Correct |
76 ms |
37664 KB |
Output is correct |
100 |
Correct |
84 ms |
36908 KB |
Output is correct |
101 |
Correct |
104 ms |
54748 KB |
Output is correct |
102 |
Correct |
105 ms |
38480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12624 KB |
Output is correct |
2 |
Correct |
8 ms |
12988 KB |
Output is correct |
3 |
Correct |
8 ms |
12960 KB |
Output is correct |
4 |
Correct |
9 ms |
13000 KB |
Output is correct |
5 |
Correct |
8 ms |
12240 KB |
Output is correct |
6 |
Correct |
7 ms |
12364 KB |
Output is correct |
7 |
Correct |
8 ms |
13000 KB |
Output is correct |
8 |
Correct |
8 ms |
13000 KB |
Output is correct |
9 |
Correct |
8 ms |
13000 KB |
Output is correct |
10 |
Correct |
12 ms |
12984 KB |
Output is correct |
11 |
Correct |
9 ms |
12992 KB |
Output is correct |
12 |
Correct |
8 ms |
13008 KB |
Output is correct |
13 |
Correct |
8 ms |
12748 KB |
Output is correct |
14 |
Correct |
8 ms |
12748 KB |
Output is correct |
15 |
Correct |
8 ms |
12632 KB |
Output is correct |
16 |
Correct |
8 ms |
13000 KB |
Output is correct |
17 |
Correct |
8 ms |
13008 KB |
Output is correct |
18 |
Correct |
8 ms |
13000 KB |
Output is correct |
19 |
Correct |
9 ms |
12988 KB |
Output is correct |
20 |
Correct |
9 ms |
13000 KB |
Output is correct |
21 |
Correct |
8 ms |
12976 KB |
Output is correct |
22 |
Correct |
9 ms |
12996 KB |
Output is correct |
23 |
Correct |
8 ms |
13000 KB |
Output is correct |
24 |
Correct |
10 ms |
12992 KB |
Output is correct |
25 |
Correct |
7 ms |
12236 KB |
Output is correct |
26 |
Correct |
10 ms |
12292 KB |
Output is correct |
27 |
Correct |
8 ms |
13000 KB |
Output is correct |
28 |
Correct |
8 ms |
13000 KB |
Output is correct |
29 |
Correct |
9 ms |
12988 KB |
Output is correct |
30 |
Correct |
9 ms |
13000 KB |
Output is correct |
31 |
Correct |
8 ms |
12992 KB |
Output is correct |
32 |
Correct |
10 ms |
13000 KB |
Output is correct |
33 |
Correct |
8 ms |
12748 KB |
Output is correct |
34 |
Correct |
8 ms |
12748 KB |
Output is correct |
35 |
Correct |
8 ms |
13012 KB |
Output is correct |
36 |
Correct |
8 ms |
13004 KB |
Output is correct |
37 |
Correct |
8 ms |
13016 KB |
Output is correct |
38 |
Correct |
9 ms |
13000 KB |
Output is correct |
39 |
Correct |
73 ms |
28828 KB |
Output is correct |
40 |
Correct |
94 ms |
38476 KB |
Output is correct |
41 |
Correct |
76 ms |
30000 KB |
Output is correct |
42 |
Correct |
78 ms |
30032 KB |
Output is correct |
43 |
Correct |
83 ms |
38448 KB |
Output is correct |
44 |
Correct |
84 ms |
38520 KB |
Output is correct |
45 |
Correct |
37 ms |
19388 KB |
Output is correct |
46 |
Correct |
38 ms |
19576 KB |
Output is correct |
47 |
Correct |
79 ms |
30164 KB |
Output is correct |
48 |
Correct |
76 ms |
30160 KB |
Output is correct |
49 |
Correct |
75 ms |
30080 KB |
Output is correct |
50 |
Correct |
74 ms |
30156 KB |
Output is correct |
51 |
Correct |
77 ms |
37552 KB |
Output is correct |
52 |
Correct |
88 ms |
38316 KB |
Output is correct |
53 |
Correct |
98 ms |
55000 KB |
Output is correct |
54 |
Correct |
99 ms |
55228 KB |
Output is correct |
55 |
Correct |
592 ms |
109364 KB |
Output is correct |
56 |
Correct |
454 ms |
110032 KB |
Output is correct |
57 |
Correct |
654 ms |
117040 KB |
Output is correct |
58 |
Correct |
611 ms |
176684 KB |
Output is correct |
59 |
Correct |
594 ms |
176616 KB |
Output is correct |
60 |
Correct |
864 ms |
183584 KB |
Output is correct |
61 |
Correct |
140 ms |
43276 KB |
Output is correct |
62 |
Correct |
143 ms |
42644 KB |
Output is correct |
63 |
Execution timed out |
1099 ms |
183204 KB |
Time limit exceeded |
64 |
Halted |
0 ms |
0 KB |
- |