#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
typedef long double ld;
const ld eps = 1e-8;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const ll inf = 1e18;
const ll mod = 1e9 + 7;
#include "parks.h"
vector<vector<int>> g;
vector<int> u, v, a, b;
vector<int> used;
void dfs(int ver) {
used[ver] = 1;
for (auto nod : g[ver]) {
if (!used[nod]) {
u.push_back(ver);
v.push_back(nod);
dfs(nod);
}
}
}
int construct_roads(vector<int> x, vector<int> y) {
bool fir = 1, sec = 1, thi = 1;
int n = x.size();
for (int i = 0; i < n; i++) {
if (x[i] != 2)
fir = 0;
}
map<pair<int, int>, int> mp;
for (int i = 0; i < n; i++) {
mp[{x[i], y[i]}] = i;
}
g.resize(n);
for (int i = 0; i < n; i++) {
if (mp.find({x[i] - 2, y[i]}) != mp.end()) {
g[i].push_back(mp[{x[i] - 2, y[i]}]);
}
if (mp.find({x[i] + 2, y[i]}) != mp.end()) {
g[i].push_back(mp[{x[i] + 2, y[i]}]);
}
if (mp.find({x[i], y[i] - 2}) != mp.end()) {
g[i].push_back(mp[{x[i], y[i] - 2}]);
}
if (mp.find({x[i], y[i] + 2}) != mp.end()) {
g[i].push_back(mp[{x[i], y[i] + 2}]);
}
}
used.resize(n);
dfs(0);
bool ch = 1;
for (int i = 0; i < n; i++) {
if (!used[i])
ch = 0;
}
if (!ch)
return 0;
map<pair<int, int>, int> bench;
map<pair<int, int>, set<int>> want;
set<vector<int>> ben;
for (int i = 0; i < v.size(); i++) {
if (x[v[i]] == x[u[i]]) {
want[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}].insert(i);
want[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}].insert(i);
bench[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}]++;
bench[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}]++;
} else {
want[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}].insert(i);
want[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}].insert(i);
bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}]++;
bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}]++;
}
}
for (auto [pa, cnt] : bench) {
ben.insert({cnt, pa.fi, pa.se});
}
a.resize(n - 1);
b.resize(n - 1);
set<pair<int, int>> used_ben;
while(!ben.empty() && used_ben.size() < n - 1) {
auto cur = *ben.begin();
int i = *want[{cur[1], cur[2]}].begin();
a[i] = cur[1];
b[i] = cur[2];
used_ben.insert({cur[1], cur[2]});
if (x[v[i]] == x[u[i]]) {
want[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}].erase(i);
want[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}].erase(i);
ben.erase({bench[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}], x[v[i]] + 1,(y[v[i]] + y[u[i]]) / 2});
ben.erase({bench[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}], x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2});
bench[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}]--;
bench[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}]--;
if (bench[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}] > 0 && used_ben.find({x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}) == used_ben.end()) {
ben.insert({bench[{x[v[i]] + 1, (y[v[i]] + y[u[i]]) / 2}], x[v[i]] + 1,(y[v[i]] + y[u[i]]) / 2});
}
if (bench[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}] > 0 && used_ben.find({x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}) == used_ben.end()) {
ben.insert({bench[{x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2}], x[v[i]] - 1, (y[v[i]] + y[u[i]]) / 2});
}
} else {
want[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}].erase(i);
want[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}].erase(i);
ben.erase({bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}],(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1 });
ben.erase({bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}], (x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1});
bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}]--;
bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}]--;
if ( bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}] > 0 && used_ben.find({(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}) == used_ben.end()) {
ben.insert({bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1}],(x[v[i]] + x[u[i]]) / 2, y[v[i]] + 1 });
}
if (bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}] > 0 && used_ben.find({(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}) == used_ben.end()) {
ben.insert({bench[{(x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1}], (x[v[i]] + x[u[i]]) / 2, y[v[i]] - 1});
}
}
}
build(u, v, a, b);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:71:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
71 | for (int i = 0; i < v.size(); i++) {
| ~~^~~~~~~~~~
parks.cpp:90:43: warning: comparison of integer expressions of different signedness: 'std::set<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
90 | while(!ben.empty() && used_ben.size() < n - 1) {
| ~~~~~~~~~~~~~~~~^~~~~~~
parks.cpp:34:10: warning: variable 'fir' set but not used [-Wunused-but-set-variable]
34 | bool fir = 1, sec = 1, thi = 1;
| ^~~
parks.cpp:34:19: warning: unused variable 'sec' [-Wunused-variable]
34 | bool fir = 1, sec = 1, thi = 1;
| ^~~
parks.cpp:34:28: warning: unused variable 'thi' [-Wunused-variable]
34 | bool fir = 1, sec = 1, thi = 1;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
368 ms |
83916 KB |
Output is correct |
10 |
Correct |
25 ms |
8536 KB |
Output is correct |
11 |
Correct |
167 ms |
45120 KB |
Output is correct |
12 |
Correct |
41 ms |
12796 KB |
Output is correct |
13 |
Correct |
32 ms |
8528 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
371 ms |
81400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
368 ms |
83916 KB |
Output is correct |
10 |
Correct |
25 ms |
8536 KB |
Output is correct |
11 |
Correct |
167 ms |
45120 KB |
Output is correct |
12 |
Correct |
41 ms |
12796 KB |
Output is correct |
13 |
Correct |
32 ms |
8528 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
371 ms |
81400 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
905 ms |
117148 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
940 KB |
Output is correct |
28 |
Correct |
307 ms |
47424 KB |
Output is correct |
29 |
Correct |
493 ms |
69608 KB |
Output is correct |
30 |
Correct |
736 ms |
94144 KB |
Output is correct |
31 |
Correct |
933 ms |
116080 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
860 KB |
Output is correct |
45 |
Correct |
375 ms |
66448 KB |
Output is correct |
46 |
Correct |
623 ms |
96616 KB |
Output is correct |
47 |
Correct |
627 ms |
96448 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
368 ms |
83916 KB |
Output is correct |
10 |
Correct |
25 ms |
8536 KB |
Output is correct |
11 |
Correct |
167 ms |
45120 KB |
Output is correct |
12 |
Correct |
41 ms |
12796 KB |
Output is correct |
13 |
Correct |
32 ms |
8528 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
371 ms |
81400 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
905 ms |
117148 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
940 KB |
Output is correct |
28 |
Correct |
307 ms |
47424 KB |
Output is correct |
29 |
Correct |
493 ms |
69608 KB |
Output is correct |
30 |
Correct |
736 ms |
94144 KB |
Output is correct |
31 |
Correct |
933 ms |
116080 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
860 KB |
Output is correct |
45 |
Correct |
375 ms |
66448 KB |
Output is correct |
46 |
Correct |
623 ms |
96616 KB |
Output is correct |
47 |
Correct |
627 ms |
96448 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
1029 ms |
114936 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
6 ms |
1372 KB |
Output is correct |
58 |
Correct |
14 ms |
3740 KB |
Output is correct |
59 |
Correct |
12 ms |
1880 KB |
Output is correct |
60 |
Correct |
497 ms |
59836 KB |
Output is correct |
61 |
Correct |
607 ms |
80316 KB |
Output is correct |
62 |
Correct |
759 ms |
96860 KB |
Output is correct |
63 |
Correct |
931 ms |
116184 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
813 ms |
166552 KB |
Output is correct |
68 |
Correct |
817 ms |
166684 KB |
Output is correct |
69 |
Correct |
806 ms |
167280 KB |
Output is correct |
70 |
Correct |
3 ms |
856 KB |
Output is correct |
71 |
Correct |
6 ms |
1628 KB |
Output is correct |
72 |
Correct |
384 ms |
64356 KB |
Output is correct |
73 |
Correct |
666 ms |
97968 KB |
Output is correct |
74 |
Correct |
939 ms |
128444 KB |
Output is correct |
75 |
Correct |
933 ms |
137320 KB |
Output is correct |
76 |
Correct |
829 ms |
170092 KB |
Output is correct |
77 |
Correct |
4 ms |
1116 KB |
Output is correct |
78 |
Correct |
7 ms |
1884 KB |
Output is correct |
79 |
Correct |
408 ms |
65724 KB |
Output is correct |
80 |
Correct |
660 ms |
99144 KB |
Output is correct |
81 |
Correct |
913 ms |
131948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
368 ms |
83916 KB |
Output is correct |
10 |
Correct |
25 ms |
8536 KB |
Output is correct |
11 |
Correct |
167 ms |
45120 KB |
Output is correct |
12 |
Correct |
41 ms |
12796 KB |
Output is correct |
13 |
Correct |
32 ms |
8528 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
371 ms |
81400 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
790 ms |
118676 KB |
Output is correct |
21 |
Correct |
770 ms |
116156 KB |
Output is correct |
22 |
Correct |
792 ms |
114584 KB |
Output is correct |
23 |
Correct |
662 ms |
139548 KB |
Output is correct |
24 |
Correct |
176 ms |
21332 KB |
Output is correct |
25 |
Correct |
283 ms |
27748 KB |
Output is correct |
26 |
Correct |
241 ms |
27732 KB |
Output is correct |
27 |
Correct |
736 ms |
155920 KB |
Output is correct |
28 |
Correct |
725 ms |
156016 KB |
Output is correct |
29 |
Correct |
839 ms |
156124 KB |
Output is correct |
30 |
Correct |
904 ms |
156092 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
40 ms |
9172 KB |
Output is correct |
33 |
Correct |
81 ms |
12212 KB |
Output is correct |
34 |
Correct |
744 ms |
119052 KB |
Output is correct |
35 |
Correct |
12 ms |
1880 KB |
Output is correct |
36 |
Correct |
56 ms |
8004 KB |
Output is correct |
37 |
Correct |
124 ms |
15444 KB |
Output is correct |
38 |
Correct |
296 ms |
47472 KB |
Output is correct |
39 |
Correct |
442 ms |
65172 KB |
Output is correct |
40 |
Correct |
625 ms |
82660 KB |
Output is correct |
41 |
Correct |
787 ms |
100768 KB |
Output is correct |
42 |
Correct |
949 ms |
118328 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
656 KB |
Output is correct |
55 |
Correct |
2 ms |
860 KB |
Output is correct |
56 |
Correct |
425 ms |
67260 KB |
Output is correct |
57 |
Correct |
593 ms |
97900 KB |
Output is correct |
58 |
Correct |
590 ms |
97412 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
344 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
823 ms |
166528 KB |
Output is correct |
63 |
Correct |
822 ms |
166768 KB |
Output is correct |
64 |
Correct |
826 ms |
167276 KB |
Output is correct |
65 |
Correct |
3 ms |
860 KB |
Output is correct |
66 |
Correct |
6 ms |
1628 KB |
Output is correct |
67 |
Correct |
405 ms |
64308 KB |
Output is correct |
68 |
Correct |
675 ms |
97808 KB |
Output is correct |
69 |
Correct |
906 ms |
128364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
368 ms |
83916 KB |
Output is correct |
10 |
Correct |
25 ms |
8536 KB |
Output is correct |
11 |
Correct |
167 ms |
45120 KB |
Output is correct |
12 |
Correct |
41 ms |
12796 KB |
Output is correct |
13 |
Correct |
32 ms |
8528 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
371 ms |
81400 KB |
Output is correct |
17 |
Correct |
799 ms |
168736 KB |
Output is correct |
18 |
Correct |
785 ms |
167432 KB |
Output is correct |
19 |
Correct |
776 ms |
118792 KB |
Output is correct |
20 |
Correct |
829 ms |
127484 KB |
Output is correct |
21 |
Correct |
763 ms |
133384 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
103 ms |
19900 KB |
Output is correct |
24 |
Correct |
21 ms |
3672 KB |
Output is correct |
25 |
Correct |
85 ms |
11300 KB |
Output is correct |
26 |
Correct |
156 ms |
18768 KB |
Output is correct |
27 |
Correct |
396 ms |
64404 KB |
Output is correct |
28 |
Correct |
546 ms |
80956 KB |
Output is correct |
29 |
Correct |
653 ms |
96720 KB |
Output is correct |
30 |
Correct |
792 ms |
112536 KB |
Output is correct |
31 |
Correct |
931 ms |
128512 KB |
Output is correct |
32 |
Correct |
920 ms |
137356 KB |
Output is correct |
33 |
Correct |
816 ms |
170344 KB |
Output is correct |
34 |
Correct |
4 ms |
1116 KB |
Output is correct |
35 |
Correct |
7 ms |
1876 KB |
Output is correct |
36 |
Correct |
397 ms |
65856 KB |
Output is correct |
37 |
Correct |
649 ms |
99100 KB |
Output is correct |
38 |
Correct |
907 ms |
131932 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
368 ms |
83916 KB |
Output is correct |
10 |
Correct |
25 ms |
8536 KB |
Output is correct |
11 |
Correct |
167 ms |
45120 KB |
Output is correct |
12 |
Correct |
41 ms |
12796 KB |
Output is correct |
13 |
Correct |
32 ms |
8528 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
371 ms |
81400 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
905 ms |
117148 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
940 KB |
Output is correct |
28 |
Correct |
307 ms |
47424 KB |
Output is correct |
29 |
Correct |
493 ms |
69608 KB |
Output is correct |
30 |
Correct |
736 ms |
94144 KB |
Output is correct |
31 |
Correct |
933 ms |
116080 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
860 KB |
Output is correct |
45 |
Correct |
375 ms |
66448 KB |
Output is correct |
46 |
Correct |
623 ms |
96616 KB |
Output is correct |
47 |
Correct |
627 ms |
96448 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
1029 ms |
114936 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
6 ms |
1372 KB |
Output is correct |
58 |
Correct |
14 ms |
3740 KB |
Output is correct |
59 |
Correct |
12 ms |
1880 KB |
Output is correct |
60 |
Correct |
497 ms |
59836 KB |
Output is correct |
61 |
Correct |
607 ms |
80316 KB |
Output is correct |
62 |
Correct |
759 ms |
96860 KB |
Output is correct |
63 |
Correct |
931 ms |
116184 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
813 ms |
166552 KB |
Output is correct |
68 |
Correct |
817 ms |
166684 KB |
Output is correct |
69 |
Correct |
806 ms |
167280 KB |
Output is correct |
70 |
Correct |
3 ms |
856 KB |
Output is correct |
71 |
Correct |
6 ms |
1628 KB |
Output is correct |
72 |
Correct |
384 ms |
64356 KB |
Output is correct |
73 |
Correct |
666 ms |
97968 KB |
Output is correct |
74 |
Correct |
939 ms |
128444 KB |
Output is correct |
75 |
Correct |
933 ms |
137320 KB |
Output is correct |
76 |
Correct |
829 ms |
170092 KB |
Output is correct |
77 |
Correct |
4 ms |
1116 KB |
Output is correct |
78 |
Correct |
7 ms |
1884 KB |
Output is correct |
79 |
Correct |
408 ms |
65724 KB |
Output is correct |
80 |
Correct |
660 ms |
99144 KB |
Output is correct |
81 |
Correct |
913 ms |
131948 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
344 KB |
Output is correct |
85 |
Correct |
790 ms |
118676 KB |
Output is correct |
86 |
Correct |
770 ms |
116156 KB |
Output is correct |
87 |
Correct |
792 ms |
114584 KB |
Output is correct |
88 |
Correct |
662 ms |
139548 KB |
Output is correct |
89 |
Correct |
176 ms |
21332 KB |
Output is correct |
90 |
Correct |
283 ms |
27748 KB |
Output is correct |
91 |
Correct |
241 ms |
27732 KB |
Output is correct |
92 |
Correct |
736 ms |
155920 KB |
Output is correct |
93 |
Correct |
725 ms |
156016 KB |
Output is correct |
94 |
Correct |
839 ms |
156124 KB |
Output is correct |
95 |
Correct |
904 ms |
156092 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
40 ms |
9172 KB |
Output is correct |
98 |
Correct |
81 ms |
12212 KB |
Output is correct |
99 |
Correct |
744 ms |
119052 KB |
Output is correct |
100 |
Correct |
12 ms |
1880 KB |
Output is correct |
101 |
Correct |
56 ms |
8004 KB |
Output is correct |
102 |
Correct |
124 ms |
15444 KB |
Output is correct |
103 |
Correct |
296 ms |
47472 KB |
Output is correct |
104 |
Correct |
442 ms |
65172 KB |
Output is correct |
105 |
Correct |
625 ms |
82660 KB |
Output is correct |
106 |
Correct |
787 ms |
100768 KB |
Output is correct |
107 |
Correct |
949 ms |
118328 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
0 ms |
348 KB |
Output is correct |
111 |
Correct |
0 ms |
348 KB |
Output is correct |
112 |
Correct |
0 ms |
348 KB |
Output is correct |
113 |
Correct |
0 ms |
348 KB |
Output is correct |
114 |
Correct |
1 ms |
348 KB |
Output is correct |
115 |
Correct |
0 ms |
348 KB |
Output is correct |
116 |
Correct |
0 ms |
348 KB |
Output is correct |
117 |
Correct |
0 ms |
348 KB |
Output is correct |
118 |
Correct |
0 ms |
348 KB |
Output is correct |
119 |
Correct |
1 ms |
656 KB |
Output is correct |
120 |
Correct |
2 ms |
860 KB |
Output is correct |
121 |
Correct |
425 ms |
67260 KB |
Output is correct |
122 |
Correct |
593 ms |
97900 KB |
Output is correct |
123 |
Correct |
590 ms |
97412 KB |
Output is correct |
124 |
Correct |
0 ms |
348 KB |
Output is correct |
125 |
Correct |
0 ms |
344 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
823 ms |
166528 KB |
Output is correct |
128 |
Correct |
822 ms |
166768 KB |
Output is correct |
129 |
Correct |
826 ms |
167276 KB |
Output is correct |
130 |
Correct |
3 ms |
860 KB |
Output is correct |
131 |
Correct |
6 ms |
1628 KB |
Output is correct |
132 |
Correct |
405 ms |
64308 KB |
Output is correct |
133 |
Correct |
675 ms |
97808 KB |
Output is correct |
134 |
Correct |
906 ms |
128364 KB |
Output is correct |
135 |
Correct |
799 ms |
168736 KB |
Output is correct |
136 |
Correct |
785 ms |
167432 KB |
Output is correct |
137 |
Correct |
776 ms |
118792 KB |
Output is correct |
138 |
Correct |
829 ms |
127484 KB |
Output is correct |
139 |
Correct |
763 ms |
133384 KB |
Output is correct |
140 |
Correct |
0 ms |
344 KB |
Output is correct |
141 |
Correct |
103 ms |
19900 KB |
Output is correct |
142 |
Correct |
21 ms |
3672 KB |
Output is correct |
143 |
Correct |
85 ms |
11300 KB |
Output is correct |
144 |
Correct |
156 ms |
18768 KB |
Output is correct |
145 |
Correct |
396 ms |
64404 KB |
Output is correct |
146 |
Correct |
546 ms |
80956 KB |
Output is correct |
147 |
Correct |
653 ms |
96720 KB |
Output is correct |
148 |
Correct |
792 ms |
112536 KB |
Output is correct |
149 |
Correct |
931 ms |
128512 KB |
Output is correct |
150 |
Correct |
920 ms |
137356 KB |
Output is correct |
151 |
Correct |
816 ms |
170344 KB |
Output is correct |
152 |
Correct |
4 ms |
1116 KB |
Output is correct |
153 |
Correct |
7 ms |
1876 KB |
Output is correct |
154 |
Correct |
397 ms |
65856 KB |
Output is correct |
155 |
Correct |
649 ms |
99100 KB |
Output is correct |
156 |
Correct |
907 ms |
131932 KB |
Output is correct |
157 |
Correct |
0 ms |
344 KB |
Output is correct |
158 |
Correct |
0 ms |
600 KB |
Output is correct |
159 |
Correct |
0 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Correct |
990 ms |
115536 KB |
Output is correct |
162 |
Correct |
742 ms |
117164 KB |
Output is correct |
163 |
Correct |
767 ms |
113932 KB |
Output is correct |
164 |
Correct |
775 ms |
113420 KB |
Output is correct |
165 |
Correct |
770 ms |
119488 KB |
Output is correct |
166 |
Correct |
833 ms |
119920 KB |
Output is correct |
167 |
Incorrect |
153 ms |
26564 KB |
a[4138] = 0 is not an odd integer |
168 |
Halted |
0 ms |
0 KB |
- |