#include <set>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 1012345678;
class segment {
public:
int l, r, x;
segment() : l(0), r(0), x(0) {};
segment(int l_, int r_, int x_) : l(l_), r(r_), x(x_) {};
bool operator<(const segment& s) const {
if(l != s.l) return l < s.l;
if(r != s.r) return r < s.r;
return x < s.x;
}
};
class query {
public:
int l, r, x, w;
query() : l(0), r(0), x(0), w(0) {};
query(int l_, int r_, int x_, int w_) : l(l_), r(r_), x(x_), w(w_) {};
bool operator<(const query& q) const {
if(x != q.x) return x < q.x;
return w < q.w;
}
};
class segtree {
private:
int sz;
vector<int> val;
public:
segtree() : sz(0), val(vector<int>()) {};
segtree(int sz_) {
sz = 1;
while(sz < sz_) sz *= 2;
val = vector<int>(sz * 2, -inf);
}
void update(int l, int r, int x) {
l += sz;
r += sz;
while(l != r) {
if(l & 1) val[l] = max(val[l], x), ++l;
if(r & 1) --r, val[r] = max(val[r], x);
l >>= 1, r >>= 1;
}
}
int get(int pos) {
pos += sz;
int ans = -inf;
while(pos >= 1) {
ans = max(ans, val[pos]);
pos >>= 1;
}
return ans;
}
};
#include <ctime>
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) {
int u = clock();
vector<int> comp = { 0, inf };
vector<vector<int> > G(K);
for(int i = 0; i < N; ++i) {
++B[i], --T[i];
comp.push_back(A[i]);
comp.push_back(B[i]);
X[i] *= 2;
G[T[i]].push_back(i);
}
for(int i = 0; i < Q; ++i) {
L[i] *= 2;
}
sort(comp.begin(), comp.end());
comp.erase(unique(comp.begin(), comp.end()), comp.end());
//for(int i : comp) cout << i << ' '; cout << endl;
int S = comp.size();
for(int i = 0; i < N; ++i) {
A[i] = lower_bound(comp.begin(), comp.end(), A[i]) - comp.begin();
B[i] = lower_bound(comp.begin(), comp.end(), B[i]) - comp.begin();
}
for(int i = 0; i < Q; ++i) {
Y[i] = lower_bound(comp.begin(), comp.end(), Y[i] + 1) - comp.begin() - 1;
}
//cout << clock() << endl;
vector<query> qs;
for(int i = 0; i < K; ++i) {
set<segment> st;
st.insert(segment(0, S, -inf));
vector<segment> iniqs;
for(int j : G[i]) {
iniqs.push_back(segment(A[j], B[j], X[j]));
}
sort(iniqs.begin(), iniqs.end(), [](segment s1, segment s2) { return s1.x < s2.x; });
int cnt = 0;
for(segment s : iniqs) {
set<segment>::iterator it = st.lower_bound(segment(s.l, s.r, s.x));
if(it != st.begin()) --it;
vector<segment> nst;
while(it != st.end() && it->l < s.r) {
segment t = *it;
int al = max(t.l, s.l), ar = min(t.r, s.r);
if(al >= ar) {
++it;
continue;
}
++cnt;
it = st.erase(it);
qs.push_back(query(al, ar, (s.x + t.x) / 2, (s.x - t.x) / 2));
nst.push_back(segment(al, ar, s.x));
if(t.l < al) nst.push_back(segment(t.l, al, t.x));
if(ar < t.r) nst.push_back(segment(ar, t.r, t.x));
}
if(!nst.empty()) {
sort(nst.begin(), nst.end());
int pre = nst[0].l;
vector<segment> nnst;
for(int i = 1; i <= nst.size(); ++i) {
if(i == nst.size() || nst[i - 1].x != nst[i].x) {
nnst.push_back(segment(pre, nst[i - 1].r, nst[i - 1].x));
pre = nst[i - 1].r;
}
}
st.insert(nnst.begin(), nnst.end());
}
}
for(segment s : st) {
qs.push_back(query(s.l, s.r, (inf + s.x) / 2, (inf - s.x) / 2));
}
//cout << i << ' ' << G[i].size() << ' ' << st.size() << ' ' << cnt << endl;
}
for(int i = 0; i < Q; ++i) {
qs.push_back(query(Y[i], Y[i] + 1, L[i], -(i + 1)));
}
sort(qs.begin(), qs.end());
//cout << clock() << endl;
//cout << "QS-size: " << qs.size() << endl;
segtree seg(S);
for(query i : qs) {
if(i.w >= 0 && i.x - i.w == -inf) {
seg.update(i.l, i.r, i.x + i.w);
}
}
vector<int> ans(Q, -1);
for(query i : qs) {
//cout << i.l << ' ' << i.r << ' ' << i.x << ' ' << i.w << endl;
if(i.w < 0) {
ans[-i.w - 1] = max(ans[-i.w - 1], seg.get(i.l) - i.x);
}
else {
seg.update(i.l, i.r, i.x + i.w);
}
}
reverse(qs.begin(), qs.end());
seg = segtree(S);
for(query i : qs) {
if(i.w >= 0 && i.x + i.w == inf) {
seg.update(i.l, i.r, -(i.x - i.w));
}
}
for(query i : qs) {
if(i.w < 0) {
ans[-i.w - 1] = max(ans[-i.w - 1], i.x - (-seg.get(i.l)));
}
else {
seg.update(i.l, i.r, -(i.x - i.w));
}
}
for(int i = 0; i < Q; ++i) {
if(ans[i] > inf / 3) ans[i] = -1;
else ans[i] /= 2;
}
//cout << clock() << endl;
return ans;
}
vector<int> solve_easy(int N, int K, int Q, vector<int> X, vector<int> T, vector<int> A, vector<int> B, vector<int> L, vector<int> Y) {
for(int i = 0; i < N; ++i) {
--T[i];
}
vector<int> ans(Q);
for(int i = 0; i < Q; ++i) {
vector<int> sub(K, inf);
for(int j = 0; j < N; ++j) {
if(A[j] <= Y[i] && Y[i] <= B[j]) {
sub[T[j]] = min(sub[T[j]], abs(X[j] - L[i]));
}
}
ans[i] = *max_element(sub.begin(), sub.end());
if(ans[i] > inf / 3) ans[i] = -1;
}
return ans;
}
#include <random>
mt19937 mt(1905162106);
int rand_rng(int l, int r) {
uniform_int_distribution<int> p(l, r - 1);
return p(mt);
}
void random_gen() {
int N = 100000, K = 300, Q = 100000, limit = 100000000;
for(int rep = 1; rep <= 1; ++rep) {
vector<int> X(N), T(N), A(N), B(N), L(Q), Y(Q);
for(int i = 0; i < N; ++i) {
X[i] = rand_rng(0, limit);
T[i] = rand_rng(1, K + 1);
A[i] = rand_rng(0, limit);
B[i] = rand_rng(0, limit);
if(A[i] > B[i]) swap(A[i], B[i]);
}
for(int i = 0; i < Q; ++i) {
L[i] = rand_rng(0, limit);
Y[i] = rand_rng(0, limit);
}
vector<int> res1 = solve(N, K, Q, X, T, A, B, L, Y);
/*
vector<int> res2 = solve_easy(N, K, Q, X, T, A, B, L, Y);
if(res1 != res2) {
cout << "Case #" << rep << ": " << endl;
cout << "N = " << N << ", K = " << K << ", Q = " << Q << endl;
for(int i = 0; i < N; ++i) {
cout << "(" << X[i] << ", " << T[i] << ", " << A[i] << ", " << B[i] << ")" << endl;
}
cout << "[";
for(int i = 0; i < Q; ++i) {
if(i) cout << ", ";
cout << "(" << L[i] << ", " << Y[i] << ")";
}
cout << "]" << endl;
cout << "Returns: [";
for(int i = 0; i < Q; ++i) {
if(i) cout << ", ";
cout << res1[i];
}
cout << "]" << endl;
cout << "Answer: [";
for(int i = 0; i < Q; ++i) {
if(i) cout << ", ";
cout << res2[i];
}
cout << "]" << endl;
}
if(rep % 100 == 0) {
cout << rep << " Cases Completed!" << endl;
}
*/
}
}
int main() {
//random_gen();
cin.tie(0);
ios_base::sync_with_stdio(false);
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];
}
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(int i = 0; i < Q; ++i) {
cout << ans[i] << '\n';
}
return 0;
}
Compilation message
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:118:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 1; i <= nst.size(); ++i) {
~~^~~~~~~~~~~~~
new_home.cpp:119:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(i == nst.size() || nst[i - 1].x != nst[i].x) {
~~^~~~~~~~~~~~~
new_home.cpp:61:6: warning: unused variable 'u' [-Wunused-variable]
int u = clock();
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Correct |
3 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
384 KB |
Output is correct |
5 |
Correct |
3 ms |
512 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
640 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
512 KB |
Output is correct |
10 |
Correct |
5 ms |
512 KB |
Output is correct |
11 |
Correct |
3 ms |
512 KB |
Output is correct |
12 |
Correct |
4 ms |
512 KB |
Output is correct |
13 |
Correct |
2 ms |
512 KB |
Output is correct |
14 |
Correct |
5 ms |
512 KB |
Output is correct |
15 |
Correct |
4 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
4 ms |
512 KB |
Output is correct |
18 |
Correct |
4 ms |
512 KB |
Output is correct |
19 |
Correct |
4 ms |
512 KB |
Output is correct |
20 |
Correct |
4 ms |
512 KB |
Output is correct |
21 |
Correct |
7 ms |
640 KB |
Output is correct |
22 |
Correct |
3 ms |
512 KB |
Output is correct |
23 |
Correct |
3 ms |
512 KB |
Output is correct |
24 |
Correct |
3 ms |
512 KB |
Output is correct |
25 |
Correct |
4 ms |
512 KB |
Output is correct |
26 |
Correct |
4 ms |
512 KB |
Output is correct |
27 |
Correct |
3 ms |
384 KB |
Output is correct |
28 |
Correct |
4 ms |
512 KB |
Output is correct |
29 |
Correct |
3 ms |
384 KB |
Output is correct |
30 |
Correct |
3 ms |
512 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Correct |
3 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
384 KB |
Output is correct |
5 |
Correct |
3 ms |
512 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
640 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
512 KB |
Output is correct |
10 |
Correct |
5 ms |
512 KB |
Output is correct |
11 |
Correct |
3 ms |
512 KB |
Output is correct |
12 |
Correct |
4 ms |
512 KB |
Output is correct |
13 |
Correct |
2 ms |
512 KB |
Output is correct |
14 |
Correct |
5 ms |
512 KB |
Output is correct |
15 |
Correct |
4 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
4 ms |
512 KB |
Output is correct |
18 |
Correct |
4 ms |
512 KB |
Output is correct |
19 |
Correct |
4 ms |
512 KB |
Output is correct |
20 |
Correct |
4 ms |
512 KB |
Output is correct |
21 |
Correct |
7 ms |
640 KB |
Output is correct |
22 |
Correct |
3 ms |
512 KB |
Output is correct |
23 |
Correct |
3 ms |
512 KB |
Output is correct |
24 |
Correct |
3 ms |
512 KB |
Output is correct |
25 |
Correct |
4 ms |
512 KB |
Output is correct |
26 |
Correct |
4 ms |
512 KB |
Output is correct |
27 |
Correct |
3 ms |
384 KB |
Output is correct |
28 |
Correct |
4 ms |
512 KB |
Output is correct |
29 |
Correct |
3 ms |
384 KB |
Output is correct |
30 |
Correct |
3 ms |
512 KB |
Output is correct |
31 |
Correct |
235 ms |
10640 KB |
Output is correct |
32 |
Correct |
97 ms |
6960 KB |
Output is correct |
33 |
Correct |
197 ms |
10568 KB |
Output is correct |
34 |
Correct |
200 ms |
11364 KB |
Output is correct |
35 |
Correct |
210 ms |
11220 KB |
Output is correct |
36 |
Correct |
235 ms |
11148 KB |
Output is correct |
37 |
Correct |
252 ms |
11352 KB |
Output is correct |
38 |
Correct |
192 ms |
11452 KB |
Output is correct |
39 |
Correct |
230 ms |
11328 KB |
Output is correct |
40 |
Correct |
196 ms |
11320 KB |
Output is correct |
41 |
Correct |
209 ms |
11160 KB |
Output is correct |
42 |
Correct |
205 ms |
11216 KB |
Output is correct |
43 |
Correct |
84 ms |
7404 KB |
Output is correct |
44 |
Correct |
204 ms |
11168 KB |
Output is correct |
45 |
Correct |
195 ms |
11332 KB |
Output is correct |
46 |
Correct |
214 ms |
11232 KB |
Output is correct |
47 |
Correct |
146 ms |
11028 KB |
Output is correct |
48 |
Correct |
167 ms |
10948 KB |
Output is correct |
49 |
Correct |
205 ms |
11056 KB |
Output is correct |
50 |
Correct |
218 ms |
11456 KB |
Output is correct |
51 |
Correct |
165 ms |
10980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
617 ms |
38108 KB |
Output is correct |
2 |
Correct |
439 ms |
35796 KB |
Output is correct |
3 |
Correct |
1016 ms |
66776 KB |
Output is correct |
4 |
Correct |
689 ms |
39380 KB |
Output is correct |
5 |
Correct |
493 ms |
39832 KB |
Output is correct |
6 |
Correct |
424 ms |
36364 KB |
Output is correct |
7 |
Correct |
743 ms |
66720 KB |
Output is correct |
8 |
Correct |
597 ms |
39120 KB |
Output is correct |
9 |
Correct |
554 ms |
36416 KB |
Output is correct |
10 |
Correct |
526 ms |
35500 KB |
Output is correct |
11 |
Correct |
409 ms |
34964 KB |
Output is correct |
12 |
Correct |
437 ms |
35276 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1042 ms |
42844 KB |
Output is correct |
2 |
Correct |
384 ms |
35496 KB |
Output is correct |
3 |
Correct |
1012 ms |
42052 KB |
Output is correct |
4 |
Correct |
1682 ms |
79956 KB |
Output is correct |
5 |
Correct |
1326 ms |
59960 KB |
Output is correct |
6 |
Correct |
1285 ms |
69052 KB |
Output is correct |
7 |
Correct |
987 ms |
55552 KB |
Output is correct |
8 |
Correct |
931 ms |
54364 KB |
Output is correct |
9 |
Correct |
1087 ms |
79932 KB |
Output is correct |
10 |
Correct |
1151 ms |
67960 KB |
Output is correct |
11 |
Correct |
910 ms |
56200 KB |
Output is correct |
12 |
Correct |
775 ms |
54512 KB |
Output is correct |
13 |
Correct |
634 ms |
53040 KB |
Output is correct |
14 |
Correct |
610 ms |
52884 KB |
Output is correct |
15 |
Correct |
723 ms |
53432 KB |
Output is correct |
16 |
Correct |
811 ms |
54624 KB |
Output is correct |
17 |
Correct |
748 ms |
53320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Correct |
3 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
384 KB |
Output is correct |
5 |
Correct |
3 ms |
512 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
640 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
512 KB |
Output is correct |
10 |
Correct |
5 ms |
512 KB |
Output is correct |
11 |
Correct |
3 ms |
512 KB |
Output is correct |
12 |
Correct |
4 ms |
512 KB |
Output is correct |
13 |
Correct |
2 ms |
512 KB |
Output is correct |
14 |
Correct |
5 ms |
512 KB |
Output is correct |
15 |
Correct |
4 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
4 ms |
512 KB |
Output is correct |
18 |
Correct |
4 ms |
512 KB |
Output is correct |
19 |
Correct |
4 ms |
512 KB |
Output is correct |
20 |
Correct |
4 ms |
512 KB |
Output is correct |
21 |
Correct |
7 ms |
640 KB |
Output is correct |
22 |
Correct |
3 ms |
512 KB |
Output is correct |
23 |
Correct |
3 ms |
512 KB |
Output is correct |
24 |
Correct |
3 ms |
512 KB |
Output is correct |
25 |
Correct |
4 ms |
512 KB |
Output is correct |
26 |
Correct |
4 ms |
512 KB |
Output is correct |
27 |
Correct |
3 ms |
384 KB |
Output is correct |
28 |
Correct |
4 ms |
512 KB |
Output is correct |
29 |
Correct |
3 ms |
384 KB |
Output is correct |
30 |
Correct |
3 ms |
512 KB |
Output is correct |
31 |
Correct |
235 ms |
10640 KB |
Output is correct |
32 |
Correct |
97 ms |
6960 KB |
Output is correct |
33 |
Correct |
197 ms |
10568 KB |
Output is correct |
34 |
Correct |
200 ms |
11364 KB |
Output is correct |
35 |
Correct |
210 ms |
11220 KB |
Output is correct |
36 |
Correct |
235 ms |
11148 KB |
Output is correct |
37 |
Correct |
252 ms |
11352 KB |
Output is correct |
38 |
Correct |
192 ms |
11452 KB |
Output is correct |
39 |
Correct |
230 ms |
11328 KB |
Output is correct |
40 |
Correct |
196 ms |
11320 KB |
Output is correct |
41 |
Correct |
209 ms |
11160 KB |
Output is correct |
42 |
Correct |
205 ms |
11216 KB |
Output is correct |
43 |
Correct |
84 ms |
7404 KB |
Output is correct |
44 |
Correct |
204 ms |
11168 KB |
Output is correct |
45 |
Correct |
195 ms |
11332 KB |
Output is correct |
46 |
Correct |
214 ms |
11232 KB |
Output is correct |
47 |
Correct |
146 ms |
11028 KB |
Output is correct |
48 |
Correct |
167 ms |
10948 KB |
Output is correct |
49 |
Correct |
205 ms |
11056 KB |
Output is correct |
50 |
Correct |
218 ms |
11456 KB |
Output is correct |
51 |
Correct |
165 ms |
10980 KB |
Output is correct |
52 |
Correct |
349 ms |
16480 KB |
Output is correct |
53 |
Correct |
350 ms |
16480 KB |
Output is correct |
54 |
Correct |
228 ms |
12260 KB |
Output is correct |
55 |
Correct |
234 ms |
12432 KB |
Output is correct |
56 |
Correct |
221 ms |
15208 KB |
Output is correct |
57 |
Correct |
243 ms |
11744 KB |
Output is correct |
58 |
Correct |
254 ms |
12680 KB |
Output is correct |
59 |
Correct |
251 ms |
15324 KB |
Output is correct |
60 |
Correct |
248 ms |
11880 KB |
Output is correct |
61 |
Correct |
106 ms |
16736 KB |
Output is correct |
62 |
Correct |
329 ms |
16668 KB |
Output is correct |
63 |
Correct |
268 ms |
15072 KB |
Output is correct |
64 |
Correct |
308 ms |
12492 KB |
Output is correct |
65 |
Correct |
239 ms |
11732 KB |
Output is correct |
66 |
Correct |
258 ms |
11560 KB |
Output is correct |
67 |
Correct |
143 ms |
9744 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Correct |
3 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
384 KB |
Output is correct |
5 |
Correct |
3 ms |
512 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
640 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
512 KB |
Output is correct |
10 |
Correct |
5 ms |
512 KB |
Output is correct |
11 |
Correct |
3 ms |
512 KB |
Output is correct |
12 |
Correct |
4 ms |
512 KB |
Output is correct |
13 |
Correct |
2 ms |
512 KB |
Output is correct |
14 |
Correct |
5 ms |
512 KB |
Output is correct |
15 |
Correct |
4 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
4 ms |
512 KB |
Output is correct |
18 |
Correct |
4 ms |
512 KB |
Output is correct |
19 |
Correct |
4 ms |
512 KB |
Output is correct |
20 |
Correct |
4 ms |
512 KB |
Output is correct |
21 |
Correct |
7 ms |
640 KB |
Output is correct |
22 |
Correct |
3 ms |
512 KB |
Output is correct |
23 |
Correct |
3 ms |
512 KB |
Output is correct |
24 |
Correct |
3 ms |
512 KB |
Output is correct |
25 |
Correct |
4 ms |
512 KB |
Output is correct |
26 |
Correct |
4 ms |
512 KB |
Output is correct |
27 |
Correct |
3 ms |
384 KB |
Output is correct |
28 |
Correct |
4 ms |
512 KB |
Output is correct |
29 |
Correct |
3 ms |
384 KB |
Output is correct |
30 |
Correct |
3 ms |
512 KB |
Output is correct |
31 |
Correct |
235 ms |
10640 KB |
Output is correct |
32 |
Correct |
97 ms |
6960 KB |
Output is correct |
33 |
Correct |
197 ms |
10568 KB |
Output is correct |
34 |
Correct |
200 ms |
11364 KB |
Output is correct |
35 |
Correct |
210 ms |
11220 KB |
Output is correct |
36 |
Correct |
235 ms |
11148 KB |
Output is correct |
37 |
Correct |
252 ms |
11352 KB |
Output is correct |
38 |
Correct |
192 ms |
11452 KB |
Output is correct |
39 |
Correct |
230 ms |
11328 KB |
Output is correct |
40 |
Correct |
196 ms |
11320 KB |
Output is correct |
41 |
Correct |
209 ms |
11160 KB |
Output is correct |
42 |
Correct |
205 ms |
11216 KB |
Output is correct |
43 |
Correct |
84 ms |
7404 KB |
Output is correct |
44 |
Correct |
204 ms |
11168 KB |
Output is correct |
45 |
Correct |
195 ms |
11332 KB |
Output is correct |
46 |
Correct |
214 ms |
11232 KB |
Output is correct |
47 |
Correct |
146 ms |
11028 KB |
Output is correct |
48 |
Correct |
167 ms |
10948 KB |
Output is correct |
49 |
Correct |
205 ms |
11056 KB |
Output is correct |
50 |
Correct |
218 ms |
11456 KB |
Output is correct |
51 |
Correct |
165 ms |
10980 KB |
Output is correct |
52 |
Correct |
617 ms |
38108 KB |
Output is correct |
53 |
Correct |
439 ms |
35796 KB |
Output is correct |
54 |
Correct |
1016 ms |
66776 KB |
Output is correct |
55 |
Correct |
689 ms |
39380 KB |
Output is correct |
56 |
Correct |
493 ms |
39832 KB |
Output is correct |
57 |
Correct |
424 ms |
36364 KB |
Output is correct |
58 |
Correct |
743 ms |
66720 KB |
Output is correct |
59 |
Correct |
597 ms |
39120 KB |
Output is correct |
60 |
Correct |
554 ms |
36416 KB |
Output is correct |
61 |
Correct |
526 ms |
35500 KB |
Output is correct |
62 |
Correct |
409 ms |
34964 KB |
Output is correct |
63 |
Correct |
437 ms |
35276 KB |
Output is correct |
64 |
Correct |
1042 ms |
42844 KB |
Output is correct |
65 |
Correct |
384 ms |
35496 KB |
Output is correct |
66 |
Correct |
1012 ms |
42052 KB |
Output is correct |
67 |
Correct |
1682 ms |
79956 KB |
Output is correct |
68 |
Correct |
1326 ms |
59960 KB |
Output is correct |
69 |
Correct |
1285 ms |
69052 KB |
Output is correct |
70 |
Correct |
987 ms |
55552 KB |
Output is correct |
71 |
Correct |
931 ms |
54364 KB |
Output is correct |
72 |
Correct |
1087 ms |
79932 KB |
Output is correct |
73 |
Correct |
1151 ms |
67960 KB |
Output is correct |
74 |
Correct |
910 ms |
56200 KB |
Output is correct |
75 |
Correct |
775 ms |
54512 KB |
Output is correct |
76 |
Correct |
634 ms |
53040 KB |
Output is correct |
77 |
Correct |
610 ms |
52884 KB |
Output is correct |
78 |
Correct |
723 ms |
53432 KB |
Output is correct |
79 |
Correct |
811 ms |
54624 KB |
Output is correct |
80 |
Correct |
748 ms |
53320 KB |
Output is correct |
81 |
Correct |
349 ms |
16480 KB |
Output is correct |
82 |
Correct |
350 ms |
16480 KB |
Output is correct |
83 |
Correct |
228 ms |
12260 KB |
Output is correct |
84 |
Correct |
234 ms |
12432 KB |
Output is correct |
85 |
Correct |
221 ms |
15208 KB |
Output is correct |
86 |
Correct |
243 ms |
11744 KB |
Output is correct |
87 |
Correct |
254 ms |
12680 KB |
Output is correct |
88 |
Correct |
251 ms |
15324 KB |
Output is correct |
89 |
Correct |
248 ms |
11880 KB |
Output is correct |
90 |
Correct |
106 ms |
16736 KB |
Output is correct |
91 |
Correct |
329 ms |
16668 KB |
Output is correct |
92 |
Correct |
268 ms |
15072 KB |
Output is correct |
93 |
Correct |
308 ms |
12492 KB |
Output is correct |
94 |
Correct |
239 ms |
11732 KB |
Output is correct |
95 |
Correct |
258 ms |
11560 KB |
Output is correct |
96 |
Correct |
143 ms |
9744 KB |
Output is correct |
97 |
Correct |
2090 ms |
90044 KB |
Output is correct |
98 |
Correct |
373 ms |
41012 KB |
Output is correct |
99 |
Correct |
1363 ms |
69320 KB |
Output is correct |
100 |
Correct |
2091 ms |
90280 KB |
Output is correct |
101 |
Correct |
1496 ms |
76064 KB |
Output is correct |
102 |
Correct |
1388 ms |
69140 KB |
Output is correct |
103 |
Correct |
1118 ms |
69212 KB |
Output is correct |
104 |
Correct |
1211 ms |
71416 KB |
Output is correct |
105 |
Correct |
979 ms |
69208 KB |
Output is correct |
106 |
Correct |
1012 ms |
71116 KB |
Output is correct |
107 |
Correct |
1202 ms |
76560 KB |
Output is correct |
108 |
Correct |
1409 ms |
80160 KB |
Output is correct |
109 |
Correct |
1349 ms |
72844 KB |
Output is correct |
110 |
Correct |
1393 ms |
77156 KB |
Output is correct |
111 |
Correct |
1366 ms |
80384 KB |
Output is correct |
112 |
Correct |
1248 ms |
72612 KB |
Output is correct |
113 |
Correct |
683 ms |
78928 KB |
Output is correct |
114 |
Correct |
1701 ms |
89948 KB |
Output is correct |
115 |
Correct |
1730 ms |
79400 KB |
Output is correct |
116 |
Correct |
1646 ms |
75744 KB |
Output is correct |
117 |
Correct |
1583 ms |
72152 KB |
Output is correct |
118 |
Correct |
1529 ms |
70380 KB |
Output is correct |
119 |
Correct |
675 ms |
58928 KB |
Output is correct |
120 |
Correct |
898 ms |
66924 KB |
Output is correct |
121 |
Correct |
1034 ms |
67676 KB |
Output is correct |
122 |
Correct |
971 ms |
68092 KB |
Output is correct |
123 |
Correct |
923 ms |
68288 KB |
Output is correct |
124 |
Correct |
1158 ms |
69540 KB |
Output is correct |
125 |
Correct |
1065 ms |
68228 KB |
Output is correct |
126 |
Correct |
1163 ms |
70076 KB |
Output is correct |