#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ld double
#define ll __int128
mt19937 rnd(51);
const int INF = 1e9;
struct st{
vector<int> t_min, t_max;
vector<multiset<int>> t;
void build(int n) {
t_min.clear(), t_max.clear(), t.clear();
t_min.resize(4 * n, INF);
t_max.resize(4 * n, -INF);
t.resize(4 * n);
}
void upd(int v) {
if (t[v].size() == 0) {
t_min[v] = INF;
t_max[v] = -INF;
return;
}
t_min[v] = *t[v].begin();
t_max[v] = *t[v].rbegin();
}
void update(int v, int l, int r, int pos, int val, int add) {
if (l == r) {
if (add) {
t[v].insert(val);
} else {
t[v].erase(t[v].find(val));
}
upd(v);
return;
}
int m = (l + r) / 2;
if (pos <= m) {
update(2 * v, l, m, pos, val, add);
} else {
update(2 * v + 1, m + 1, r, pos, val, add);
}
t_min[v] = min(t_min[v * 2], t_min[v * 2 + 1]);
t_max[v] = max(t_max[v * 2], t_max[v * 2 + 1]);
}
int get_min(int v, int tl, int tr, int l, int r) {
if (l > r) return INF;
if (tl == l && tr == r) {
return t_min[v];
}
int tm = (tl + tr) / 2;
return min(get_min(2 * v, tl, tm, l, min(r, tm)), get_min(2 * v + 1, tm + 1, tr, max(l, tm + 1), r));
}
int get_max(int v, int tl, int tr, int l, int r) {
if (l > r) return -INF;
if (tl == l && tr == r) {
return t_max[v];
}
int tm = (tl + tr) / 2;
return max(get_max(2 * v, tl, tm, l, min(r, tm)), get_max(2 * v + 1, tm + 1, tr, max(l, tm + 1), r));
}
};
vector<multiset<int>> pos;
vector<int> u2;
st L, R;
int sz;
void add(int a, int b) {
int need = (a + b) / 2;
int pos = upper_bound(u2.begin(), u2.end(), need) - u2.begin() - 1;
int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
L.update(1, 0, sz - 1, pos, a, 1);
R.update(1, 0, sz - 1, pos + 1, b, 1);
}
void del(int a, int b) {
int need = (a + b) / 2;
int pos = upper_bound(u2.begin(), u2.end(), need) - u2.begin() - 1;
int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
L.update(1, 0, sz - 1, pos, a, 0);
R.update(1, 0, sz - 1, pos + 1, b, 0);
}
void func(int i, int j, int need) {
if (need) {
if (pos[i].find(j) != pos[i].end()) {
pos[i].insert(j);
return;
}
int pre = *prev(pos[i].lower_bound(j));
int nxt = *pos[i].upper_bound(j);
del(pre, nxt);
add(pre, j);
add(j, nxt);
pos[i].insert(j);
} else {
pos[i].erase(pos[i].find(j));
if (pos[i].find(j) != pos[i].end()) return;
int pre = *prev(pos[i].lower_bound(j));
int nxt = *pos[i].upper_bound(j);
del(pre, j);
del(j, nxt);
add(pre, nxt);
}
}
vector<int> solve(int n, int k, int q, vector<int> x, vector<int> t, vector<int> a, vector<int> b, vector<int> l, vector<int> y) {
u2.clear();
u2.pb(-INF);
u2.pb(INF);
vector<vector<int>> ind(k);
pos.clear();
pos.resize(k);
vector<int> ans(q);
for (int i = 0; i < n; i++) {
ind[t[i]].pb(x[i]);
u2.pb(x[i]);
}
for (int i = 0; i < k; i++) {
ind[i].pb(-INF);
ind[i].pb(INF);
sort(ind[i].begin(), ind[i].end());
}
for (int i = 0; i < q; i++) {
u2.pb(l[i]);
}
sort(u2.begin(), u2.end());
u2.erase(unique(u2.begin(), u2.end()), u2.end());
vector<vector<int>> qu;
for (int i = 0; i < n; i++) {
qu.pb({a[i], -1, t[i], x[i]});
qu.pb({b[i], 1, t[i], x[i]});
}
for (int i = 0; i < q; i++) {
qu.pb({y[i], 0, l[i], i});
}
sz = u2.size();
bool bad = 0;
L.build(sz);
R.build(sz);
for (int i = 0; i < k; i++) {
if (ind[i].size() == 2) bad = 1;
pos[i].insert(-INF);
pos[i].insert(INF);
add(-INF, INF);
}
sort(qu.begin(), qu.end());
set<int> st;
for (int i = 0; i < k; i++) st.insert(i);
for (int i = 0; i < qu.size(); i++) {
if (qu[i][1] == -1) {
if (pos[qu[i][2]].size() == 2) st.erase(qu[i][2]);
func(qu[i][2], qu[i][3], 1);
} else if (qu[i][1] == 0) {
int j = lower_bound(u2.begin(), u2.end(), qu[i][2]) - u2.begin();
int mx = L.get_min(1, 0, sz - 1, j, sz - 1), mn = R.get_max(1, 0, sz - 1, 0, j);
if (st.size() > 0) {
ans[qu[i][3]] = -1;
} else {
ans[qu[i][3]] = max(qu[i][2] - mx, mn - qu[i][2]);
}
} else {
func(qu[i][2], qu[i][3], 0);
if (pos[qu[i][2]].size() == 2) st.insert(qu[i][2]);
}
}
return ans;
}
vector<int> solvee(int n, int k, int q, vector<int> x, vector<int> t, vector<int> a, vector<int> b, vector<int> l, vector<int> y) {
vector<int> ans;
for (int i = 0; i < q; i++) {
vector<int> bst(k, INF);
for (int j = 0; j < n; j++) {
if (a[j] <= y[i] && y[i] <= b[j]) {
bst[t[j]] = min(bst[t[j]], abs(x[j] - l[i]));
}
}
if (*max_element(bst.begin(), bst.end()) == INF) ans.pb(-1);
else ans.pb(*max_element(bst.begin(), bst.end()));
}
return ans;
}
signed main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif // LOCAL
ios_base::sync_with_stdio(0);
cin.tie(0);
if (1) {
int n, k, q;
cin >> n >> k >> q;
vector<int> x(n), t(n), a(n), b(n), l(q), y(q);
for (int i = 0; i < n; i++) {
cin >> x[i] >> t[i] >> a[i] >> b[i];
t[i]--;
}
for (int i = 0; i < q; i++) {
cin >> l[i] >> y[i];
}
vector<int> ans = solve(n, k, q, x, t, a, b, l, y);
for (auto to : ans) {
cout << to << '\n';
}
return 0;
}
while (1) {
int n = rnd() % 5 + 1, k = rnd() % 5 + 1, q = rnd() % 1 + 1;
vector<int> x(n), t(n), a(n), b(n), l(q), y(q);
for (int i = 0; i < n; i++) {
x[i] = rnd() % 10 + 1;
t[i] = rnd() % k;
a[i] = rnd() % 10 + 1;
b[i] = rnd() % 10 + 1;
if (a[i] > b[i]) swap(a[i], b[i]);
}
for (int i = 0; i < q; i++) {
l[i] = rnd() % 10 + 1;
y[i] = rnd() % 10 + 1;
}
auto res = solve(n, k, q, x, t, a, b, l, y), res2 = solvee(n, k, q, x, t, a, b, l, y);
if (res != res2) {
cout << n << ' ' << k << ' ' << q << endl;
for (int i = 0; i < n; i++) {
cout << x[i] << ' ' << t[i] + 1 << ' ' << a[i] << ' ' << b[i] << endl;
}
for (int i = 0; i < q; i++) {
cout << l[i] << ' ' << y[i] << endl;
}
cout << "Bad" << endl;
for (int i = 0; i < q; i++) {
cout << res[i] << ' ' << res2[i] << endl;
}
return 0;
}
cout << "ok" << endl;
}
return 0;
}
Compilation message
new_home.cpp: In function 'void add(int, int)':
new_home.cpp:77:9: warning: unused variable 'I' [-Wunused-variable]
77 | int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
| ^
new_home.cpp:77:64: warning: unused variable 'J' [-Wunused-variable]
77 | int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
| ^
new_home.cpp: In function 'void del(int, int)':
new_home.cpp:85:9: warning: unused variable 'I' [-Wunused-variable]
85 | int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
| ^
new_home.cpp:85:64: warning: unused variable 'J' [-Wunused-variable]
85 | int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
| ^
new_home.cpp: In function 'std::vector<int> solve(int, int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
new_home.cpp:156:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
156 | for (int i = 0; i < qu.size(); i++) {
| ~~^~~~~~~~~~~
new_home.cpp:144:10: warning: variable 'bad' set but not used [-Wunused-but-set-variable]
144 | bool bad = 0;
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
3 ms |
724 KB |
Output is correct |
7 |
Correct |
3 ms |
848 KB |
Output is correct |
8 |
Correct |
3 ms |
852 KB |
Output is correct |
9 |
Correct |
3 ms |
976 KB |
Output is correct |
10 |
Correct |
3 ms |
848 KB |
Output is correct |
11 |
Correct |
2 ms |
724 KB |
Output is correct |
12 |
Correct |
2 ms |
724 KB |
Output is correct |
13 |
Correct |
2 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
852 KB |
Output is correct |
16 |
Correct |
3 ms |
852 KB |
Output is correct |
17 |
Correct |
2 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
852 KB |
Output is correct |
19 |
Correct |
2 ms |
852 KB |
Output is correct |
20 |
Correct |
3 ms |
736 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
3 ms |
980 KB |
Output is correct |
23 |
Correct |
2 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
852 KB |
Output is correct |
25 |
Correct |
2 ms |
724 KB |
Output is correct |
26 |
Correct |
2 ms |
720 KB |
Output is correct |
27 |
Correct |
2 ms |
468 KB |
Output is correct |
28 |
Correct |
2 ms |
720 KB |
Output is correct |
29 |
Correct |
2 ms |
720 KB |
Output is correct |
30 |
Correct |
2 ms |
724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
3 ms |
724 KB |
Output is correct |
7 |
Correct |
3 ms |
848 KB |
Output is correct |
8 |
Correct |
3 ms |
852 KB |
Output is correct |
9 |
Correct |
3 ms |
976 KB |
Output is correct |
10 |
Correct |
3 ms |
848 KB |
Output is correct |
11 |
Correct |
2 ms |
724 KB |
Output is correct |
12 |
Correct |
2 ms |
724 KB |
Output is correct |
13 |
Correct |
2 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
852 KB |
Output is correct |
16 |
Correct |
3 ms |
852 KB |
Output is correct |
17 |
Correct |
2 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
852 KB |
Output is correct |
19 |
Correct |
2 ms |
852 KB |
Output is correct |
20 |
Correct |
3 ms |
736 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
3 ms |
980 KB |
Output is correct |
23 |
Correct |
2 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
852 KB |
Output is correct |
25 |
Correct |
2 ms |
724 KB |
Output is correct |
26 |
Correct |
2 ms |
720 KB |
Output is correct |
27 |
Correct |
2 ms |
468 KB |
Output is correct |
28 |
Correct |
2 ms |
720 KB |
Output is correct |
29 |
Correct |
2 ms |
720 KB |
Output is correct |
30 |
Correct |
2 ms |
724 KB |
Output is correct |
31 |
Correct |
640 ms |
78228 KB |
Output is correct |
32 |
Correct |
112 ms |
16176 KB |
Output is correct |
33 |
Correct |
566 ms |
72616 KB |
Output is correct |
34 |
Correct |
576 ms |
73120 KB |
Output is correct |
35 |
Correct |
637 ms |
78116 KB |
Output is correct |
36 |
Correct |
646 ms |
77936 KB |
Output is correct |
37 |
Correct |
439 ms |
70208 KB |
Output is correct |
38 |
Correct |
438 ms |
70224 KB |
Output is correct |
39 |
Correct |
367 ms |
69520 KB |
Output is correct |
40 |
Correct |
377 ms |
69656 KB |
Output is correct |
41 |
Correct |
412 ms |
69424 KB |
Output is correct |
42 |
Correct |
426 ms |
69920 KB |
Output is correct |
43 |
Correct |
103 ms |
19500 KB |
Output is correct |
44 |
Correct |
410 ms |
69688 KB |
Output is correct |
45 |
Correct |
397 ms |
69716 KB |
Output is correct |
46 |
Correct |
371 ms |
69488 KB |
Output is correct |
47 |
Correct |
299 ms |
67844 KB |
Output is correct |
48 |
Correct |
315 ms |
67352 KB |
Output is correct |
49 |
Correct |
323 ms |
68352 KB |
Output is correct |
50 |
Correct |
357 ms |
69452 KB |
Output is correct |
51 |
Correct |
317 ms |
67988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3474 ms |
404328 KB |
Output is correct |
2 |
Correct |
2527 ms |
381464 KB |
Output is correct |
3 |
Correct |
4437 ms |
466564 KB |
Output is correct |
4 |
Correct |
4131 ms |
410452 KB |
Output is correct |
5 |
Correct |
2229 ms |
381412 KB |
Output is correct |
6 |
Correct |
2400 ms |
381540 KB |
Output is correct |
7 |
Correct |
3701 ms |
467048 KB |
Output is correct |
8 |
Correct |
3371 ms |
410600 KB |
Output is correct |
9 |
Correct |
2941 ms |
390304 KB |
Output is correct |
10 |
Correct |
2557 ms |
381232 KB |
Output is correct |
11 |
Correct |
2020 ms |
375764 KB |
Output is correct |
12 |
Correct |
2257 ms |
379112 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3849 ms |
387028 KB |
Output is correct |
2 |
Correct |
752 ms |
86788 KB |
Output is correct |
3 |
Correct |
3479 ms |
384916 KB |
Output is correct |
4 |
Correct |
4855 ms |
459032 KB |
Output is correct |
5 |
Correct |
4196 ms |
404092 KB |
Output is correct |
6 |
Correct |
4419 ms |
415268 KB |
Output is correct |
7 |
Correct |
3160 ms |
385384 KB |
Output is correct |
8 |
Correct |
3390 ms |
385388 KB |
Output is correct |
9 |
Correct |
4448 ms |
472456 KB |
Output is correct |
10 |
Correct |
4073 ms |
407828 KB |
Output is correct |
11 |
Correct |
3759 ms |
390908 KB |
Output is correct |
12 |
Correct |
3507 ms |
386236 KB |
Output is correct |
13 |
Correct |
1954 ms |
376756 KB |
Output is correct |
14 |
Correct |
1979 ms |
373944 KB |
Output is correct |
15 |
Correct |
2289 ms |
379764 KB |
Output is correct |
16 |
Correct |
3013 ms |
383840 KB |
Output is correct |
17 |
Correct |
2232 ms |
378500 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
3 ms |
724 KB |
Output is correct |
7 |
Correct |
3 ms |
848 KB |
Output is correct |
8 |
Correct |
3 ms |
852 KB |
Output is correct |
9 |
Correct |
3 ms |
976 KB |
Output is correct |
10 |
Correct |
3 ms |
848 KB |
Output is correct |
11 |
Correct |
2 ms |
724 KB |
Output is correct |
12 |
Correct |
2 ms |
724 KB |
Output is correct |
13 |
Correct |
2 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
852 KB |
Output is correct |
16 |
Correct |
3 ms |
852 KB |
Output is correct |
17 |
Correct |
2 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
852 KB |
Output is correct |
19 |
Correct |
2 ms |
852 KB |
Output is correct |
20 |
Correct |
3 ms |
736 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
3 ms |
980 KB |
Output is correct |
23 |
Correct |
2 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
852 KB |
Output is correct |
25 |
Correct |
2 ms |
724 KB |
Output is correct |
26 |
Correct |
2 ms |
720 KB |
Output is correct |
27 |
Correct |
2 ms |
468 KB |
Output is correct |
28 |
Correct |
2 ms |
720 KB |
Output is correct |
29 |
Correct |
2 ms |
720 KB |
Output is correct |
30 |
Correct |
2 ms |
724 KB |
Output is correct |
31 |
Correct |
640 ms |
78228 KB |
Output is correct |
32 |
Correct |
112 ms |
16176 KB |
Output is correct |
33 |
Correct |
566 ms |
72616 KB |
Output is correct |
34 |
Correct |
576 ms |
73120 KB |
Output is correct |
35 |
Correct |
637 ms |
78116 KB |
Output is correct |
36 |
Correct |
646 ms |
77936 KB |
Output is correct |
37 |
Correct |
439 ms |
70208 KB |
Output is correct |
38 |
Correct |
438 ms |
70224 KB |
Output is correct |
39 |
Correct |
367 ms |
69520 KB |
Output is correct |
40 |
Correct |
377 ms |
69656 KB |
Output is correct |
41 |
Correct |
412 ms |
69424 KB |
Output is correct |
42 |
Correct |
426 ms |
69920 KB |
Output is correct |
43 |
Correct |
103 ms |
19500 KB |
Output is correct |
44 |
Correct |
410 ms |
69688 KB |
Output is correct |
45 |
Correct |
397 ms |
69716 KB |
Output is correct |
46 |
Correct |
371 ms |
69488 KB |
Output is correct |
47 |
Correct |
299 ms |
67844 KB |
Output is correct |
48 |
Correct |
315 ms |
67352 KB |
Output is correct |
49 |
Correct |
323 ms |
68352 KB |
Output is correct |
50 |
Correct |
357 ms |
69452 KB |
Output is correct |
51 |
Correct |
317 ms |
67988 KB |
Output is correct |
52 |
Correct |
767 ms |
94228 KB |
Output is correct |
53 |
Correct |
759 ms |
90708 KB |
Output is correct |
54 |
Correct |
692 ms |
82792 KB |
Output is correct |
55 |
Correct |
541 ms |
77300 KB |
Output is correct |
56 |
Correct |
562 ms |
81564 KB |
Output is correct |
57 |
Correct |
480 ms |
71284 KB |
Output is correct |
58 |
Correct |
562 ms |
77344 KB |
Output is correct |
59 |
Correct |
594 ms |
81580 KB |
Output is correct |
60 |
Correct |
542 ms |
71476 KB |
Output is correct |
61 |
Correct |
305 ms |
41540 KB |
Output is correct |
62 |
Correct |
758 ms |
94200 KB |
Output is correct |
63 |
Correct |
706 ms |
84216 KB |
Output is correct |
64 |
Correct |
690 ms |
80068 KB |
Output is correct |
65 |
Correct |
661 ms |
72560 KB |
Output is correct |
66 |
Correct |
442 ms |
68952 KB |
Output is correct |
67 |
Correct |
299 ms |
18956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
3 ms |
724 KB |
Output is correct |
7 |
Correct |
3 ms |
848 KB |
Output is correct |
8 |
Correct |
3 ms |
852 KB |
Output is correct |
9 |
Correct |
3 ms |
976 KB |
Output is correct |
10 |
Correct |
3 ms |
848 KB |
Output is correct |
11 |
Correct |
2 ms |
724 KB |
Output is correct |
12 |
Correct |
2 ms |
724 KB |
Output is correct |
13 |
Correct |
2 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
852 KB |
Output is correct |
16 |
Correct |
3 ms |
852 KB |
Output is correct |
17 |
Correct |
2 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
852 KB |
Output is correct |
19 |
Correct |
2 ms |
852 KB |
Output is correct |
20 |
Correct |
3 ms |
736 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
3 ms |
980 KB |
Output is correct |
23 |
Correct |
2 ms |
848 KB |
Output is correct |
24 |
Correct |
3 ms |
852 KB |
Output is correct |
25 |
Correct |
2 ms |
724 KB |
Output is correct |
26 |
Correct |
2 ms |
720 KB |
Output is correct |
27 |
Correct |
2 ms |
468 KB |
Output is correct |
28 |
Correct |
2 ms |
720 KB |
Output is correct |
29 |
Correct |
2 ms |
720 KB |
Output is correct |
30 |
Correct |
2 ms |
724 KB |
Output is correct |
31 |
Correct |
640 ms |
78228 KB |
Output is correct |
32 |
Correct |
112 ms |
16176 KB |
Output is correct |
33 |
Correct |
566 ms |
72616 KB |
Output is correct |
34 |
Correct |
576 ms |
73120 KB |
Output is correct |
35 |
Correct |
637 ms |
78116 KB |
Output is correct |
36 |
Correct |
646 ms |
77936 KB |
Output is correct |
37 |
Correct |
439 ms |
70208 KB |
Output is correct |
38 |
Correct |
438 ms |
70224 KB |
Output is correct |
39 |
Correct |
367 ms |
69520 KB |
Output is correct |
40 |
Correct |
377 ms |
69656 KB |
Output is correct |
41 |
Correct |
412 ms |
69424 KB |
Output is correct |
42 |
Correct |
426 ms |
69920 KB |
Output is correct |
43 |
Correct |
103 ms |
19500 KB |
Output is correct |
44 |
Correct |
410 ms |
69688 KB |
Output is correct |
45 |
Correct |
397 ms |
69716 KB |
Output is correct |
46 |
Correct |
371 ms |
69488 KB |
Output is correct |
47 |
Correct |
299 ms |
67844 KB |
Output is correct |
48 |
Correct |
315 ms |
67352 KB |
Output is correct |
49 |
Correct |
323 ms |
68352 KB |
Output is correct |
50 |
Correct |
357 ms |
69452 KB |
Output is correct |
51 |
Correct |
317 ms |
67988 KB |
Output is correct |
52 |
Correct |
3474 ms |
404328 KB |
Output is correct |
53 |
Correct |
2527 ms |
381464 KB |
Output is correct |
54 |
Correct |
4437 ms |
466564 KB |
Output is correct |
55 |
Correct |
4131 ms |
410452 KB |
Output is correct |
56 |
Correct |
2229 ms |
381412 KB |
Output is correct |
57 |
Correct |
2400 ms |
381540 KB |
Output is correct |
58 |
Correct |
3701 ms |
467048 KB |
Output is correct |
59 |
Correct |
3371 ms |
410600 KB |
Output is correct |
60 |
Correct |
2941 ms |
390304 KB |
Output is correct |
61 |
Correct |
2557 ms |
381232 KB |
Output is correct |
62 |
Correct |
2020 ms |
375764 KB |
Output is correct |
63 |
Correct |
2257 ms |
379112 KB |
Output is correct |
64 |
Correct |
3849 ms |
387028 KB |
Output is correct |
65 |
Correct |
752 ms |
86788 KB |
Output is correct |
66 |
Correct |
3479 ms |
384916 KB |
Output is correct |
67 |
Correct |
4855 ms |
459032 KB |
Output is correct |
68 |
Correct |
4196 ms |
404092 KB |
Output is correct |
69 |
Correct |
4419 ms |
415268 KB |
Output is correct |
70 |
Correct |
3160 ms |
385384 KB |
Output is correct |
71 |
Correct |
3390 ms |
385388 KB |
Output is correct |
72 |
Correct |
4448 ms |
472456 KB |
Output is correct |
73 |
Correct |
4073 ms |
407828 KB |
Output is correct |
74 |
Correct |
3759 ms |
390908 KB |
Output is correct |
75 |
Correct |
3507 ms |
386236 KB |
Output is correct |
76 |
Correct |
1954 ms |
376756 KB |
Output is correct |
77 |
Correct |
1979 ms |
373944 KB |
Output is correct |
78 |
Correct |
2289 ms |
379764 KB |
Output is correct |
79 |
Correct |
3013 ms |
383840 KB |
Output is correct |
80 |
Correct |
2232 ms |
378500 KB |
Output is correct |
81 |
Correct |
767 ms |
94228 KB |
Output is correct |
82 |
Correct |
759 ms |
90708 KB |
Output is correct |
83 |
Correct |
692 ms |
82792 KB |
Output is correct |
84 |
Correct |
541 ms |
77300 KB |
Output is correct |
85 |
Correct |
562 ms |
81564 KB |
Output is correct |
86 |
Correct |
480 ms |
71284 KB |
Output is correct |
87 |
Correct |
562 ms |
77344 KB |
Output is correct |
88 |
Correct |
594 ms |
81580 KB |
Output is correct |
89 |
Correct |
542 ms |
71476 KB |
Output is correct |
90 |
Correct |
305 ms |
41540 KB |
Output is correct |
91 |
Correct |
758 ms |
94200 KB |
Output is correct |
92 |
Correct |
706 ms |
84216 KB |
Output is correct |
93 |
Correct |
690 ms |
80068 KB |
Output is correct |
94 |
Correct |
661 ms |
72560 KB |
Output is correct |
95 |
Correct |
442 ms |
68952 KB |
Output is correct |
96 |
Correct |
299 ms |
18956 KB |
Output is correct |
97 |
Execution timed out |
5082 ms |
474308 KB |
Time limit exceeded |
98 |
Halted |
0 ms |
0 KB |
- |