답안 #545929

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
545929 2022-04-05T16:12:01 Z rainboy Building Skyscrapers (CEOI19_skyscrapers) C
100 / 100
338 ms 35516 KB
#include <stdio.h>
#include <string.h>

#define N	150000

int min(int a, int b) { return a < b ? a : b; }

unsigned int X = 12345;

int rand_() {
	return (X *= 3) >> 1;
}

int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1 };
int dy[] = { 1, 0, -1, 0, 1, 1, -1, -1 };

int xx[N], yy[N];

void sort(int *ii, int l, int r) {
	while (l < r) {
		int i = l, j = l, k = r, i_ = ii[l + rand_() % (r - l)], tmp;

		while (j < k)
			if (ii[j] == i_)
				j++;
			else if (xx[ii[j]] < xx[i_] || xx[ii[j]] == xx[i_] && yy[ii[j]] < yy[i_]) {
				tmp = ii[i], ii[i] = ii[j], ii[j] = tmp;
				i++, j++;
			} else {
				k--;
				tmp = ii[j], ii[j] = ii[k], ii[k] = tmp;
			}
		sort(ii, l, i);
		l = k;
	}
}

int ds[N * 8];

int find(int i) {
	return ds[i] < 0 ? i : (ds[i] = find(ds[i]));
}

void join(int i, int j) {
	i = find(i);
	j = find(j);
	if (i == j)
		return;
	if (ds[i] > ds[j])
		ds[i] = j;
	else {
		if (ds[i] == ds[j])
			ds[i]--;
		ds[j] = i;
	}
}

int jj[N][8], ta[N], tb[N];

void dfs(int f, int i) {
	static int time;
	int h;

	ta[i] = tb[i] = ++time;
	for (h = 0; h < 8; h++) {
		int j = jj[i][h];

		if (j == -1)
			continue;
		if (!ta[j]) {
			dfs(i * 8 + h, j);
			if (tb[j] < ta[i])
				join(i * 8 + h, f);
			tb[i] = min(tb[i], tb[j]);
		} else if (ta[j] < ta[i]) {
			join(i * 8 + h, f);
			tb[i] = min(tb[i], ta[j]);
		}
	}
}

int next[N * 4], prev[N * 4], kk[N];

int ok(int i) {
	int h, r, j, k;

	r = -1;
	for (h = 0; h < 8; h++)
		if (jj[i / 4][h] != -1) {
			if (r == -1)
				r = find(i / 4 * 8 + h);
			else if (find(i / 4 * 8 + h) != r)
				return 0;
		}
	k = 1;
	for (j = next[i]; j != i && j / 4 == i / 4; j = next[j])
		k++;
	if (j == i)
		return 1;
	for (j = prev[i]; j / 4 == i / 4; j = prev[j])
		k++;
	return kk[i / 4] == k;
}

int pq[N], iq[1 + N], cnt;

int lt(int i, int j) { return i > j; }

int p2(int p) {
	return (p *= 2) > cnt ? 0 : (p < cnt && lt(iq[p + 1], iq[p]) ? p + 1 : p);
}

void pq_up(int i) {
	int p, q, j;

	for (p = pq[i]; (q = p / 2) && lt(i, j = iq[q]); p = q)
		iq[pq[j] = p] = j;
	iq[pq[i] = p] = i;
}

void pq_dn(int i) {
	int p, q, j;

	for (p = pq[i]; (q = p2(p)) && lt(j = iq[q], i); p = q)
		iq[pq[j] = p] = j;
	iq[pq[i] = p] = i;
}

void pq_add(int i) {
	if (!pq[i])
		pq[i] = ++cnt, pq_up(i);
}

void pq_remove(int i) {
	if (pq[i]) {
		int j = iq[cnt--];

		if (j != i)
			pq[j] = pq[i], pq_up(j), pq_dn(j);
		pq[i] = 0;
	}
}

int pq_first() { return iq[1]; }

