답안 #207062

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
207062 2020-03-06T09:33:18 Z PeppaPig 항공 노선도 (JOI18_airline) C++14
22 / 100
723 ms 31160 KB
#include "Alicelib.h"
#include <bits/stdc++.h>

#define pii pair<int, int>
#define x first
#define y second

using namespace std;


void Alice(int n, int m, int A[], int B[]){
	vector<pii> E;
	for(int i = 0; i < m; i++) E.emplace_back(A[i], B[i]);
	for(int i = 0; i <= 9; i++) {
		for(int j = 0; j < n; j++) if(j >> i & 1)
			E.emplace_back(n + i, j);
		if(i < 9) E.emplace_back(n + i, n + i + 1);
	}
	for(int i = 0; i < n; i++) E.emplace_back(n + 10, i);
	E.emplace_back(n + 10, n + 11);

	InitG(n + 12, (int)E.size());
	for(int i = 0; i < E.size(); i++)
		MakeG(i, E[i].x, E[i].y);
}

#include "Boblib.h"
#include <bits/stdc++.h>

#define pii pair<int, int>
#define x first
#define y second

using namespace std;

const int N = 1e3+50;

static int n, rep;
static int is_node[N], id[N];
static vector<int> g[N];

void Bob(int n, int m, int A[], int B[]){
	for(int i = 0; i < m; i++) {
		g[A[i]].emplace_back(B[i]);
		g[B[i]].emplace_back(A[i]);
	}

	for(int i = 0; i < n; i++) if(g[i].size() == 1 && g[g[i][0]].size() == n - 11) {
		rep = g[i][0];
		for(int x : g[rep]) is_node[x] = 1;
		break;
	}
	int now = rep, pre = 0;
	for(int i = 0; i < n; i++) if(i != rep && !is_node[i] && g[i].size() <= g[now].size())
		now = i;
	for(int i = 9; ~i; i--) {
		for(int x : g[now]) if(is_node[x])
			id[x] += 1 << i;
		for(int x : g[now]) if(!is_node[x] && x != pre) {
			pre = now, now = x;
			break;
		}
	}

	vector<pii> E;
	for(int i = 0; i < m; i++) if(is_node[A[i]] && is_node[B[i]])
		E.emplace_back(id[A[i]], id[B[i]]);
	InitMap(n - 12, (int)E.size());
	for(pii p : E) MakeMap(p.x, p.y);
}

