/**
* Task: parks
* Author: Kian Mirjalali
* Solution: Correct solution based on chessboard coloring of cells (trees)
* Time: O(n*log(n))
* It uses a tree map to find the index of a vertex by its coordinate.
*/
#include "parks.h"
#include <complex>
#include <map>
using namespace std;
#define tpc(C) template<class C>
#define allOf(c) ((c).begin()), ((c).end())
#define fori(i, a, b) for (int i = (a); i < int(b); i++)
#define forn(i, n) fori(i, 0, (n))
#define dbg(x) #x << "=" << (x)
#define show(x) cerr << dbg(x) << endl
#define cmpret(a, b) do { if ((a) != (b)) return ((a) < (b)); } while (false)
tpc(C) inline int sz(const C& c) { return c.size(); }
typedef vector<int> VI;
typedef complex<int> Point;
#define X real()
#define Y imag()
/////////////////////////
const Point MOVES[] = {
{-2, 0},
{+2, 0},
{0, -2},
{0, +2},
};
const int LEFT = 0;
const int RIGHT = 1;
const int UP = 3;
/////////////////////////
struct PointCmp {
inline bool operator()(const Point &a, const Point &b) const {
cmpret(a.X, b.X);
return a.Y < b.Y;
}
};
class Point2Index {
map<Point, int, PointCmp> p2i;
public:
inline Point2Index() {
}
inline void put(const Point& p, int i) {
p2i[p] = i;
}
inline int get(const Point& p) const {
auto it = p2i.find(p);
return (it == p2i.end()) ? -1 : it->second;
}
inline bool contains(const Point& p) const {
return p2i.find(p) != p2i.end();
}
};
/////////////////////////
VI q, mark;
inline void enq(int x) {
if (mark[x])
return;
mark[x] = true;
q.push_back(x);
}
/////////////////////////
int construct_roads(VI x, VI y) {
int n = x.size();
vector<Point> vertex(n);
Point2Index v2i;
forn(i, n) {
vertex[i] = Point(x[i], y[i]);
v2i.put(vertex[i], i);
}
{// Check connectivity
q.clear();
q.reserve(n);
mark.assign(n, false);
enq(0);
for (int tail = 0; tail < sz(q); tail++) {
Point p = vertex[q[tail]];
for (auto& mov : MOVES) {
int nei = v2i.get(p+mov);
if (nei >= 0)
enq(nei);
}
}
if (sz(q) != n)
return 0;
}
VI u, v, a, b;
forn(i, n) {
Point pi = vertex[i];
bool is_white_cell = (((pi.X+pi.Y)&2) == 0);
{
Point pj = pi + MOVES[RIGHT];
int j = v2i.get(pj);
if ((j >= 0) && !(v2i.contains(pi+MOVES[UP]) && v2i.contains(pj+MOVES[UP]) && is_white_cell)) {
u.push_back(i);
v.push_back(j);
a.push_back(pi.X+1);
b.push_back(pi.Y+(is_white_cell?+1:-1));
}
}
{
Point pj = pi + MOVES[UP];
int j = v2i.get(pj);
if ((j >= 0) && !(v2i.contains(pi+MOVES[LEFT]) && v2i.contains(pj+MOVES[LEFT]) && is_white_cell)) {
u.push_back(i);
v.push_back(j);
a.push_back(pi.X+(is_white_cell?-1:+1));
b.push_back(pi.Y+1);
}
}
}
build(u, v, a, b);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
292 KB |
Output is correct |
9 |
Correct |
158 ms |
15300 KB |
Output is correct |
10 |
Correct |
12 ms |
2004 KB |
Output is correct |
11 |
Correct |
79 ms |
8444 KB |
Output is correct |
12 |
Correct |
21 ms |
2732 KB |
Output is correct |
13 |
Correct |
34 ms |
4664 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
147 ms |
15256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
292 KB |
Output is correct |
9 |
Correct |
158 ms |
15300 KB |
Output is correct |
10 |
Correct |
12 ms |
2004 KB |
Output is correct |
11 |
Correct |
79 ms |
8444 KB |
Output is correct |
12 |
Correct |
21 ms |
2732 KB |
Output is correct |
13 |
Correct |
34 ms |
4664 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
147 ms |
15256 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
546 ms |
30228 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
416 KB |
Output is correct |
26 |
Correct |
2 ms |
552 KB |
Output is correct |
27 |
Correct |
2 ms |
680 KB |
Output is correct |
28 |
Correct |
125 ms |
12312 KB |
Output is correct |
29 |
Correct |
278 ms |
18356 KB |
Output is correct |
30 |
Correct |
398 ms |
24284 KB |
Output is correct |
31 |
Correct |
501 ms |
30244 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
0 ms |
212 KB |
Output is correct |
39 |
Correct |
0 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
0 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
428 KB |
Output is correct |
44 |
Correct |
2 ms |
580 KB |
Output is correct |
45 |
Correct |
199 ms |
15344 KB |
Output is correct |
46 |
Correct |
310 ms |
21976 KB |
Output is correct |
47 |
Correct |
339 ms |
21992 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
292 KB |
Output is correct |
9 |
Correct |
158 ms |
15300 KB |
Output is correct |
10 |
Correct |
12 ms |
2004 KB |
Output is correct |
11 |
Correct |
79 ms |
8444 KB |
Output is correct |
12 |
Correct |
21 ms |
2732 KB |
Output is correct |
13 |
Correct |
34 ms |
4664 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
147 ms |
15256 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
546 ms |
30228 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
416 KB |
Output is correct |
26 |
Correct |
2 ms |
552 KB |
Output is correct |
27 |
Correct |
2 ms |
680 KB |
Output is correct |
28 |
Correct |
125 ms |
12312 KB |
Output is correct |
29 |
Correct |
278 ms |
18356 KB |
Output is correct |
30 |
Correct |
398 ms |
24284 KB |
Output is correct |
31 |
Correct |
501 ms |
30244 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
0 ms |
212 KB |
Output is correct |
39 |
Correct |
0 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
0 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
428 KB |
Output is correct |
44 |
Correct |
2 ms |
580 KB |
Output is correct |
45 |
Correct |
199 ms |
15344 KB |
Output is correct |
46 |
Correct |
310 ms |
21976 KB |
Output is correct |
47 |
Correct |
339 ms |
21992 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
212 KB |
Output is correct |
51 |
Correct |
0 ms |
288 KB |
Output is correct |
52 |
Correct |
0 ms |
212 KB |
Output is correct |
53 |
Correct |
0 ms |
212 KB |
Output is correct |
54 |
Correct |
0 ms |
212 KB |
Output is correct |
55 |
Correct |
597 ms |
30208 KB |
Output is correct |
56 |
Correct |
1 ms |
212 KB |
Output is correct |
57 |
Correct |
2 ms |
552 KB |
Output is correct |
58 |
Correct |
8 ms |
1236 KB |
Output is correct |
59 |
Correct |
5 ms |
1268 KB |
Output is correct |
60 |
Correct |
215 ms |
15256 KB |
Output is correct |
61 |
Correct |
365 ms |
20428 KB |
Output is correct |
62 |
Correct |
448 ms |
25048 KB |
Output is correct |
63 |
Correct |
600 ms |
30224 KB |
Output is correct |
64 |
Correct |
1 ms |
212 KB |
Output is correct |
65 |
Correct |
1 ms |
212 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
392 ms |
30224 KB |
Output is correct |
68 |
Correct |
416 ms |
30252 KB |
Output is correct |
69 |
Correct |
416 ms |
30068 KB |
Output is correct |
70 |
Correct |
3 ms |
596 KB |
Output is correct |
71 |
Correct |
4 ms |
980 KB |
Output is correct |
72 |
Correct |
204 ms |
15300 KB |
Output is correct |
73 |
Correct |
338 ms |
22844 KB |
Output is correct |
74 |
Correct |
579 ms |
30236 KB |
Output is correct |
75 |
Correct |
521 ms |
32056 KB |
Output is correct |
76 |
Correct |
395 ms |
30232 KB |
Output is correct |
77 |
Correct |
3 ms |
724 KB |
Output is correct |
78 |
Correct |
5 ms |
1064 KB |
Output is correct |
79 |
Correct |
168 ms |
15676 KB |
Output is correct |
80 |
Correct |
323 ms |
23712 KB |
Output is correct |
81 |
Correct |
550 ms |
31232 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
292 KB |
Output is correct |
9 |
Correct |
158 ms |
15300 KB |
Output is correct |
10 |
Correct |
12 ms |
2004 KB |
Output is correct |
11 |
Correct |
79 ms |
8444 KB |
Output is correct |
12 |
Correct |
21 ms |
2732 KB |
Output is correct |
13 |
Correct |
34 ms |
4664 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
147 ms |
15256 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
526 ms |
30452 KB |
Output is correct |
21 |
Correct |
546 ms |
30412 KB |
Output is correct |
22 |
Correct |
486 ms |
30372 KB |
Output is correct |
23 |
Correct |
380 ms |
26032 KB |
Output is correct |
24 |
Correct |
158 ms |
19928 KB |
Output is correct |
25 |
Correct |
162 ms |
19844 KB |
Output is correct |
26 |
Correct |
162 ms |
19884 KB |
Output is correct |
27 |
Correct |
525 ms |
30184 KB |
Output is correct |
28 |
Correct |
497 ms |
30196 KB |
Output is correct |
29 |
Correct |
543 ms |
30268 KB |
Output is correct |
30 |
Correct |
493 ms |
30220 KB |
Output is correct |
31 |
Correct |
0 ms |
212 KB |
Output is correct |
32 |
Correct |
19 ms |
2728 KB |
Output is correct |
33 |
Correct |
53 ms |
10528 KB |
Output is correct |
34 |
Correct |
509 ms |
30404 KB |
Output is correct |
35 |
Correct |
9 ms |
1236 KB |
Output is correct |
36 |
Correct |
29 ms |
5404 KB |
Output is correct |
37 |
Correct |
92 ms |
10576 KB |
Output is correct |
38 |
Correct |
177 ms |
12776 KB |
Output is correct |
39 |
Correct |
231 ms |
17292 KB |
Output is correct |
40 |
Correct |
375 ms |
21876 KB |
Output is correct |
41 |
Correct |
490 ms |
26236 KB |
Output is correct |
42 |
Correct |
623 ms |
30404 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
0 ms |
212 KB |
Output is correct |
45 |
Correct |
0 ms |
284 KB |
Output is correct |
46 |
Correct |
0 ms |
212 KB |
Output is correct |
47 |
Correct |
1 ms |
288 KB |
Output is correct |
48 |
Correct |
0 ms |
212 KB |
Output is correct |
49 |
Correct |
0 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
212 KB |
Output is correct |
51 |
Correct |
0 ms |
212 KB |
Output is correct |
52 |
Correct |
0 ms |
212 KB |
Output is correct |
53 |
Correct |
0 ms |
212 KB |
Output is correct |
54 |
Correct |
1 ms |
468 KB |
Output is correct |
55 |
Correct |
2 ms |
468 KB |
Output is correct |
56 |
Correct |
204 ms |
15336 KB |
Output is correct |
57 |
Correct |
282 ms |
22016 KB |
Output is correct |
58 |
Correct |
284 ms |
22004 KB |
Output is correct |
59 |
Correct |
1 ms |
212 KB |
Output is correct |
60 |
Correct |
1 ms |
212 KB |
Output is correct |
61 |
Correct |
0 ms |
284 KB |
Output is correct |
62 |
Correct |
381 ms |
30260 KB |
Output is correct |
63 |
Correct |
417 ms |
30188 KB |
Output is correct |
64 |
Correct |
416 ms |
30044 KB |
Output is correct |
65 |
Correct |
3 ms |
596 KB |
Output is correct |
66 |
Correct |
4 ms |
980 KB |
Output is correct |
67 |
Correct |
207 ms |
15256 KB |
Output is correct |
68 |
Correct |
351 ms |
22804 KB |
Output is correct |
69 |
Correct |
531 ms |
30216 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
292 KB |
Output is correct |
9 |
Correct |
158 ms |
15300 KB |
Output is correct |
10 |
Correct |
12 ms |
2004 KB |
Output is correct |
11 |
Correct |
79 ms |
8444 KB |
Output is correct |
12 |
Correct |
21 ms |
2732 KB |
Output is correct |
13 |
Correct |
34 ms |
4664 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
147 ms |
15256 KB |
Output is correct |
17 |
Correct |
468 ms |
30304 KB |
Output is correct |
18 |
Correct |
434 ms |
30312 KB |
Output is correct |
19 |
Correct |
513 ms |
30416 KB |
Output is correct |
20 |
Correct |
663 ms |
32728 KB |
Output is correct |
21 |
Correct |
512 ms |
27408 KB |
Output is correct |
22 |
Correct |
1 ms |
212 KB |
Output is correct |
23 |
Correct |
53 ms |
5328 KB |
Output is correct |
24 |
Correct |
14 ms |
2380 KB |
Output is correct |
25 |
Correct |
45 ms |
7488 KB |
Output is correct |
26 |
Correct |
96 ms |
12492 KB |
Output is correct |
27 |
Correct |
239 ms |
16684 KB |
Output is correct |
28 |
Correct |
340 ms |
20904 KB |
Output is correct |
29 |
Correct |
384 ms |
24688 KB |
Output is correct |
30 |
Correct |
546 ms |
28484 KB |
Output is correct |
31 |
Correct |
632 ms |
32332 KB |
Output is correct |
32 |
Correct |
539 ms |
32056 KB |
Output is correct |
33 |
Correct |
435 ms |
30364 KB |
Output is correct |
34 |
Correct |
3 ms |
684 KB |
Output is correct |
35 |
Correct |
5 ms |
1108 KB |
Output is correct |
36 |
Correct |
187 ms |
15864 KB |
Output is correct |
37 |
Correct |
333 ms |
23528 KB |
Output is correct |
38 |
Correct |
545 ms |
31180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
292 KB |
Output is correct |
9 |
Correct |
158 ms |
15300 KB |
Output is correct |
10 |
Correct |
12 ms |
2004 KB |
Output is correct |
11 |
Correct |
79 ms |
8444 KB |
Output is correct |
12 |
Correct |
21 ms |
2732 KB |
Output is correct |
13 |
Correct |
34 ms |
4664 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
147 ms |
15256 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
546 ms |
30228 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
416 KB |
Output is correct |
26 |
Correct |
2 ms |
552 KB |
Output is correct |
27 |
Correct |
2 ms |
680 KB |
Output is correct |
28 |
Correct |
125 ms |
12312 KB |
Output is correct |
29 |
Correct |
278 ms |
18356 KB |
Output is correct |
30 |
Correct |
398 ms |
24284 KB |
Output is correct |
31 |
Correct |
501 ms |
30244 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
0 ms |
212 KB |
Output is correct |
39 |
Correct |
0 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
0 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
428 KB |
Output is correct |
44 |
Correct |
2 ms |
580 KB |
Output is correct |
45 |
Correct |
199 ms |
15344 KB |
Output is correct |
46 |
Correct |
310 ms |
21976 KB |
Output is correct |
47 |
Correct |
339 ms |
21992 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
212 KB |
Output is correct |
51 |
Correct |
0 ms |
288 KB |
Output is correct |
52 |
Correct |
0 ms |
212 KB |
Output is correct |
53 |
Correct |
0 ms |
212 KB |
Output is correct |
54 |
Correct |
0 ms |
212 KB |
Output is correct |
55 |
Correct |
597 ms |
30208 KB |
Output is correct |
56 |
Correct |
1 ms |
212 KB |
Output is correct |
57 |
Correct |
2 ms |
552 KB |
Output is correct |
58 |
Correct |
8 ms |
1236 KB |
Output is correct |
59 |
Correct |
5 ms |
1268 KB |
Output is correct |
60 |
Correct |
215 ms |
15256 KB |
Output is correct |
61 |
Correct |
365 ms |
20428 KB |
Output is correct |
62 |
Correct |
448 ms |
25048 KB |
Output is correct |
63 |
Correct |
600 ms |
30224 KB |
Output is correct |
64 |
Correct |
1 ms |
212 KB |
Output is correct |
65 |
Correct |
1 ms |
212 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
392 ms |
30224 KB |
Output is correct |
68 |
Correct |
416 ms |
30252 KB |
Output is correct |
69 |
Correct |
416 ms |
30068 KB |
Output is correct |
70 |
Correct |
3 ms |
596 KB |
Output is correct |
71 |
Correct |
4 ms |
980 KB |
Output is correct |
72 |
Correct |
204 ms |
15300 KB |
Output is correct |
73 |
Correct |
338 ms |
22844 KB |
Output is correct |
74 |
Correct |
579 ms |
30236 KB |
Output is correct |
75 |
Correct |
521 ms |
32056 KB |
Output is correct |
76 |
Correct |
395 ms |
30232 KB |
Output is correct |
77 |
Correct |
3 ms |
724 KB |
Output is correct |
78 |
Correct |
5 ms |
1064 KB |
Output is correct |
79 |
Correct |
168 ms |
15676 KB |
Output is correct |
80 |
Correct |
323 ms |
23712 KB |
Output is correct |
81 |
Correct |
550 ms |
31232 KB |
Output is correct |
82 |
Correct |
1 ms |
212 KB |
Output is correct |
83 |
Correct |
1 ms |
212 KB |
Output is correct |
84 |
Correct |
0 ms |
212 KB |
Output is correct |
85 |
Correct |
526 ms |
30452 KB |
Output is correct |
86 |
Correct |
546 ms |
30412 KB |
Output is correct |
87 |
Correct |
486 ms |
30372 KB |
Output is correct |
88 |
Correct |
380 ms |
26032 KB |
Output is correct |
89 |
Correct |
158 ms |
19928 KB |
Output is correct |
90 |
Correct |
162 ms |
19844 KB |
Output is correct |
91 |
Correct |
162 ms |
19884 KB |
Output is correct |
92 |
Correct |
525 ms |
30184 KB |
Output is correct |
93 |
Correct |
497 ms |
30196 KB |
Output is correct |
94 |
Correct |
543 ms |
30268 KB |
Output is correct |
95 |
Correct |
493 ms |
30220 KB |
Output is correct |
96 |
Correct |
0 ms |
212 KB |
Output is correct |
97 |
Correct |
19 ms |
2728 KB |
Output is correct |
98 |
Correct |
53 ms |
10528 KB |
Output is correct |
99 |
Correct |
509 ms |
30404 KB |
Output is correct |
100 |
Correct |
9 ms |
1236 KB |
Output is correct |
101 |
Correct |
29 ms |
5404 KB |
Output is correct |
102 |
Correct |
92 ms |
10576 KB |
Output is correct |
103 |
Correct |
177 ms |
12776 KB |
Output is correct |
104 |
Correct |
231 ms |
17292 KB |
Output is correct |
105 |
Correct |
375 ms |
21876 KB |
Output is correct |
106 |
Correct |
490 ms |
26236 KB |
Output is correct |
107 |
Correct |
623 ms |
30404 KB |
Output is correct |
108 |
Correct |
1 ms |
212 KB |
Output is correct |
109 |
Correct |
0 ms |
212 KB |
Output is correct |
110 |
Correct |
0 ms |
284 KB |
Output is correct |
111 |
Correct |
0 ms |
212 KB |
Output is correct |
112 |
Correct |
1 ms |
288 KB |
Output is correct |
113 |
Correct |
0 ms |
212 KB |
Output is correct |
114 |
Correct |
0 ms |
212 KB |
Output is correct |
115 |
Correct |
0 ms |
212 KB |
Output is correct |
116 |
Correct |
0 ms |
212 KB |
Output is correct |
117 |
Correct |
0 ms |
212 KB |
Output is correct |
118 |
Correct |
0 ms |
212 KB |
Output is correct |
119 |
Correct |
1 ms |
468 KB |
Output is correct |
120 |
Correct |
2 ms |
468 KB |
Output is correct |
121 |
Correct |
204 ms |
15336 KB |
Output is correct |
122 |
Correct |
282 ms |
22016 KB |
Output is correct |
123 |
Correct |
284 ms |
22004 KB |
Output is correct |
124 |
Correct |
1 ms |
212 KB |
Output is correct |
125 |
Correct |
1 ms |
212 KB |
Output is correct |
126 |
Correct |
0 ms |
284 KB |
Output is correct |
127 |
Correct |
381 ms |
30260 KB |
Output is correct |
128 |
Correct |
417 ms |
30188 KB |
Output is correct |
129 |
Correct |
416 ms |
30044 KB |
Output is correct |
130 |
Correct |
3 ms |
596 KB |
Output is correct |
131 |
Correct |
4 ms |
980 KB |
Output is correct |
132 |
Correct |
207 ms |
15256 KB |
Output is correct |
133 |
Correct |
351 ms |
22804 KB |
Output is correct |
134 |
Correct |
531 ms |
30216 KB |
Output is correct |
135 |
Correct |
468 ms |
30304 KB |
Output is correct |
136 |
Correct |
434 ms |
30312 KB |
Output is correct |
137 |
Correct |
513 ms |
30416 KB |
Output is correct |
138 |
Correct |
663 ms |
32728 KB |
Output is correct |
139 |
Correct |
512 ms |
27408 KB |
Output is correct |
140 |
Correct |
1 ms |
212 KB |
Output is correct |
141 |
Correct |
53 ms |
5328 KB |
Output is correct |
142 |
Correct |
14 ms |
2380 KB |
Output is correct |
143 |
Correct |
45 ms |
7488 KB |
Output is correct |
144 |
Correct |
96 ms |
12492 KB |
Output is correct |
145 |
Correct |
239 ms |
16684 KB |
Output is correct |
146 |
Correct |
340 ms |
20904 KB |
Output is correct |
147 |
Correct |
384 ms |
24688 KB |
Output is correct |
148 |
Correct |
546 ms |
28484 KB |
Output is correct |
149 |
Correct |
632 ms |
32332 KB |
Output is correct |
150 |
Correct |
539 ms |
32056 KB |
Output is correct |
151 |
Correct |
435 ms |
30364 KB |
Output is correct |
152 |
Correct |
3 ms |
684 KB |
Output is correct |
153 |
Correct |
5 ms |
1108 KB |
Output is correct |
154 |
Correct |
187 ms |
15864 KB |
Output is correct |
155 |
Correct |
333 ms |
23528 KB |
Output is correct |
156 |
Correct |
545 ms |
31180 KB |
Output is correct |
157 |
Correct |
0 ms |
212 KB |
Output is correct |
158 |
Correct |
0 ms |
212 KB |
Output is correct |
159 |
Correct |
0 ms |
212 KB |
Output is correct |
160 |
Correct |
0 ms |
212 KB |
Output is correct |
161 |
Correct |
676 ms |
30416 KB |
Output is correct |
162 |
Correct |
481 ms |
30384 KB |
Output is correct |
163 |
Correct |
470 ms |
30388 KB |
Output is correct |
164 |
Correct |
527 ms |
30360 KB |
Output is correct |
165 |
Correct |
599 ms |
30392 KB |
Output is correct |
166 |
Correct |
557 ms |
30384 KB |
Output is correct |
167 |
Correct |
86 ms |
7588 KB |
Output is correct |
168 |
Correct |
20 ms |
3440 KB |
Output is correct |
169 |
Correct |
46 ms |
8452 KB |
Output is correct |
170 |
Correct |
123 ms |
15632 KB |
Output is correct |
171 |
Correct |
195 ms |
20828 KB |
Output is correct |
172 |
Correct |
219 ms |
15792 KB |
Output is correct |
173 |
Correct |
295 ms |
18960 KB |
Output is correct |
174 |
Correct |
382 ms |
21924 KB |
Output is correct |
175 |
Correct |
466 ms |
24740 KB |
Output is correct |
176 |
Correct |
569 ms |
27556 KB |
Output is correct |
177 |
Correct |
586 ms |
30372 KB |
Output is correct |