int main() {
	static int ii[N], hh[N], ii_[N * 4], ans[N];
	int n, n_, t, h, i, j, k;

	scanf("%d%d", &n, &t);
	for (i = 0; i < n; i++) {
		scanf("%d%d", &xx[i], &yy[i]);
		ii[i] = i;
	}
	sort(ii, 0, n);
	memset(ds, -1, n * 8 * sizeof *ds);
	for (h = 0; h < 8; h++)
		for (i = 0, j = 0; i < n; i++) {
			int x = xx[ii[i]] + dx[h], y = yy[ii[i]] + dy[h];

			while (j < n && (xx[ii[j]] < x || xx[ii[j]] == x && yy[ii[j]] < y))
				j++;
			if (j < n && xx[ii[j]] == x && yy[ii[j]] == y) {
				join(ii[i] * 8 + h, ii[j] * 8 + h ^ 2);
				jj[ii[i]][h] = ii[j];
			} else
				jj[ii[i]][h] = -1;
		}
	dfs(-1, 0);
	for (i = 0; i < n; i++)
		if (!ta[i]) {
			printf("NO\n");
			return 0;
		}
	i = ii[0], h = 0, k = 0;
	do {
		hh[i] = h, kk[i]++, ii_[k++] = i * 4 + h;
		if (jj[i][h + 4] != -1)
			i = jj[i][h + 4], h = (h + 3) % 4;
		else if (jj[i][h] != -1)
			i = jj[i][h];
		else
			h = (h + 1) % 4;
	} while (i != ii[0] || h != 0);
	for (h = 0; h < k; h++)
		next[ii_[h]] = ii_[(h + 1) % k], prev[ii_[(h + 1) % k]] = ii_[h];
	for (h = 0; h < k; h++)
		if (ok(ii_[h]))
			pq_add(ii_[h] / 4);
		else
			pq_remove(ii_[h] / 4);
	n_ = 0;
	while (cnt) {
		int i_, j_;

		i = pq_first(), pq_remove(i);
		ans[n_++] = i;
		if (n_ == n)
			break;
		for (h = 0; h < 8; h++)
			if (jj[i][h] != -1)
				jj[jj[i][h]][h ^ 2] = -1, jj[i][h] = -1;
		i_ = i * 4 + hh[i];
		while (i_ / 4 == i)
			i_ = prev[i_];
		j_ = i * 4 + hh[i];
		while (j_ / 4 == i)
			j_ = next[j_];
		kk[i_ / 4]--, kk[j_ / 4]--;
		i = i_ / 4, h = i_ % 4, k = 0;
		do {
			hh[i] = h, kk[i]++, ii_[k++] = i * 4 + h;
			if (jj[i][h + 4] != -1)
				i = jj[i][h + 4], h = (h + 3) % 4;
			else if (jj[i][h] != -1)
				i = jj[i][h];
			else
				h = (h + 1) % 4;
		} while (i != j_ / 4 || h != j_ % 4);
		hh[i] = h, kk[i]++, ii_[k++] = i * 4 + h;
		for (h = 0; h + 1 < k; h++)
			next[ii_[h]] = ii_[h + 1], prev[ii_[h + 1]] = ii_[h];
		for (h = 0; h < k; h++)
			if (ok(ii_[h]))
				pq_add(ii_[h] / 4);
			else 
				pq_remove(ii_[h] / 4);
	}
	printf("YES\n");
	while (n_--)
		printf("%d\n", ans[n_] + 1);
	return 0;
}

Compilation message

