#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> bool cmin(T &i, T j) { return i > j ? i=j,true:false; }
template<class T> bool cmax(T &i, T j) { return i < j ? i=j,true:false; }
constexpr int nax = 200200,block_size = 450;
vector<tuple<int,int,int>> queries[block_size]; // r,l,idx
vector<bool> ans;
int edges[nax][2];
int n,m;
bool pref[nax];
bool suff[nax];
bool pref_suff[nax];
struct dsu_save {
int x,y,lzx,lzy,szx,szy,parx,pary;
};
struct DSU {
int lz[nax];
int par[nax];
int sz[nax];
dsu_save stk[nax]; // avoid allocating a lot of memory on heap -- better to allocate initially on stack
int T = 0;
void init() {
for (int i = 0; i < nax; i++)
lz[i] = 0, par[i] = i, sz[i] = 1;
}
int get(int x,int &cx) {
while(1) {
cx ^= lz[x];
if (x == par[x])
return x;
x = par[x];
}
}
bool need_reset = 0;
bool unite(int x,int y) {
assert(!need_reset);
int cx = 0,cy = 0;
int px = get(x,cx), py = get(y,cy);
if (sz[px] < sz[py])
swap(px,py), swap(cx,cy);
stk[T++] = {px,py,lz[px],lz[py],sz[px],sz[py],par[px],par[py]};
if (cx == cy) {
if (px == py) {
need_reset = 1;
return 1;
} else {
lz[py] ^= 1;
sz[px] += sz[py];
par[py] = px;
}
} else {
if (px != py) {
sz[px] += sz[py];
par[py] = px;
}
}
return 0;
}
void rollback(int k) {
need_reset = 0;
assert(T >= k);
while(k--) {
auto &c = stk[--T];
lz[c.x] = c.lzx,lz[c.y] = c.lzy,par[c.x] = c.parx,par[c.y] = c.pary,sz[c.x] = c.szx,sz[c.y] = c.szy;
}
}
};
DSU dsu;
bool solve_block(int block) {
int current_r = m - 1;
for (int i = max(0,(block - 1) * block_size); i < min(m,block * block_size); i++) {
if (dsu.unite(edges[i][0],edges[i][1])) {
for (int B = block; B < block_size; B++)
for (auto &[r,l,idx]: queries[B])
ans[idx] = 1;
return 1;
}
}
for (int i = 0, K = 0; i < queries[block].size();) {
auto &[r,l,idx] = queries[block][i];
while(K < queries[block].size() && get<0>(queries[block][K]) == r && get<1>(queries[block][K]) == l) K++;
bool RW = 0;
if (pref[l] || suff[m - r] || pref_suff[min(l,m - r)]) {
RW = 1;
} else {
while(current_r >= r) {
if (dsu.unite(edges[current_r][0],edges[current_r][1])) {
for (int j = i; j < queries[block].size(); j++) {
int idx2 = get<2>(queries[block][j]);
ans[idx2] = 1;
}
dsu.rollback(m - current_r); // potrebbero essere necessari dei +- 1
return 0;
}
current_r--;
}
--l;
int inserted = 0;
while(l >= block * block_size) {
// devo inserirlo
inserted++;
// cout << "edge index: " << l + 1 << endl;
if (dsu.unite(edges[l][0],edges[l][1])) {
RW = 1;
break;
}
l--;
}
dsu.rollback(inserted);
}
while(i < K) {
ans[get<2>(queries[block][i])] = RW;
i++;
}
}
dsu.rollback(m - current_r - 1);
return 0;
}
bool res[block_size][block_size];
void precomp() {
dsu.init();
for (int block = 0; block < block_size; block++) {
bool flag = 0;
int ins = 0;
for (int other = block_size - 1; other > block && !flag; other--) {
int l = other * block_size; // questo e' acceso!
int r = min(m,(other + 1) * block_size);
--r;
while(r >= l) {
ins++;
if (dsu.unite(edges[r][0],edges[r][1])) {
for (int O = other; O > block; O--)
res[block][O] = 1;
flag = 1;
dsu.rollback(ins);
ins = 0;
break;
}
r--;
}
}
dsu.rollback(ins);
assert(dsu.T == min(m,block * block_size));
for (int i = block_size * block; i < (block + 1) * block_size && i < m; i++) {
if (dsu.unite(edges[i][0],edges[i][1])) {
for (int BL = block + 1; BL < block_size; BL++)
for (int BR = BL + 1; BR < block_size; BR++)
res[BL][BR] = 1;
dsu.rollback(i + 1);
assert(dsu.T == 0);
return;
}
}
}
assert(dsu.T == m);
dsu.rollback(m);
}
bool FOUND_GLOBAL = 0;
void precomp2() {
dsu.init();
int i = 1;
while(i <= m && !dsu.unite(edges[i - 1][0],edges[i - 1][1])) i++;
FOUND_GLOBAL = (i != m + 1);
if (!FOUND_GLOBAL) {
dsu.rollback(m);
return;
}
dsu.rollback(i);
while(i <= m)
pref[i++] = 1;
i = 1;
while(i <= m && !dsu.unite(edges[m - i][0],edges[m - i][1])) i++;
dsu.rollback(i);
assert(dsu.T == 0);
while(i <= m)
suff[i++] = 1;
int l = 0, r = m - 1;
int p = 0;
bool f = 0;
while(l < r) {
p++;
if (dsu.unite(edges[l][0],edges[l][1])) {
f = 1;
break;
}
p++;
if (dsu.unite(edges[r][0],edges[r][1])) {
f = 1;
break;
}
l++,r--;
}
dsu.rollback(p);
assert(dsu.T == 0);
p = (p + 1) / 2;
while(p <= m)
pref_suff[p++] = f;
}
vector<bool> trova_cicli(int N, int M, int Q, vector<int> A, vector<int> B, vector<int> L, vector<int> R) {
n = N, m = M;
for (int i = 0; i < M; i++)
edges[i][0] = A[i],edges[i][1] = B[i];
// precomp(); too slow for now
precomp2();
dsu.init();
ans.resize(Q);
if (!FOUND_GLOBAL)
return ans;
for (int i = 0; i < Q; i++)
queries[L[i] / block_size].emplace_back(R[i],L[i],i);
for (int i = 0; i < block_size; i++)
sort(queries[i].rbegin(),queries[i].rend());
for (int i = 0; i < block_size; i++)
if (solve_block(i))
break;
return ans;
}
int main() {
int N,M,Q;
cin >> N >> M >> Q;
vector<int> A(M),B(M),L(Q),R(Q);
for (int i = 0; i < M; i++) {
cin >> A[i] >> B[i];
--A[i],--B[i];
}
for (int i = 0; i < Q; i++) {
cin >> L[i] >> R[i];
--L[i];
}
auto risposta = trova_cicli(N,M,Q,A,B,L,R);
for (int i = 0; i < Q; i++)
cout << (risposta[i] ? "YES" : "NO") << "\n";
}
Compilation message
Joker.cpp: In function 'bool solve_block(int)':
Joker.cpp:85:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::tuple<int, int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
85 | for (int i = 0, K = 0; i < queries[block].size();) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~
Joker.cpp:87:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::tuple<int, int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
87 | while(K < queries[block].size() && get<0>(queries[block][K]) == r && get<1>(queries[block][K]) == l) K++;
| ~~^~~~~~~~~~~~~~~~~~~~~~~
Joker.cpp:94:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::tuple<int, int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
94 | for (int j = i; j < queries[block].size(); j++) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6480 KB |
Output is correct |
2 |
Correct |
2 ms |
6480 KB |
Output is correct |
3 |
Correct |
2 ms |
6480 KB |
Output is correct |
4 |
Correct |
2 ms |
6480 KB |
Output is correct |
5 |
Correct |
2 ms |
6480 KB |
Output is correct |
6 |
Correct |
2 ms |
6480 KB |
Output is correct |
7 |
Correct |
1 ms |
6480 KB |
Output is correct |
8 |
Correct |
2 ms |
6480 KB |
Output is correct |
9 |
Correct |
2 ms |
6480 KB |
Output is correct |
10 |
Correct |
2 ms |
6480 KB |
Output is correct |
11 |
Correct |
2 ms |
6480 KB |
Output is correct |
12 |
Correct |
2 ms |
6480 KB |
Output is correct |
13 |
Correct |
2 ms |
6480 KB |
Output is correct |
14 |
Correct |
2 ms |
6480 KB |
Output is correct |
15 |
Correct |
2 ms |
6480 KB |
Output is correct |
16 |
Correct |
2 ms |
6480 KB |
Output is correct |
17 |
Correct |
2 ms |
6480 KB |
Output is correct |
18 |
Correct |
2 ms |
6480 KB |
Output is correct |
19 |
Correct |
2 ms |
6480 KB |
Output is correct |
20 |
Correct |
2 ms |
6648 KB |
Output is correct |
21 |
Correct |
2 ms |
6480 KB |
Output is correct |
22 |
Correct |
2 ms |
6480 KB |
Output is correct |
23 |
Correct |
2 ms |
6480 KB |
Output is correct |
24 |
Correct |
2 ms |
6480 KB |
Output is correct |
25 |
Correct |
2 ms |
6652 KB |
Output is correct |
26 |
Correct |
3 ms |
6480 KB |
Output is correct |
27 |
Correct |
2 ms |
6652 KB |
Output is correct |
28 |
Correct |
2 ms |
6480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6480 KB |
Output is correct |
2 |
Correct |
2 ms |
6480 KB |
Output is correct |
3 |
Correct |
2 ms |
6480 KB |
Output is correct |
4 |
Correct |
2 ms |
6480 KB |
Output is correct |
5 |
Correct |
2 ms |
6480 KB |
Output is correct |
6 |
Correct |
2 ms |
6480 KB |
Output is correct |
7 |
Correct |
1 ms |
6480 KB |
Output is correct |
8 |
Correct |
2 ms |
6480 KB |
Output is correct |
9 |
Correct |
2 ms |
6480 KB |
Output is correct |
10 |
Correct |
2 ms |
6480 KB |
Output is correct |
11 |
Correct |
2 ms |
6480 KB |
Output is correct |
12 |
Correct |
2 ms |
6480 KB |
Output is correct |
13 |
Correct |
2 ms |
6480 KB |
Output is correct |
14 |
Correct |
2 ms |
6480 KB |
Output is correct |
15 |
Correct |
2 ms |
6480 KB |
Output is correct |
16 |
Correct |
2 ms |
6480 KB |
Output is correct |
17 |
Correct |
2 ms |
6480 KB |
Output is correct |
18 |
Correct |
2 ms |
6480 KB |
Output is correct |
19 |
Correct |
2 ms |
6480 KB |
Output is correct |
20 |
Correct |
2 ms |
6648 KB |
Output is correct |
21 |
Correct |
2 ms |
6480 KB |
Output is correct |
22 |
Correct |
2 ms |
6480 KB |
Output is correct |
23 |
Correct |
2 ms |
6480 KB |
Output is correct |
24 |
Correct |
2 ms |
6480 KB |
Output is correct |
25 |
Correct |
2 ms |
6652 KB |
Output is correct |
26 |
Correct |
3 ms |
6480 KB |
Output is correct |
27 |
Correct |
2 ms |
6652 KB |
Output is correct |
28 |
Correct |
2 ms |
6480 KB |
Output is correct |
29 |
Correct |
3 ms |
6480 KB |
Output is correct |
30 |
Correct |
5 ms |
6480 KB |
Output is correct |
31 |
Correct |
5 ms |
6736 KB |
Output is correct |
32 |
Correct |
4 ms |
6480 KB |
Output is correct |
33 |
Correct |
4 ms |
6736 KB |
Output is correct |
34 |
Correct |
4 ms |
6736 KB |
Output is correct |
35 |
Correct |
6 ms |
6736 KB |
Output is correct |
36 |
Correct |
5 ms |
6736 KB |
Output is correct |
37 |
Correct |
7 ms |
6736 KB |
Output is correct |
38 |
Correct |
3 ms |
6648 KB |
Output is correct |
39 |
Correct |
6 ms |
6480 KB |
Output is correct |
40 |
Correct |
5 ms |
6480 KB |
Output is correct |
41 |
Correct |
5 ms |
6676 KB |
Output is correct |
42 |
Correct |
5 ms |
6480 KB |
Output is correct |
43 |
Correct |
4 ms |
6904 KB |
Output is correct |
44 |
Correct |
4 ms |
6672 KB |
Output is correct |
45 |
Correct |
4 ms |
6480 KB |
Output is correct |
46 |
Correct |
5 ms |
6736 KB |
Output is correct |
47 |
Correct |
5 ms |
6672 KB |
Output is correct |
48 |
Correct |
5 ms |
6480 KB |
Output is correct |
49 |
Correct |
5 ms |
6480 KB |
Output is correct |
50 |
Correct |
5 ms |
6480 KB |
Output is correct |
51 |
Correct |
5 ms |
6736 KB |
Output is correct |
52 |
Correct |
5 ms |
6480 KB |
Output is correct |
53 |
Correct |
5 ms |
6480 KB |
Output is correct |
54 |
Correct |
5 ms |
6480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6480 KB |
Output is correct |
2 |
Correct |
2 ms |
6480 KB |
Output is correct |
3 |
Correct |
158 ms |
19072 KB |
Output is correct |
4 |
Correct |
126 ms |
17480 KB |
Output is correct |
5 |
Correct |
175 ms |
21180 KB |
Output is correct |
6 |
Correct |
163 ms |
21436 KB |
Output is correct |
7 |
Correct |
155 ms |
19132 KB |
Output is correct |
8 |
Correct |
156 ms |
20972 KB |
Output is correct |
9 |
Correct |
162 ms |
21180 KB |
Output is correct |
10 |
Correct |
170 ms |
21188 KB |
Output is correct |
11 |
Correct |
158 ms |
19132 KB |
Output is correct |
12 |
Correct |
170 ms |
21484 KB |
Output is correct |
13 |
Correct |
187 ms |
21436 KB |
Output is correct |
14 |
Correct |
165 ms |
19068 KB |
Output is correct |
15 |
Correct |
171 ms |
19064 KB |
Output is correct |
16 |
Correct |
173 ms |
21436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6480 KB |
Output is correct |
2 |
Correct |
2 ms |
6480 KB |
Output is correct |
3 |
Correct |
2 ms |
6480 KB |
Output is correct |
4 |
Correct |
2 ms |
6480 KB |
Output is correct |
5 |
Correct |
2 ms |
6480 KB |
Output is correct |
6 |
Correct |
2 ms |
6480 KB |
Output is correct |
7 |
Correct |
1 ms |
6480 KB |
Output is correct |
8 |
Correct |
2 ms |
6480 KB |
Output is correct |
9 |
Correct |
2 ms |
6480 KB |
Output is correct |
10 |
Correct |
2 ms |
6480 KB |
Output is correct |
11 |
Correct |
2 ms |
6480 KB |
Output is correct |
12 |
Correct |
2 ms |
6480 KB |
Output is correct |
13 |
Correct |
2 ms |
6480 KB |
Output is correct |
14 |
Correct |
2 ms |
6480 KB |
Output is correct |
15 |
Correct |
2 ms |
6480 KB |
Output is correct |
16 |
Correct |
2 ms |
6480 KB |
Output is correct |
17 |
Correct |
2 ms |
6480 KB |
Output is correct |
18 |
Correct |
2 ms |
6480 KB |
Output is correct |
19 |
Correct |
2 ms |
6480 KB |
Output is correct |
20 |
Correct |
2 ms |
6648 KB |
Output is correct |
21 |
Correct |
2 ms |
6480 KB |
Output is correct |
22 |
Correct |
2 ms |
6480 KB |
Output is correct |
23 |
Correct |
2 ms |
6480 KB |
Output is correct |
24 |
Correct |
2 ms |
6480 KB |
Output is correct |
25 |
Correct |
2 ms |
6652 KB |
Output is correct |
26 |
Correct |
3 ms |
6480 KB |
Output is correct |
27 |
Correct |
2 ms |
6652 KB |
Output is correct |
28 |
Correct |
2 ms |
6480 KB |
Output is correct |
29 |
Correct |
158 ms |
19072 KB |
Output is correct |
30 |
Correct |
126 ms |
17480 KB |
Output is correct |
31 |
Correct |
175 ms |
21180 KB |
Output is correct |
32 |
Correct |
163 ms |
21436 KB |
Output is correct |
33 |
Correct |
155 ms |
19132 KB |
Output is correct |
34 |
Correct |
156 ms |
20972 KB |
Output is correct |
35 |
Correct |
162 ms |
21180 KB |
Output is correct |
36 |
Correct |
170 ms |
21188 KB |
Output is correct |
37 |
Correct |
158 ms |
19132 KB |
Output is correct |
38 |
Correct |
170 ms |
21484 KB |
Output is correct |
39 |
Correct |
187 ms |
21436 KB |
Output is correct |
40 |
Correct |
165 ms |
19068 KB |
Output is correct |
41 |
Correct |
171 ms |
19064 KB |
Output is correct |
42 |
Correct |
173 ms |
21436 KB |
Output is correct |
43 |
Correct |
288 ms |
19132 KB |
Output is correct |
44 |
Correct |
157 ms |
19840 KB |
Output is correct |
45 |
Correct |
263 ms |
23648 KB |
Output is correct |
46 |
Correct |
197 ms |
21436 KB |
Output is correct |
47 |
Correct |
191 ms |
21376 KB |
Output is correct |
48 |
Correct |
216 ms |
21064 KB |
Output is correct |
49 |
Correct |
224 ms |
21436 KB |
Output is correct |
50 |
Correct |
205 ms |
19132 KB |
Output is correct |
51 |
Correct |
218 ms |
19132 KB |
Output is correct |
52 |
Correct |
214 ms |
19132 KB |
Output is correct |
53 |
Correct |
201 ms |
19132 KB |
Output is correct |
54 |
Correct |
195 ms |
19132 KB |
Output is correct |
55 |
Correct |
212 ms |
21436 KB |
Output is correct |
56 |
Correct |
230 ms |
21692 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6480 KB |
Output is correct |
2 |
Correct |
2 ms |
6480 KB |
Output is correct |
3 |
Correct |
2 ms |
6480 KB |
Output is correct |
4 |
Correct |
2 ms |
6480 KB |
Output is correct |
5 |
Correct |
2 ms |
6480 KB |
Output is correct |
6 |
Correct |
2 ms |
6480 KB |
Output is correct |
7 |
Correct |
1 ms |
6480 KB |
Output is correct |
8 |
Correct |
2 ms |
6480 KB |
Output is correct |
9 |
Correct |
2 ms |
6480 KB |
Output is correct |
10 |
Correct |
2 ms |
6480 KB |
Output is correct |
11 |
Correct |
2 ms |
6480 KB |
Output is correct |
12 |
Correct |
2 ms |
6480 KB |
Output is correct |
13 |
Correct |
2 ms |
6480 KB |
Output is correct |
14 |
Correct |
2 ms |
6480 KB |
Output is correct |
15 |
Correct |
2 ms |
6480 KB |
Output is correct |
16 |
Correct |
2 ms |
6480 KB |
Output is correct |
17 |
Correct |
2 ms |
6480 KB |
Output is correct |
18 |
Correct |
2 ms |
6480 KB |
Output is correct |
19 |
Correct |
2 ms |
6480 KB |
Output is correct |
20 |
Correct |
2 ms |
6648 KB |
Output is correct |
21 |
Correct |
2 ms |
6480 KB |
Output is correct |
22 |
Correct |
2 ms |
6480 KB |
Output is correct |
23 |
Correct |
2 ms |
6480 KB |
Output is correct |
24 |
Correct |
2 ms |
6480 KB |
Output is correct |
25 |
Correct |
2 ms |
6652 KB |
Output is correct |
26 |
Correct |
3 ms |
6480 KB |
Output is correct |
27 |
Correct |
2 ms |
6652 KB |
Output is correct |
28 |
Correct |
2 ms |
6480 KB |
Output is correct |
29 |
Correct |
3 ms |
6480 KB |
Output is correct |
30 |
Correct |
5 ms |
6480 KB |
Output is correct |
31 |
Correct |
5 ms |
6736 KB |
Output is correct |
32 |
Correct |
4 ms |
6480 KB |
Output is correct |
33 |
Correct |
4 ms |
6736 KB |
Output is correct |
34 |
Correct |
4 ms |
6736 KB |
Output is correct |
35 |
Correct |
6 ms |
6736 KB |
Output is correct |
36 |
Correct |
5 ms |
6736 KB |
Output is correct |
37 |
Correct |
7 ms |
6736 KB |
Output is correct |
38 |
Correct |
3 ms |
6648 KB |
Output is correct |
39 |
Correct |
6 ms |
6480 KB |
Output is correct |
40 |
Correct |
5 ms |
6480 KB |
Output is correct |
41 |
Correct |
5 ms |
6676 KB |
Output is correct |
42 |
Correct |
5 ms |
6480 KB |
Output is correct |
43 |
Correct |
4 ms |
6904 KB |
Output is correct |
44 |
Correct |
4 ms |
6672 KB |
Output is correct |
45 |
Correct |
4 ms |
6480 KB |
Output is correct |
46 |
Correct |
5 ms |
6736 KB |
Output is correct |
47 |
Correct |
5 ms |
6672 KB |
Output is correct |
48 |
Correct |
5 ms |
6480 KB |
Output is correct |
49 |
Correct |
5 ms |
6480 KB |
Output is correct |
50 |
Correct |
5 ms |
6480 KB |
Output is correct |
51 |
Correct |
5 ms |
6736 KB |
Output is correct |
52 |
Correct |
5 ms |
6480 KB |
Output is correct |
53 |
Correct |
5 ms |
6480 KB |
Output is correct |
54 |
Correct |
5 ms |
6480 KB |
Output is correct |
55 |
Correct |
307 ms |
12360 KB |
Output is correct |
56 |
Correct |
78 ms |
15944 KB |
Output is correct |
57 |
Correct |
89 ms |
15944 KB |
Output is correct |
58 |
Correct |
80 ms |
13924 KB |
Output is correct |
59 |
Correct |
110 ms |
12368 KB |
Output is correct |
60 |
Correct |
184 ms |
13896 KB |
Output is correct |
61 |
Correct |
207 ms |
13796 KB |
Output is correct |
62 |
Correct |
339 ms |
12280 KB |
Output is correct |
63 |
Correct |
122 ms |
13640 KB |
Output is correct |
64 |
Correct |
217 ms |
12360 KB |
Output is correct |
65 |
Correct |
376 ms |
13892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6480 KB |
Output is correct |
2 |
Correct |
2 ms |
6480 KB |
Output is correct |
3 |
Correct |
2 ms |
6480 KB |
Output is correct |
4 |
Correct |
2 ms |
6480 KB |
Output is correct |
5 |
Correct |
2 ms |
6480 KB |
Output is correct |
6 |
Correct |
2 ms |
6480 KB |
Output is correct |
7 |
Correct |
1 ms |
6480 KB |
Output is correct |
8 |
Correct |
2 ms |
6480 KB |
Output is correct |
9 |
Correct |
2 ms |
6480 KB |
Output is correct |
10 |
Correct |
2 ms |
6480 KB |
Output is correct |
11 |
Correct |
2 ms |
6480 KB |
Output is correct |
12 |
Correct |
2 ms |
6480 KB |
Output is correct |
13 |
Correct |
2 ms |
6480 KB |
Output is correct |
14 |
Correct |
2 ms |
6480 KB |
Output is correct |
15 |
Correct |
2 ms |
6480 KB |
Output is correct |
16 |
Correct |
2 ms |
6480 KB |
Output is correct |
17 |
Correct |
2 ms |
6480 KB |
Output is correct |
18 |
Correct |
2 ms |
6480 KB |
Output is correct |
19 |
Correct |
2 ms |
6480 KB |
Output is correct |
20 |
Correct |
2 ms |
6648 KB |
Output is correct |
21 |
Correct |
2 ms |
6480 KB |
Output is correct |
22 |
Correct |
2 ms |
6480 KB |
Output is correct |
23 |
Correct |
2 ms |
6480 KB |
Output is correct |
24 |
Correct |
2 ms |
6480 KB |
Output is correct |
25 |
Correct |
2 ms |
6652 KB |
Output is correct |
26 |
Correct |
3 ms |
6480 KB |
Output is correct |
27 |
Correct |
2 ms |
6652 KB |
Output is correct |
28 |
Correct |
2 ms |
6480 KB |
Output is correct |
29 |
Correct |
3 ms |
6480 KB |
Output is correct |
30 |
Correct |
5 ms |
6480 KB |
Output is correct |
31 |
Correct |
5 ms |
6736 KB |
Output is correct |
32 |
Correct |
4 ms |
6480 KB |
Output is correct |
33 |
Correct |
4 ms |
6736 KB |
Output is correct |
34 |
Correct |
4 ms |
6736 KB |
Output is correct |
35 |
Correct |
6 ms |
6736 KB |
Output is correct |
36 |
Correct |
5 ms |
6736 KB |
Output is correct |
37 |
Correct |
7 ms |
6736 KB |
Output is correct |
38 |
Correct |
3 ms |
6648 KB |
Output is correct |
39 |
Correct |
6 ms |
6480 KB |
Output is correct |
40 |
Correct |
5 ms |
6480 KB |
Output is correct |
41 |
Correct |
5 ms |
6676 KB |
Output is correct |
42 |
Correct |
5 ms |
6480 KB |
Output is correct |
43 |
Correct |
4 ms |
6904 KB |
Output is correct |
44 |
Correct |
4 ms |
6672 KB |
Output is correct |
45 |
Correct |
4 ms |
6480 KB |
Output is correct |
46 |
Correct |
5 ms |
6736 KB |
Output is correct |
47 |
Correct |
5 ms |
6672 KB |
Output is correct |
48 |
Correct |
5 ms |
6480 KB |
Output is correct |
49 |
Correct |
5 ms |
6480 KB |
Output is correct |
50 |
Correct |
5 ms |
6480 KB |
Output is correct |
51 |
Correct |
5 ms |
6736 KB |
Output is correct |
52 |
Correct |
5 ms |
6480 KB |
Output is correct |
53 |
Correct |
5 ms |
6480 KB |
Output is correct |
54 |
Correct |
5 ms |
6480 KB |
Output is correct |
55 |
Correct |
158 ms |
19072 KB |
Output is correct |
56 |
Correct |
126 ms |
17480 KB |
Output is correct |
57 |
Correct |
175 ms |
21180 KB |
Output is correct |
58 |
Correct |
163 ms |
21436 KB |
Output is correct |
59 |
Correct |
155 ms |
19132 KB |
Output is correct |
60 |
Correct |
156 ms |
20972 KB |
Output is correct |
61 |
Correct |
162 ms |
21180 KB |
Output is correct |
62 |
Correct |
170 ms |
21188 KB |
Output is correct |
63 |
Correct |
158 ms |
19132 KB |
Output is correct |
64 |
Correct |
170 ms |
21484 KB |
Output is correct |
65 |
Correct |
187 ms |
21436 KB |
Output is correct |
66 |
Correct |
165 ms |
19068 KB |
Output is correct |
67 |
Correct |
171 ms |
19064 KB |
Output is correct |
68 |
Correct |
173 ms |
21436 KB |
Output is correct |
69 |
Correct |
288 ms |
19132 KB |
Output is correct |
70 |
Correct |
157 ms |
19840 KB |
Output is correct |
71 |
Correct |
263 ms |
23648 KB |
Output is correct |
72 |
Correct |
197 ms |
21436 KB |
Output is correct |
73 |
Correct |
191 ms |
21376 KB |
Output is correct |
74 |
Correct |
216 ms |
21064 KB |
Output is correct |
75 |
Correct |
224 ms |
21436 KB |
Output is correct |
76 |
Correct |
205 ms |
19132 KB |
Output is correct |
77 |
Correct |
218 ms |
19132 KB |
Output is correct |
78 |
Correct |
214 ms |
19132 KB |
Output is correct |
79 |
Correct |
201 ms |
19132 KB |
Output is correct |
80 |
Correct |
195 ms |
19132 KB |
Output is correct |
81 |
Correct |
212 ms |
21436 KB |
Output is correct |
82 |
Correct |
230 ms |
21692 KB |
Output is correct |
83 |
Correct |
307 ms |
12360 KB |
Output is correct |
84 |
Correct |
78 ms |
15944 KB |
Output is correct |
85 |
Correct |
89 ms |
15944 KB |
Output is correct |
86 |
Correct |
80 ms |
13924 KB |
Output is correct |
87 |
Correct |
110 ms |
12368 KB |
Output is correct |
88 |
Correct |
184 ms |
13896 KB |
Output is correct |
89 |
Correct |
207 ms |
13796 KB |
Output is correct |
90 |
Correct |
339 ms |
12280 KB |
Output is correct |
91 |
Correct |
122 ms |
13640 KB |
Output is correct |
92 |
Correct |
217 ms |
12360 KB |
Output is correct |
93 |
Correct |
376 ms |
13892 KB |
Output is correct |
94 |
Correct |
572 ms |
21300 KB |
Output is correct |
95 |
Correct |
1611 ms |
20484 KB |
Output is correct |
96 |
Correct |
462 ms |
23376 KB |
Output is correct |
97 |
Correct |
340 ms |
18440 KB |
Output is correct |
98 |
Correct |
361 ms |
18484 KB |
Output is correct |
99 |
Correct |
223 ms |
18504 KB |
Output is correct |
100 |
Correct |
299 ms |
21324 KB |
Output is correct |
101 |
Correct |
453 ms |
18504 KB |
Output is correct |
102 |
Correct |
607 ms |
18440 KB |
Output is correct |
103 |
Correct |
778 ms |
18504 KB |
Output is correct |
104 |
Correct |
377 ms |
18444 KB |
Output is correct |
105 |
Correct |
562 ms |
21216 KB |
Output is correct |
106 |
Correct |
782 ms |
18532 KB |
Output is correct |
107 |
Correct |
194 ms |
23996 KB |
Output is correct |
108 |
Correct |
793 ms |
21156 KB |
Output is correct |
109 |
Correct |
831 ms |
21008 KB |
Output is correct |
110 |
Correct |
859 ms |
18248 KB |
Output is correct |
111 |
Correct |
862 ms |
18436 KB |
Output is correct |
112 |
Correct |
876 ms |
18508 KB |
Output is correct |
113 |
Correct |
879 ms |
18524 KB |
Output is correct |
114 |
Correct |
876 ms |
18504 KB |
Output is correct |
115 |
Correct |
864 ms |
18504 KB |
Output is correct |
116 |
Correct |
833 ms |
18504 KB |
Output is correct |