Compilation message

Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:23:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < E.size(); i++)
                 ~~^~~~~~~~~~

Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:22:70: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < n; i++) if(g[i].size() == 1 && g[g[i][0]].size() == n - 11) {
                                                    ~~~~~~~~~~~~~~~~~~^~~~~~~~~
Bob.cpp: At global scope:
Bob.cpp:12:12: warning: 'n' defined but not used [-Wunused-variable]
 static int n, rep;
            ^
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 6640 KB Output is correct
2 Correct 13 ms 6640 KB Output is correct
3 Correct 13 ms 6648 KB Output is correct
4 Correct 13 ms 6640 KB Output is correct
5 Correct 14 ms 6640 KB Output is correct
6 Correct 13 ms 6648 KB Output is correct
7 Correct 14 ms 6640 KB Output is correct
8 Correct 15 ms 6896 KB Output is correct
9 Correct 13 ms 6896 KB Output is correct
10 Correct 15 ms 6896 KB Output is correct
11 Correct 13 ms 6640 KB Output is correct
12 Correct 13 ms 6896 KB Output is correct
13 Correct 13 ms 6640 KB Output is correct
14 Correct 13 ms 6640 KB Output is correct
15 Correct 14 ms 6896 KB Output is correct
16 Correct 13 ms 6640 KB Output is correct
17 Correct 13 ms 6640 KB Output is correct
18 Correct 13 ms 6640 KB Output is correct
19 Correct 13 ms 7152 KB Output is correct
20 Correct 13 ms 6640 KB Output is correct
21 Correct 13 ms 6648 KB Output is correct
22 Correct 14 ms 6896 KB Output is correct
23 Correct 14 ms 6896 KB Output is correct
24 Correct 14 ms 6640 KB Output is correct
25 Correct 14 ms 6640 KB Output is correct
26 Correct 13 ms 6896 KB Output is correct
27 Correct 13 ms 6896 KB Output is correct
28 Correct 14 ms 6896 KB Output is correct
29 Correct 13 ms 6704 KB Output is correct
30 Correct 13 ms 6896 KB Output is correct
31 Correct 14 ms 6640 KB Output is correct
32 Correct 14 ms 6896 KB Output is correct
33 Correct 13 ms 6640 KB Output is correct
34 Correct 13 ms 6784 KB Output is correct
35 Correct 13 ms 6640 KB Output is correct
36 Correct 13 ms 6640 KB Output is correct
37 Correct 13 ms 6640 KB Output is correct
38 Correct 13 ms 6640 KB Output is correct
39 Correct 13 ms 6640 KB Output is correct
40 Correct 13 ms 6640 KB Output is correct
41 Correct 13 ms 6640 KB Output is correct
42 Correct 13 ms 6896 KB Output is correct
43 Correct 13 ms 6896 KB Output is correct
44 Correct 14 ms 6640 KB Output is correct
45 Correct 13 ms 6640 KB Output is correct
46 Correct 13 ms 6896 KB Output is correct
47 Correct 13 ms 6896 KB Output is correct
48 Correct 13 ms 6640 KB Output is correct
49 Correct 13 ms 6640 KB Output is correct
50 Correct 13 ms 6640 KB Output is correct
51 Correct 16 ms 6736 KB Output is correct
52 Correct 13 ms 6640 KB Output is correct
53 Correct 13 ms 6992 KB Output is correct
54 Correct 13 ms 6896 KB Output is correct
55 Correct 14 ms 6640 KB Output is correct
56 Correct 15 ms 6640 KB Output is correct
57 Correct 13 ms 6640 KB Output is correct
58 Correct 13 ms 6640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 6640 KB Output is correct
2 Correct 13 ms 6640 KB Output is correct
3 Correct 13 ms 6648 KB Output is correct
4 Correct 13 ms 6640 KB Output is correct
5 Correct 14 ms 6640 KB Output is correct
6 Correct 13 ms 6648 KB Output is correct
7 Correct 14 ms 6640 KB Output is correct
8 Correct 15 ms 6896 KB Output is correct
9 Correct 13 ms 6896 KB Output is correct
10 Correct 15 ms 6896 KB Output is correct
11 Correct 13 ms 6640 KB Output is correct
12 Correct 13 ms 6896 KB Output is correct
13 Correct 13 ms 6640 KB Output is correct
14 Correct 13 ms 6640 KB Output is correct
15 Correct 14 ms 6896 KB Output is correct
16 Correct 13 ms 6640 KB Output is correct
17 Correct 13 ms 6640 KB Output is correct
18 Correct 13 ms 6640 KB Output is correct
19 Correct 13 ms 7152 KB Output is correct
20 Correct 13 ms 6640 KB Output is correct
21 Correct 13 ms 6648 KB Output is correct
22 Correct 14 ms 6896 KB Output is correct
23 Correct 14 ms 6896 KB Output is correct
24 Correct 14 ms 6640 KB Output is correct
25 Correct 14 ms 6640 KB Output is correct
26 Correct 13 ms 6896 KB Output is correct
27 Correct 13 ms 6896 KB Output is correct
28 Correct 14 ms 6896 KB Output is correct
29 Correct 13 ms 6704 KB Output is correct
30 Correct 13 ms 6896 KB Output is correct
31 Correct 14 ms 6640 KB Output is correct
32 Correct 14 ms 6896 KB Output is correct
33 Correct 13 ms 6640 KB Output is correct
34 Correct 13 ms 6784 KB Output is correct
35 Correct 13 ms 6640 KB Output is correct
36 Correct 13 ms 6640 KB Output is correct
37 Correct 13 ms 6640 KB Output is correct
38 Correct 13 ms 6640 KB Output is correct
39 Correct 13 ms 6640 KB Output is correct
40 Correct 13 ms 6640 KB Output is correct
41 Correct 13 ms 6640 KB Output is correct
42 Correct 13 ms 6896 KB Output is correct
43 Correct 13 ms 6896 KB Output is correct
44 Correct 14 ms 6640 KB Output is correct
45 Correct 13 ms 6640 KB Output is correct
46 Correct 13 ms 6896 KB Output is correct
47 Correct 13 ms 6896 KB Output is correct
48 Correct 13 ms 6640 KB Output is correct
49 Correct 13 ms 6640 KB Output is correct
50 Correct 13 ms 6640 KB Output is correct
51 Correct 16 ms 6736 KB Output is correct
52 Correct 13 ms 6640 KB Output is correct
53 Correct 13 ms 6992 KB Output is correct
54 Correct 13 ms 6896 KB Output is correct
55 Correct 14 ms 6640 KB Output is correct
56 Correct 15 ms 6640 KB Output is correct
57 Correct 13 ms 6640 KB Output is correct
58 Correct 13 ms 6640 KB Output is correct
59 Correct 14 ms 6640 KB Output is correct
60 Correct 15 ms 6640 KB Output is correct
61 Correct 14 ms 6640 KB Output is correct
62 Correct 14 ms 6640 KB Output is correct
63 Correct 13 ms 6896 KB Output is correct
64 Correct 13 ms 6896 KB Output is correct
65 Correct 14 ms 6640 KB Output is correct
66 Correct 14 ms 6896 KB Output is correct
67 Correct 14 ms 6640 KB Output is correct
68 Correct 14 ms 6648 KB Output is correct
69 Correct 14 ms 6640 KB Output is correct
70 Correct 14 ms 6760 KB Output is correct
71 Correct 14 ms 6896 KB Output is correct
72 Correct 14 ms 6896 KB Output is correct
73 Correct 14 ms 6640 KB Output is correct
74 Correct 14 ms 6640 KB Output is correct
75 Correct 13 ms 6640 KB Output is correct
76 Correct 13 ms 6640 KB Output is correct
77 Correct 14 ms 6640 KB Output is correct
78 Correct 15 ms 6896 KB Output is correct
79 Correct 13 ms 6640 KB Output is correct
80 Correct 14 ms 6648 KB Output is correct
81 Incorrect 13 ms 6896 KB Wrong Answer [12]
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 665 ms 30536 KB Output is correct : V - N = 12
2 Correct 519 ms 25948 KB Output is correct : V - N = 12
3 Correct 207 ms 14024 KB Output is correct : V - N = 12
4 Correct 20 ms 7408 KB Output is correct : V - N = 12
5 Correct 132 ms 11224 KB Output is correct : V - N = 12
6 Correct 430 ms 23748 KB Output is correct : V - N = 12
7 Correct 648 ms 30128 KB Output is correct : V - N = 12
8 Correct 579 ms 28240 KB Output is correct : V - N = 12
9 Correct 299 ms 17096 KB Output is correct : V - N = 12
10 Correct 52 ms 8168 KB Output is correct : V - N = 12
11 Correct 70 ms 8928 KB Output is correct : V - N = 12
12 Correct 386 ms 19024 KB Output is correct : V - N = 12
13 Correct 602 ms 28856 KB Output is correct : V - N = 12
14 Correct 625 ms 29632 KB Output is correct : V - N = 12
15 Correct 390 ms 22544 KB Output is correct : V - N = 12
16 Correct 101 ms 9952 KB Output is correct : V - N = 12
17 Correct 27 ms 7664 KB Output is correct : V - N = 12
18 Correct 249 ms 15664 KB Output is correct : V - N = 12
19 Correct 556 ms 26840 KB Output is correct : V - N = 12
20 Correct 655 ms 31160 KB Output is correct : V - N = 12
21 Correct 194 ms 13008 KB Output is correct : V - N = 12
22 Correct 152 ms 11992 KB Output is correct : V - N = 12
23 Correct 69 ms 8936 KB Output is correct : V - N = 12
24 Correct 17 ms 7152 KB Output is correct : V - N = 12
25 Correct 43 ms 8168 KB Output is correct : V - N = 12
26 Correct 120 ms 10968 KB Output is correct : V - N = 12
27 Correct 190 ms 13008 KB Output is correct : V - N = 12
28 Correct 170 ms 12504 KB Output is correct : V - N = 12
29 Correct 93 ms 9944 KB Output is correct : V - N = 12
30 Correct 20 ms 7496 KB Output is correct : V - N = 12
31 Correct 19 ms 7152 KB Output is correct : V - N = 12
32 Correct 19 ms 7160 KB Output is correct : V - N = 12
33 Correct 18 ms 7152 KB Output is correct : V - N = 12
34 Correct 20 ms 7152 KB Output is correct : V - N = 12
35 Correct 18 ms 7152 KB Output is correct : V - N = 12
36 Correct 666 ms 30648 KB Output is correct : V - N = 12
37 Correct 717 ms 30776 KB Output is correct : V - N = 12
38 Correct 682 ms 30624 KB Output is correct : V - N = 12
39 Correct 675 ms 30840 KB Output is correct : V - N = 12
40 Correct 723 ms 30656 KB Output is correct : V - N = 12
41 Correct 143 ms 11144 KB Output is correct : V - N = 12
42 Correct 107 ms 10208 KB Output is correct : V - N = 12
43 Correct 112 ms 10448 KB Output is correct : V - N = 12
44 Correct 23 ms 7152 KB Output is correct : V - N = 12
45 Correct 74 ms 9440 KB Output is correct : V - N = 12
46 Correct 222 ms 14536 KB Output is correct : V - N = 12
47 Correct 126 ms 10968 KB Output is correct : V - N = 12
48 Correct 304 ms 17352 KB Output is correct : V - N = 12
49 Correct 67 ms 8928 KB Output is correct : V - N = 12
50 Correct 30 ms 7920 KB Output is correct : V - N = 12
51 Correct 509 ms 25620 KB Output is correct : V - N = 12
52 Correct 20 ms 7256 KB Output is correct : V - N = 12
53 Correct 433 ms 23488 KB Output is correct : V - N = 12
54 Correct 573 ms 27392 KB Output is correct : V - N = 12
55 Correct 43 ms 8168 KB Output is correct : V - N = 12
56 Correct 337 ms 18768 KB Output is correct : V - N = 12
57 Correct 639 ms 28856 KB Output is correct : V - N = 12
58 Correct 99 ms 10208 KB Output is correct : V - N = 12
59 Correct 258 ms 15560 KB Output is correct : V - N = 12
60 Correct 651 ms 29728 KB Output is correct : V - N = 12
61 Correct 15 ms 7152 KB Output is correct : V - N = 12
62 Correct 13 ms 6640 KB Output is correct : V - N = 12
63 Correct 13 ms 7152 KB Output is correct : V - N = 12
64 Correct 14 ms 6896 KB Output is correct : V - N = 12
65 Correct 14 ms 6640 KB Output is correct : V - N = 12
66 Correct 16 ms 6640 KB Output is correct : V - N = 12
67 Correct 14 ms 6640 KB Output is correct : V - N = 12
68 Correct 13 ms 6640 KB Output is correct : V - N = 12
69 Correct 13 ms 6640 KB Output is correct : V - N = 12
70 Correct 14 ms 6640 KB Output is correct : V - N = 12
71 Correct 13 ms 6640 KB Output is correct : V - N = 12
72 Correct 13 ms 6904 KB Output is correct : V - N = 12
73 Correct 14 ms 6640 KB Output is correct : V - N = 12
74 Correct 14 ms 6640 KB Output is correct : V - N = 12
75 Correct 14 ms 6640 KB Output is correct : V - N = 12
76 Correct 13 ms 6896 KB Output is correct : V - N = 12
77 Correct 13 ms 6640 KB Output is correct : V - N = 12
78 Incorrect 14 ms 6632 KB Wrong Answer [12]
79 Halted 0 ms 0 KB -