skyscrapers.c: In function 'sort':
skyscrapers.c:26:55: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   26 |    else if (xx[ii[j]] < xx[i_] || xx[ii[j]] == xx[i_] && yy[ii[j]] < yy[i_]) {
      |                                   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
skyscrapers.c: In function 'main':
skyscrapers.c:161:53: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  161 |    while (j < n && (xx[ii[j]] < x || xx[ii[j]] == x && yy[ii[j]] < y))
      |                                      ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
skyscrapers.c:164:35: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
  164 |     join(ii[i] * 8 + h, ii[j] * 8 + h ^ 2);
      |                         ~~~~~~~~~~^~~
skyscrapers.c:150:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
  150 |  scanf("%d%d", &n, &t);
      |  ^~~~~~~~~~~~~~~~~~~~~
skyscrapers.c:152:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
  152 |   scanf("%d%d", &xx[i], &yy[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB ans=YES N=1
2 Correct 1 ms 296 KB ans=YES N=4
3 Correct 0 ms 340 KB ans=NO N=4
4 Correct 1 ms 340 KB ans=YES N=5
5 Correct 1 ms 340 KB ans=YES N=9
6 Correct 1 ms 340 KB ans=YES N=5
7 Correct 0 ms 296 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 1 ms 340 KB ans=YES N=10
10 Correct 2 ms 340 KB ans=YES N=10
11 Correct 1 ms 340 KB ans=YES N=10
12 Correct 1 ms 340 KB ans=YES N=9
13 Correct 1 ms 340 KB ans=YES N=9
14 Correct 1 ms 340 KB ans=YES N=8
15 Correct 1 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB ans=YES N=1
2 Correct 1 ms 296 KB ans=YES N=4
3 Correct 0 ms 340 KB ans=NO N=4
4 Correct 1 ms 340 KB ans=YES N=5
5 Correct 1 ms 340 KB ans=YES N=9
6 Correct 1 ms 340 KB ans=YES N=5
7 Correct 0 ms 296 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 1 ms 340 KB ans=YES N=10
10 Correct 2 ms 340 KB ans=YES N=10
11 Correct 1 ms 340 KB ans=YES N=10
12 Correct 1 ms 340 KB ans=YES N=9
13 Correct 1 ms 340 KB ans=YES N=9
14 Correct 1 ms 340 KB ans=YES N=8
15 Correct 1 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
17 Correct 1 ms 340 KB ans=YES N=17
18 Correct 1 ms 340 KB ans=YES N=25
19 Correct 1 ms 340 KB ans=YES N=100
20 Correct 1 ms 296 KB ans=YES N=185
21 Correct 1 ms 340 KB ans=NO N=174
22 Correct 2 ms 340 KB ans=YES N=90
23 Correct 1 ms 300 KB ans=YES N=63
24 Correct 1 ms 340 KB ans=YES N=87
25 Correct 1 ms 340 KB ans=YES N=183
26 Correct 1 ms 340 KB ans=YES N=188
27 Correct 1 ms 296 KB ans=YES N=183
28 Correct 1 ms 340 KB ans=YES N=189
29 Correct 1 ms 296 KB ans=YES N=200
30 Correct 1 ms 340 KB ans=YES N=190
31 Correct 2 ms 340 KB ans=YES N=187
32 Correct 1 ms 292 KB ans=YES N=187
33 Correct 1 ms 340 KB ans=YES N=182
34 Correct 1 ms 340 KB ans=YES N=184
35 Correct 1 ms 292 KB ans=YES N=188
36 Correct 1 ms 340 KB ans=YES N=181
37 Correct 1 ms 340 KB ans=YES N=188
38 Correct 2 ms 292 KB ans=YES N=191
39 Correct 1 ms 340 KB ans=YES N=196
40 Correct 1 ms 340 KB ans=YES N=196
41 Correct 1 ms 300 KB ans=YES N=196
42 Correct 1 ms 424 KB ans=YES N=196
43 Correct 1 ms 300 KB ans=YES N=195
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB ans=YES N=1
2 Correct 1 ms 296 KB ans=YES N=4
3 Correct 0 ms 340 KB ans=NO N=4
4 Correct 1 ms 340 KB ans=YES N=5
5 Correct 1 ms 340 KB ans=YES N=9
6 Correct 1 ms 340 KB ans=YES N=5
7 Correct 0 ms 296 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 1 ms 340 KB ans=YES N=10
10 Correct 2 ms 340 KB ans=YES N=10
11 Correct 1 ms 340 KB ans=YES N=10
12 Correct 1 ms 340 KB ans=YES N=9
13 Correct 1 ms 340 KB ans=YES N=9
14 Correct 1 ms 340 KB ans=YES N=8
15 Correct 1 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
17 Correct 1 ms 340 KB ans=YES N=17
18 Correct 1 ms 340 KB ans=YES N=25
19 Correct 1 ms 340 KB ans=YES N=100
20 Correct 1 ms 296 KB ans=YES N=185
21 Correct 1 ms 340 KB ans=NO N=174
22 Correct 2 ms 340 KB ans=YES N=90
23 Correct 1 ms 300 KB ans=YES N=63
24 Correct 1 ms 340 KB ans=YES N=87
25 Correct 1 ms 340 KB ans=YES N=183
26 Correct 1 ms 340 KB ans=YES N=188
27 Correct 1 ms 296 KB ans=YES N=183
28 Correct 1 ms 340 KB ans=YES N=189
29 Correct 1 ms 296 KB ans=YES N=200
30 Correct 1 ms 340 KB ans=YES N=190
31 Correct 2 ms 340 KB ans=YES N=187
32 Correct 1 ms 292 KB ans=YES N=187
33 Correct 1 ms 340 KB ans=YES N=182
34 Correct 1 ms 340 KB ans=YES N=184
35 Correct 1 ms 292 KB ans=YES N=188
36 Correct 1 ms 340 KB ans=YES N=181
37 Correct 1 ms 340 KB ans=YES N=188
38 Correct 2 ms 292 KB ans=YES N=191
39 Correct 1 ms 340 KB ans=YES N=196
40 Correct 1 ms 340 KB ans=YES N=196
41 Correct 1 ms 300 KB ans=YES N=196
42 Correct 1 ms 424 KB ans=YES N=196
43 Correct 1 ms 300 KB ans=YES N=195
44 Correct 2 ms 432 KB ans=NO N=1934
45 Correct 2 ms 436 KB ans=NO N=1965
46 Correct 3 ms 724 KB ans=YES N=1824
47 Correct 3 ms 724 KB ans=YES N=1981
48 Correct 3 ms 724 KB ans=YES N=1814
49 Correct 3 ms 728 KB ans=YES N=1854
50 Correct 5 ms 724 KB ans=YES N=1831
51 Correct 3 ms 812 KB ans=YES N=2000
52 Correct 3 ms 724 KB ans=YES N=1847
53 Correct 3 ms 724 KB ans=YES N=1819
54 Correct 3 ms 740 KB ans=YES N=1986
55 Correct 4 ms 724 KB ans=YES N=2000
56 Correct 4 ms 724 KB ans=YES N=1834
57 Correct 4 ms 724 KB ans=YES N=1860
58 Correct 4 ms 692 KB ans=YES N=1898
59 Correct 3 ms 596 KB ans=YES N=1832
60 Correct 4 ms 724 KB ans=YES N=1929
61 Correct 4 ms 724 KB ans=YES N=1919
62 Correct 3 ms 596 KB ans=YES N=1882
63 Correct 3 ms 724 KB ans=YES N=1922
64 Correct 3 ms 724 KB ans=YES N=1989
65 Correct 2 ms 724 KB ans=YES N=1978
66 Correct 2 ms 724 KB ans=YES N=1867
67 Correct 3 ms 744 KB ans=YES N=1942
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 468 KB ans=NO N=1934
2 Correct 1 ms 436 KB ans=NO N=1965
3 Correct 3 ms 724 KB ans=YES N=1824
4 Correct 3 ms 724 KB ans=YES N=1981
5 Correct 2 ms 724 KB ans=YES N=1814
6 Correct 7 ms 696 KB ans=YES N=1854
7 Correct 3 ms 724 KB ans=YES N=1831
8 Correct 3 ms 724 KB ans=YES N=2000
9 Correct 3 ms 724 KB ans=YES N=1847
10 Correct 3 ms 740 KB ans=YES N=1819
11 Correct 3 ms 824 KB ans=YES N=1986
12 Correct 4 ms 724 KB ans=YES N=2000
13 Correct 3 ms 612 KB ans=YES N=1834
14 Correct 4 ms 688 KB ans=YES N=1860
15 Correct 4 ms 724 KB ans=YES N=1898
16 Correct 3 ms 692 KB ans=YES N=1832
17 Correct 3 ms 696 KB ans=YES N=1929
18 Correct 4 ms 700 KB ans=YES N=1919
19 Correct 4 ms 612 KB ans=YES N=1882
20 Correct 3 ms 724 KB ans=YES N=1922
21 Correct 3 ms 728 KB ans=YES N=1989
22 Correct 3 ms 724 KB ans=YES N=1978
23 Correct 3 ms 692 KB ans=YES N=1867
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB ans=YES N=1
2 Correct 1 ms 296 KB ans=YES N=4
3 Correct 0 ms 340 KB ans=NO N=4
4 Correct 1 ms 340 KB ans=YES N=5
5 Correct 1 ms 340 KB ans=YES N=9
6 Correct 1 ms 340 KB ans=YES N=5
7 Correct 0 ms 296 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 1 ms 340 KB ans=YES N=10
10 Correct 2 ms 340 KB ans=YES N=10
11 Correct 1 ms 340 KB ans=YES N=10
12 Correct 1 ms 340 KB ans=YES N=9
13 Correct 1 ms 340 KB ans=YES N=9
14 Correct 1 ms 340 KB ans=YES N=8
15 Correct 1 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
17 Correct 1 ms 340 KB ans=YES N=17
18 Correct 1 ms 340 KB ans=YES N=25
19 Correct 1 ms 340 KB ans=YES N=100
20 Correct 1 ms 296 KB ans=YES N=185
21 Correct 1 ms 340 KB ans=NO N=174
22 Correct 2 ms 340 KB ans=YES N=90
23 Correct 1 ms 300 KB ans=YES N=63
24 Correct 1 ms 340 KB ans=YES N=87
25 Correct 1 ms 340 KB ans=YES N=183
26 Correct 1 ms 340 KB ans=YES N=188
27 Correct 1 ms 296 KB ans=YES N=183
28 Correct 1 ms 340 KB ans=YES N=189
29 Correct 1 ms 296 KB ans=YES N=200
30 Correct 1 ms 340 KB ans=YES N=190
31 Correct 2 ms 340 KB ans=YES N=187
32 Correct 1 ms 292 KB ans=YES N=187
33 Correct 1 ms 340 KB ans=YES N=182
34 Correct 1 ms 340 KB ans=YES N=184
35 Correct 1 ms 292 KB ans=YES N=188
36 Correct 1 ms 340 KB ans=YES N=181
37 Correct 1 ms 340 KB ans=YES N=188
38 Correct 2 ms 292 KB ans=YES N=191
39 Correct 1 ms 340 KB ans=YES N=196
40 Correct 1 ms 340 KB ans=YES N=196
41 Correct 1 ms 300 KB ans=YES N=196
42 Correct 1 ms 424 KB ans=YES N=196
43 Correct 1 ms 300 KB ans=YES N=195
44 Correct 2 ms 432 KB ans=NO N=1934
45 Correct 2 ms 436 KB ans=NO N=1965
46 Correct 3 ms 724 KB ans=YES N=1824
47 Correct 3 ms 724 KB ans=YES N=1981
48 Correct 3 ms 724 KB ans=YES N=1814
49 Correct 3 ms 728 KB ans=YES N=1854
50 Correct 5 ms 724 KB ans=YES N=1831
51 Correct 3 ms 812 KB ans=YES N=2000
52 Correct 3 ms 724 KB ans=YES N=1847
53 Correct 3 ms 724 KB ans=YES N=1819
54 Correct 3 ms 740 KB ans=YES N=1986
55 Correct 4 ms 724 KB ans=YES N=2000
56 Correct 4 ms 724 KB ans=YES N=1834
57 Correct 4 ms 724 KB ans=YES N=1860
58 Correct 4 ms 692 KB ans=YES N=1898
59 Correct 3 ms 596 KB ans=YES N=1832
60 Correct 4 ms 724 KB ans=YES N=1929
61 Correct 4 ms 724 KB ans=YES N=1919
62 Correct 3 ms 596 KB ans=YES N=1882
63 Correct 3 ms 724 KB ans=YES N=1922
64 Correct 3 ms 724 KB ans=YES N=1989
65 Correct 2 ms 724 KB ans=YES N=1978
66 Correct 2 ms 724 KB ans=YES N=1867
67 Correct 3 ms 744 KB ans=YES N=1942
68 Correct 71 ms 9376 KB ans=NO N=66151
69 Correct 38 ms 5560 KB ans=NO N=64333
70 Correct 118 ms 15560 KB ans=YES N=69316
71 Correct 145 ms 15000 KB ans=YES N=66695
72 Correct 135 ms 15484 KB ans=YES N=68436
73 Correct 133 ms 15692 KB ans=YES N=70000
74 Correct 124 ms 15364 KB ans=YES N=68501
75 Correct 130 ms 15400 KB ans=YES N=70000
76 Correct 117 ms 13960 KB ans=YES N=65009
77 Correct 136 ms 12192 KB ans=YES N=67007
78 Correct 120 ms 11328 KB ans=YES N=66357
79 Correct 108 ms 11568 KB ans=YES N=65430
80 Correct 116 ms 10932 KB ans=YES N=65790
81 Correct 137 ms 11184 KB ans=YES N=66020
82 Correct 150 ms 11680 KB ans=YES N=65809
83 Correct 119 ms 12616 KB ans=YES N=65651
84 Correct 107 ms 11360 KB ans=YES N=68040
85 Correct 162 ms 11072 KB ans=YES N=66570
86 Correct 121 ms 13712 KB ans=YES N=65421
87 Correct 115 ms 11096 KB ans=YES N=68351
88 Correct 143 ms 15100 KB ans=YES N=67027
89 Correct 75 ms 14304 KB ans=YES N=68879
90 Correct 107 ms 14396 KB ans=YES N=67256
91 Correct 332 ms 32264 KB ans=YES N=148315
92 Correct 106 ms 12136 KB ans=NO N=142745
93 Correct 91 ms 14352 KB ans=NO N=148443
94 Correct 325 ms 34824 KB ans=YES N=148328
95 Correct 250 ms 34832 KB ans=YES N=147855
96 Correct 265 ms 35516 KB ans=YES N=150000
97 Correct 261 ms 34324 KB ans=YES N=144725
98 Correct 248 ms 35404 KB ans=YES N=149445
99 Correct 246 ms 33996 KB ans=YES N=144455
100 Correct 250 ms 33848 KB ans=YES N=143487
101 Correct 282 ms 34700 KB ans=YES N=149688
102 Correct 263 ms 26484 KB ans=YES N=141481
103 Correct 261 ms 30396 KB ans=YES N=147430
104 Correct 260 ms 29312 KB ans=YES N=142247
105 Correct 337 ms 29692 KB ans=YES N=149941
106 Correct 323 ms 26252 KB ans=YES N=141635
107 Correct 262 ms 25420 KB ans=YES N=142896
108 Correct 247 ms 25036 KB ans=YES N=142069
109 Correct 244 ms 29456 KB ans=YES N=142378
110 Correct 243 ms 26072 KB ans=YES N=150000
111 Correct 229 ms 25400 KB ans=YES N=141452
112 Correct 238 ms 25780 KB ans=YES N=134453
113 Correct 216 ms 32520 KB ans=YES N=144172
# 결과 실행 시간 메모리 Grader output
1 Correct 54 ms 9460 KB ans=NO N=66151
2 Correct 35 ms 5660 KB ans=NO N=64333
3 Correct 89 ms 15564 KB ans=YES N=69316
4 Correct 85 ms 15056 KB ans=YES N=66695
5 Correct 86 ms 15360 KB ans=YES N=68436
6 Correct 87 ms 15696 KB ans=YES N=70000
7 Correct 88 ms 15436 KB ans=YES N=68501
8 Correct 89 ms 15460 KB ans=YES N=70000
9 Correct 85 ms 13916 KB ans=YES N=65009
10 Correct 99 ms 12288 KB ans=YES N=67007
11 Correct 97 ms 11340 KB ans=YES N=66357
12 Correct 92 ms 11468 KB ans=YES N=65430
13 Correct 101 ms 11004 KB ans=YES N=65790
14 Correct 99 ms 11340 KB ans=YES N=66020
15 Correct 92 ms 11700 KB ans=YES N=65809
16 Correct 89 ms 12624 KB ans=YES N=65651
17 Correct 87 ms 11344 KB ans=YES N=68040
18 Correct 90 ms 11004 KB ans=YES N=66570
19 Correct 88 ms 13688 KB ans=YES N=65421
20 Correct 93 ms 11164 KB ans=YES N=68351
21 Correct 92 ms 15220 KB ans=YES N=67027
22 Correct 62 ms 14288 KB ans=YES N=68879
23 Correct 79 ms 14412 KB ans=YES N=67256
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 468 KB ans=NO N=1934
2 Correct 1 ms 436 KB ans=NO N=1965
3 Correct 3 ms 724 KB ans=YES N=1824
4 Correct 3 ms 724 KB ans=YES N=1981
5 Correct 2 ms 724 KB ans=YES N=1814
6 Correct 7 ms 696 KB ans=YES N=1854
7 Correct 3 ms 724 KB ans=YES N=1831
8 Correct 3 ms 724 KB ans=YES N=2000
9 Correct 3 ms 724 KB ans=YES N=1847
10 Correct 3 ms 740 KB ans=YES N=1819
11 Correct 3 ms 824 KB ans=YES N=1986
12 Correct 4 ms 724 KB ans=YES N=2000
13 Correct 3 ms 612 KB ans=YES N=1834
14 Correct 4 ms 688 KB ans=YES N=1860
15 Correct 4 ms 724 KB ans=YES N=1898
16 Correct 3 ms 692 KB ans=YES N=1832
17 Correct 3 ms 696 KB ans=YES N=1929
18 Correct 4 ms 700 KB ans=YES N=1919
19 Correct 4 ms 612 KB ans=YES N=1882
20 Correct 3 ms 724 KB ans=YES N=1922
21 Correct 3 ms 728 KB ans=YES N=1989
22 Correct 3 ms 724 KB ans=YES N=1978
23 Correct 3 ms 692 KB ans=YES N=1867
24 Correct 54 ms 9460 KB ans=NO N=66151
25 Correct 35 ms 5660 KB ans=NO N=64333
26 Correct 89 ms 15564 KB ans=YES N=69316
27 Correct 85 ms 15056 KB ans=YES N=66695
28 Correct 86 ms 15360 KB ans=YES N=68436
29 Correct 87 ms 15696 KB ans=YES N=70000
30 Correct 88 ms 15436 KB ans=YES N=68501
31 Correct 89 ms 15460 KB ans=YES N=70000
32 Correct 85 ms 13916 KB ans=YES N=65009
33 Correct 99 ms 12288 KB ans=YES N=67007
34 Correct 97 ms 11340 KB ans=YES N=66357
35 Correct 92 ms 11468 KB ans=YES N=65430
36 Correct 101 ms 11004 KB ans=YES N=65790
37 Correct 99 ms 11340 KB ans=YES N=66020
38 Correct 92 ms 11700 KB ans=YES N=65809
39 Correct 89 ms 12624 KB ans=YES N=65651
40 Correct 87 ms 11344 KB ans=YES N=68040
41 Correct 90 ms 11004 KB ans=YES N=66570
42 Correct 88 ms 13688 KB ans=YES N=65421
43 Correct 93 ms 11164 KB ans=YES N=68351
44 Correct 92 ms 15220 KB ans=YES N=67027
45 Correct 62 ms 14288 KB ans=YES N=68879
46 Correct 79 ms 14412 KB ans=YES N=67256
47 Correct 241 ms 32364 KB ans=YES N=148315
48 Correct 78 ms 12132 KB ans=NO N=142745
49 Correct 72 ms 14340 KB ans=NO N=148443
50 Correct 263 ms 34908 KB ans=YES N=148328
51 Correct 276 ms 34764 KB ans=YES N=147855
52 Correct 248 ms 35504 KB ans=YES N=150000
53 Correct 245 ms 34056 KB ans=YES N=144725
54 Correct 255 ms 35336 KB ans=YES N=149445
55 Correct 241 ms 33996 KB ans=YES N=144455
56 Correct 242 ms 33764 KB ans=YES N=143487
57 Correct 266 ms 34812 KB ans=YES N=149688
58 Correct 338 ms 26480 KB ans=YES N=141481
59 Correct 323 ms 30412 KB ans=YES N=147430
60 Correct 287 ms 29260 KB ans=YES N=142247
61 Correct 308 ms 29628 KB ans=YES N=149941
62 Correct 240 ms 26256 KB ans=YES N=141635
63 Correct 263 ms 25444 KB ans=YES N=142896
64 Correct 279 ms 25088 KB ans=YES N=142069
65 Correct 255 ms 29452 KB ans=YES N=142378
66 Correct 247 ms 26016 KB ans=YES N=150000
67 Correct 208 ms 25308 KB ans=YES N=141452
68 Correct 179 ms 25828 KB ans=YES N=134453
69 Correct 192 ms 32452 KB ans=YES N=144172