/**
_ _ __ _ _ _ _ _ _
|a ||t ||o d | |o |
| __ _| | _ | __| _ |
| __ |/_ | __ /__\ / _\|
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N_MAX = 100000;
const int U = 0, R = 1, D = 2, L = 3;
const int RU = 4, RD = 5, LD = 6, LU = 7;
int N;
int X[N_MAX + 2], Y[N_MAX + 2];
int order[N_MAX + 2];
int dir[N_MAX + 2];
void get_dir () {
dir[1] = R;
for (int i = 2; i <= N; i++) {
if (abs(X[i] - X[1]) > abs(Y[i] - Y[1])) {
dir[i] = (X[i] < X[1] ? R : L);
} else if (abs(Y[i] - Y[1]) > abs(X[i] - X[1])) {
dir[i] = (Y[i] < Y[1] ? U : D);
} else {
if (X[i] < X[1]) {
dir[i] = R;
} else {
dir[i] = (Y[i] < Y[1] ? U : D);
}
}
}
}
unordered_map <int, vector <int>> V[8];
int find_higher (vector <int> &v, int val, int arr[]) {
int l = 0, r = (int) v.size();
while (l < r) {
int mid = (l + r) / 2;
if (val <= arr[v[mid]]) {
r = mid;
} else {
l = mid + 1;
}
}
return l;
}
int find_lower (vector <int> &v, int val, int arr[]) {
int l = 0, r = (int) v.size();
while (l < r) {
int mid = (l + r) / 2;
if (arr[v[mid]] <= val) {
r = mid;
} else {
l = mid + 1;
}
}
return l;
}
int min_last[N_MAX + 2][8];
bool seen[N_MAX + 2][8];
priority_queue <tuple <int, int, int>> q;
void consider (int i, int t, int last) {
if (last < min_last[i][t]) {
min_last[i][t] = last;
q.push(make_tuple(-last, i, t));
}
}
void process (int i, int ti) {
for (int t = 0; t < 8; t++) {
int key;
bool positive;
bool go;
if (t < 4) {
go = (dir[i] == t);
key = (t % 2 == 0 ? X[i] : Y[i]);
positive = (t < 2);
} else {
go = (dir[i] == t - 4 || dir[i] == (t - 4 + 1) % 4);
key = (t % 2 == 0 ? X[i] - Y[i] : X[i] + Y[i]);
positive = (t < 6);
}
int *arr = (t == 0 || t == 2 ? Y : X);
int coef = (t < 4 ? 1 : 2);
vector <int> &v = V[t][key];
if (t == ti) {
int a;
if (positive == true) {
a = find_higher(v, arr[i], arr) + 1;
} else {
a = find_lower(v, arr[i], arr) + 1;
}
if (a < (int) v.size()) {
consider(v[a], t, min_last[i][ti] + abs(arr[v[a]] - arr[i]) * coef);
}
}
if (go == false) {
continue;
}
int dist = (coef == 2 ? (min_last[i][ti] + 1) / 2 : min_last[i][ti]);
int b;
if (positive == true) {
b = find_higher(v, arr[i] + dist, arr);
} else {
b = find_lower(v, arr[i] - dist, arr);
}
if (b < (int) v.size()) {
consider(v[b], t, abs(arr[v[b]] - arr[i]) * coef);
}
}
}
int solve () {
get_dir();
iota(order + 1, order + N + 1, 1);
sort(order + 1, order + N + 1, [&] (const int &i, const int &j) {
return make_pair(X[i], Y[i]) < make_pair(X[j], Y[j]);
});
for (int k = 1; k <= N; k++) {
int i = order[k];
V[U][X[i]].push_back(i);
V[R][Y[i]].push_back(i);
V[RU][X[i] - Y[i]].push_back(i);
V[RD][X[i] + Y[i]].push_back(i);
}
for (int k = N; k >= 1; k--) {
int i = order[k];
V[D][X[i]].push_back(i);
V[L][Y[i]].push_back(i);
V[LD][X[i] - Y[i]].push_back(i);
V[LU][X[i] + Y[i]].push_back(i);
}
for (int i = 1; i <= N; i++) {
for (int t = 0; t < 8; t++) {
min_last[i][t] = INT_MAX;
seen[i][t] = false;
}
}
process(1, -1);
while (q.empty() == false) {
int i = get <1> (q.top()), t = get <2> (q.top());
q.pop();
if (seen[i][t] == true) {
continue;
}
seen[i][t] = true;
process(i, t);
}
int cnt = 0;
for (int i = 1; i <= N; i++) {
for (int t = 0; t < 8; t++) {
if (seen[i][t] == true) {
cnt++;
break;
}
}
}
for (int t = 0; t < 8; t++) {
V[t].clear();
}
return cnt;
}
void rot90 () {
for (int i = 1; i <= N; i++) {
swap(X[i], Y[i]); X[i] = -X[i];
}
}
int main () {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> X[i] >> Y[i];
}
int answer = solve();
rot90(); answer = max(answer, solve());
rot90(); answer = max(answer, solve());
rot90(); answer = max(answer, solve());
cout << answer << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4444 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
4444 KB |
Output is correct |
13 |
Correct |
1 ms |
4444 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4564 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4444 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
4444 KB |
Output is correct |
13 |
Correct |
1 ms |
4444 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4564 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4444 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
4444 KB |
Output is correct |
38 |
Correct |
1 ms |
4444 KB |
Output is correct |
39 |
Correct |
1 ms |
4584 KB |
Output is correct |
40 |
Correct |
1 ms |
4444 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
4444 KB |
Output is correct |
45 |
Correct |
1 ms |
4444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4468 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
1 ms |
4440 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4444 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
4444 KB |
Output is correct |
13 |
Correct |
1 ms |
4444 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4564 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4444 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
4444 KB |
Output is correct |
38 |
Correct |
1 ms |
4444 KB |
Output is correct |
39 |
Correct |
1 ms |
4584 KB |
Output is correct |
40 |
Correct |
1 ms |
4444 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
4444 KB |
Output is correct |
45 |
Correct |
1 ms |
4444 KB |
Output is correct |
46 |
Correct |
1 ms |
4444 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4468 KB |
Output is correct |
49 |
Correct |
1 ms |
4444 KB |
Output is correct |
50 |
Correct |
1 ms |
4444 KB |
Output is correct |
51 |
Correct |
1 ms |
4444 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
4440 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4644 KB |
Output is correct |
56 |
Correct |
1 ms |
4440 KB |
Output is correct |
57 |
Correct |
1 ms |
4444 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
4444 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
2 ms |
4440 KB |
Output is correct |
64 |
Correct |
1 ms |
4696 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4444 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
4444 KB |
Output is correct |
13 |
Correct |
1 ms |
4444 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4564 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4444 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
4444 KB |
Output is correct |
38 |
Correct |
1 ms |
4444 KB |
Output is correct |
39 |
Correct |
1 ms |
4584 KB |
Output is correct |
40 |
Correct |
1 ms |
4444 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
4444 KB |
Output is correct |
45 |
Correct |
1 ms |
4444 KB |
Output is correct |
46 |
Correct |
1 ms |
4444 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4468 KB |
Output is correct |
49 |
Correct |
1 ms |
4444 KB |
Output is correct |
50 |
Correct |
1 ms |
4444 KB |
Output is correct |
51 |
Correct |
1 ms |
4444 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
4440 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4644 KB |
Output is correct |
56 |
Correct |
1 ms |
4440 KB |
Output is correct |
57 |
Correct |
1 ms |
4444 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
4444 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
2 ms |
4440 KB |
Output is correct |
64 |
Correct |
1 ms |
4696 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
66 |
Correct |
12 ms |
6492 KB |
Output is correct |
67 |
Correct |
13 ms |
6320 KB |
Output is correct |
68 |
Correct |
13 ms |
6748 KB |
Output is correct |
69 |
Correct |
15 ms |
4700 KB |
Output is correct |
70 |
Correct |
9 ms |
5208 KB |
Output is correct |
71 |
Correct |
9 ms |
4956 KB |
Output is correct |
72 |
Correct |
11 ms |
5980 KB |
Output is correct |
73 |
Correct |
13 ms |
6748 KB |
Output is correct |
74 |
Correct |
10 ms |
6236 KB |
Output is correct |
75 |
Correct |
14 ms |
6232 KB |
Output is correct |
76 |
Correct |
14 ms |
6744 KB |
Output is correct |
77 |
Correct |
14 ms |
6232 KB |
Output is correct |
78 |
Correct |
14 ms |
6492 KB |
Output is correct |
79 |
Correct |
15 ms |
6492 KB |
Output is correct |
80 |
Correct |
14 ms |
6856 KB |
Output is correct |
81 |
Correct |
14 ms |
6492 KB |
Output is correct |
82 |
Correct |
13 ms |
6236 KB |
Output is correct |
83 |
Correct |
13 ms |
6236 KB |
Output is correct |
84 |
Correct |
6 ms |
5464 KB |
Output is correct |
85 |
Correct |
4 ms |
4956 KB |
Output is correct |
86 |
Correct |
4 ms |
4700 KB |
Output is correct |
87 |
Correct |
5 ms |
4956 KB |
Output is correct |
88 |
Correct |
12 ms |
6236 KB |
Output is correct |
89 |
Correct |
13 ms |
6236 KB |
Output is correct |
90 |
Correct |
14 ms |
6236 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4444 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
4444 KB |
Output is correct |
13 |
Correct |
1 ms |
4444 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4564 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4444 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
4444 KB |
Output is correct |
38 |
Correct |
1 ms |
4444 KB |
Output is correct |
39 |
Correct |
1 ms |
4584 KB |
Output is correct |
40 |
Correct |
1 ms |
4444 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
4444 KB |
Output is correct |
45 |
Correct |
1 ms |
4444 KB |
Output is correct |
46 |
Correct |
1 ms |
4444 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4468 KB |
Output is correct |
49 |
Correct |
1 ms |
4444 KB |
Output is correct |
50 |
Correct |
1 ms |
4444 KB |
Output is correct |
51 |
Correct |
1 ms |
4444 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
4440 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4644 KB |
Output is correct |
56 |
Correct |
1 ms |
4440 KB |
Output is correct |
57 |
Correct |
1 ms |
4444 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
4444 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
2 ms |
4440 KB |
Output is correct |
64 |
Correct |
1 ms |
4696 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
66 |
Correct |
1147 ms |
55320 KB |
Output is correct |
67 |
Correct |
1755 ms |
69160 KB |
Output is correct |
68 |
Correct |
2145 ms |
80536 KB |
Output is correct |
69 |
Correct |
498 ms |
65688 KB |
Output is correct |
70 |
Correct |
1272 ms |
65952 KB |
Output is correct |
71 |
Correct |
2013 ms |
80520 KB |
Output is correct |
72 |
Correct |
1943 ms |
80172 KB |
Output is correct |
73 |
Correct |
1284 ms |
63224 KB |
Output is correct |
74 |
Correct |
2145 ms |
80372 KB |
Output is correct |
75 |
Correct |
1765 ms |
79528 KB |
Output is correct |
76 |
Correct |
1151 ms |
63612 KB |
Output is correct |
77 |
Correct |
2269 ms |
80584 KB |
Output is correct |
78 |
Correct |
1963 ms |
62192 KB |
Output is correct |
79 |
Correct |
2052 ms |
62184 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4444 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
4444 KB |
Output is correct |
13 |
Correct |
1 ms |
4444 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4564 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4444 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
4444 KB |
Output is correct |
38 |
Correct |
1 ms |
4444 KB |
Output is correct |
39 |
Correct |
1 ms |
4584 KB |
Output is correct |
40 |
Correct |
1 ms |
4444 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
4444 KB |
Output is correct |
45 |
Correct |
1 ms |
4444 KB |
Output is correct |
46 |
Correct |
1 ms |
4444 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4468 KB |
Output is correct |
49 |
Correct |
1 ms |
4444 KB |
Output is correct |
50 |
Correct |
1 ms |
4444 KB |
Output is correct |
51 |
Correct |
1 ms |
4444 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
4440 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4644 KB |
Output is correct |
56 |
Correct |
1 ms |
4440 KB |
Output is correct |
57 |
Correct |
1 ms |
4444 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
4444 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
2 ms |
4440 KB |
Output is correct |
64 |
Correct |
1 ms |
4696 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
66 |
Correct |
12 ms |
6492 KB |
Output is correct |
67 |
Correct |
13 ms |
6320 KB |
Output is correct |
68 |
Correct |
13 ms |
6748 KB |
Output is correct |
69 |
Correct |
15 ms |
4700 KB |
Output is correct |
70 |
Correct |
9 ms |
5208 KB |
Output is correct |
71 |
Correct |
9 ms |
4956 KB |
Output is correct |
72 |
Correct |
11 ms |
5980 KB |
Output is correct |
73 |
Correct |
13 ms |
6748 KB |
Output is correct |
74 |
Correct |
10 ms |
6236 KB |
Output is correct |
75 |
Correct |
14 ms |
6232 KB |
Output is correct |
76 |
Correct |
14 ms |
6744 KB |
Output is correct |
77 |
Correct |
14 ms |
6232 KB |
Output is correct |
78 |
Correct |
14 ms |
6492 KB |
Output is correct |
79 |
Correct |
15 ms |
6492 KB |
Output is correct |
80 |
Correct |
14 ms |
6856 KB |
Output is correct |
81 |
Correct |
14 ms |
6492 KB |
Output is correct |
82 |
Correct |
13 ms |
6236 KB |
Output is correct |
83 |
Correct |
13 ms |
6236 KB |
Output is correct |
84 |
Correct |
6 ms |
5464 KB |
Output is correct |
85 |
Correct |
4 ms |
4956 KB |
Output is correct |
86 |
Correct |
4 ms |
4700 KB |
Output is correct |
87 |
Correct |
5 ms |
4956 KB |
Output is correct |
88 |
Correct |
12 ms |
6236 KB |
Output is correct |
89 |
Correct |
13 ms |
6236 KB |
Output is correct |
90 |
Correct |
14 ms |
6236 KB |
Output is correct |
91 |
Correct |
1147 ms |
55320 KB |
Output is correct |
92 |
Correct |
1755 ms |
69160 KB |
Output is correct |
93 |
Correct |
2145 ms |
80536 KB |
Output is correct |
94 |
Correct |
498 ms |
65688 KB |
Output is correct |
95 |
Correct |
1272 ms |
65952 KB |
Output is correct |
96 |
Correct |
2013 ms |
80520 KB |
Output is correct |
97 |
Correct |
1943 ms |
80172 KB |
Output is correct |
98 |
Correct |
1284 ms |
63224 KB |
Output is correct |
99 |
Correct |
2145 ms |
80372 KB |
Output is correct |
100 |
Correct |
1765 ms |
79528 KB |
Output is correct |
101 |
Correct |
1151 ms |
63612 KB |
Output is correct |
102 |
Correct |
2269 ms |
80584 KB |
Output is correct |
103 |
Correct |
1963 ms |
62192 KB |
Output is correct |
104 |
Correct |
2052 ms |
62184 KB |
Output is correct |
105 |
Correct |
382 ms |
10832 KB |
Output is correct |
106 |
Correct |
482 ms |
11460 KB |
Output is correct |
107 |
Correct |
878 ms |
12916 KB |
Output is correct |
108 |
Correct |
554 ms |
13120 KB |
Output is correct |
109 |
Correct |
352 ms |
19540 KB |
Output is correct |
110 |
Correct |
1467 ms |
55300 KB |
Output is correct |
111 |
Correct |
2340 ms |
81316 KB |
Output is correct |
112 |
Correct |
1862 ms |
76080 KB |
Output is correct |
113 |
Correct |
1847 ms |
75856 KB |
Output is correct |
114 |
Correct |
1014 ms |
34508 KB |
Output is correct |
115 |
Correct |
1170 ms |
63816 KB |
Output is correct |
116 |
Correct |
1798 ms |
75980 KB |
Output is correct |
117 |
Correct |
1723 ms |
74992 KB |
Output is correct |
118 |
Correct |
1144 ms |
52748 KB |
Output is correct |
119 |
Correct |
1196 ms |
64104 KB |
Output is correct |
120 |
Correct |
1770 ms |
75888 KB |
Output is correct |
121 |
Correct |
2183 ms |
77764 KB |
Output is correct |
122 |
Correct |
2225 ms |
73144 KB |
Output is correct |
123 |
Correct |
917 ms |
66200 KB |
Output is correct |
124 |
Correct |
1176 ms |
66716 KB |
Output is correct |
125 |
Correct |
309 ms |
37476 KB |
Output is correct |
126 |
Correct |
116 ms |
16476 KB |
Output is correct |
127 |
Correct |
102 ms |
13132 KB |
Output is correct |
128 |
Correct |
94 ms |
14428 KB |
Output is correct |
129 |
Correct |
171 ms |
22924 KB |
Output is correct |