Submission #260399

# Submission time Handle Problem Language Result Execution time Memory
260399 2020-08-10T08:19:33 Z 송준혁(#5057) Airline Route Map (JOI18_airline) C++14
0 / 100
709 ms 31144 KB
#include "Alicelib.h"
#include <cassert>
#include <cstdio>

static int G[1030][1030], cnt;

void Alice( int N, int M, int A[], int B[]){
	for (int i=0; i<M; i++) G[A[i]][B[i]] = G[B[i]][A[i]] = 1, cnt++;
	for (int i=0; i<N; i++) G[i][N] = 1, cnt++;
	for (int i=0; i<10; i++) for (int j=0; j<N; j++) if ((j+1)&(1<<i)) G[j][N+i+1]=1, cnt++;
	for (int i=1; i<10; i++) G[N+i][N+i+1]=1, cnt++;
	G[N][N+11] = 1, G[N+10][N+12] = 1, cnt += 2;
	InitG(N+13, cnt);
	for (int i=0; i<N+13; i++) for (int j=i+1; j<N+13; j++) if (G[i][j]) MakeG(--cnt, i, j);
}

#include "Boblib.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;

static vector<int> adj[1030];
static bool chk[1030];
static int id[1030];

void Bob(int V, int E, int C[], int D[]){
	int N=V-13;
	for (int i=0; i<E; i++) adj[C[i]].pb(D[i]), adj[D[i]].pb(C[i]);
	int x, y, p;
	for (int i=0; i<V; i++) if (adj[i].size() == 1){
		if (adj[adj[i][0]].size() == N+1) x = adj[i][0];
		else y = adj[i][0], p=i;
	}
	chk[x]=true;
	for (int v : adj[x]) chk[v]=true;
	for (int i=9; i>=0; i--){
		int z=0;
		for (int v : adj[y]){
			if (chk[v]) id[v] |= (1<<i);
			else if (v != p) z = v;
		}
		p=y, y=z;
	}
	int M=0;
	for (int i=0; i<E; i++) if (id[C[i]] && id[D[i]]) M++;
	InitMap(N, M);
	for (int i=0; i<E; i++) if (id[C[i]] && id[D[i]]) MakeMap(id[C[i]]-1, id[D[i]]-1);
}

Compilation message

Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:15:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (adj[adj[i][0]].size() == N+1) x = adj[i][0];
       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
Bob.cpp:24:9: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized]
    else if (v != p) z = v;
         ^~
Bob.cpp:13:9: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int x, y, p;
         ^
Bob.cpp:13:6: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int x, y, p;
      ^
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7168 KB Output is correct
2 Correct 7 ms 6912 KB Output is correct
3 Correct 5 ms 6912 KB Output is correct
4 Correct 5 ms 6912 KB Output is correct
5 Correct 5 ms 6912 KB Output is correct
6 Correct 7 ms 6976 KB Output is correct
7 Correct 5 ms 6912 KB Output is correct
8 Correct 5 ms 6912 KB Output is correct
9 Correct 5 ms 6912 KB Output is correct
10 Correct 6 ms 6912 KB Output is correct
11 Correct 5 ms 6912 KB Output is correct
12 Correct 5 ms 6912 KB Output is correct
13 Correct 6 ms 7168 KB Output is correct
14 Correct 5 ms 6912 KB Output is correct
15 Correct 5 ms 6912 KB Output is correct
16 Correct 5 ms 6912 KB Output is correct
17 Correct 5 ms 6912 KB Output is correct
18 Correct 5 ms 6912 KB Output is correct
19 Correct 5 ms 6912 KB Output is correct
20 Correct 6 ms 6912 KB Output is correct
21 Correct 6 ms 6912 KB Output is correct
22 Correct 6 ms 6912 KB Output is correct
23 Correct 5 ms 6912 KB Output is correct
24 Correct 5 ms 6912 KB Output is correct
25 Correct 5 ms 6912 KB Output is correct
26 Correct 5 ms 6912 KB Output is correct
27 Correct 5 ms 6912 KB Output is correct
28 Correct 5 ms 6912 KB Output is correct
29 Correct 5 ms 6912 KB Output is correct
30 Correct 5 ms 6912 KB Output is correct
31 Correct 5 ms 6912 KB Output is correct
32 Correct 5 ms 6912 KB Output is correct
33 Correct 5 ms 6912 KB Output is correct
34 Correct 5 ms 6912 KB Output is correct
35 Correct 5 ms 6912 KB Output is correct
36 Correct 5 ms 6912 KB Output is correct
37 Correct 6 ms 6912 KB Output is correct
38 Correct 5 ms 6912 KB Output is correct
39 Correct 6 ms 6912 KB Output is correct
40 Correct 5 ms 6912 KB Output is correct
41 Correct 5 ms 6912 KB Output is correct
42 Correct 5 ms 6912 KB Output is correct
43 Correct 5 ms 6912 KB Output is correct
44 Correct 5 ms 6912 KB Output is correct
45 Correct 5 ms 6912 KB Output is correct
46 Correct 5 ms 6912 KB Output is correct
47 Correct 5 ms 6912 KB Output is correct
48 Correct 5 ms 6912 KB Output is correct
49 Correct 5 ms 6912 KB Output is correct
50 Correct 5 ms 6912 KB Output is correct
51 Runtime error 9 ms 6912 KB Execution killed with signal 11 (could be triggered by violating memory limits)
52 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7168 KB Output is correct
2 Correct 7 ms 6912 KB Output is correct
3 Correct 5 ms 6912 KB Output is correct
4 Correct 5 ms 6912 KB Output is correct
5 Correct 5 ms 6912 KB Output is correct
6 Correct 7 ms 6976 KB Output is correct
7 Correct 5 ms 6912 KB Output is correct
8 Correct 5 ms 6912 KB Output is correct
9 Correct 5 ms 6912 KB Output is correct
10 Correct 6 ms 6912 KB Output is correct
11 Correct 5 ms 6912 KB Output is correct
12 Correct 5 ms 6912 KB Output is correct
13 Correct 6 ms 7168 KB Output is correct
14 Correct 5 ms 6912 KB Output is correct
15 Correct 5 ms 6912 KB Output is correct
16 Correct 5 ms 6912 KB Output is correct
17 Correct 5 ms 6912 KB Output is correct
18 Correct 5 ms 6912 KB Output is correct
19 Correct 5 ms 6912 KB Output is correct
20 Correct 6 ms 6912 KB Output is correct
21 Correct 6 ms 6912 KB Output is correct
22 Correct 6 ms 6912 KB Output is correct
23 Correct 5 ms 6912 KB Output is correct
24 Correct 5 ms 6912 KB Output is correct
25 Correct 5 ms 6912 KB Output is correct
26 Correct 5 ms 6912 KB Output is correct
27 Correct 5 ms 6912 KB Output is correct
28 Correct 5 ms 6912 KB Output is correct
29 Correct 5 ms 6912 KB Output is correct
30 Correct 5 ms 6912 KB Output is correct
31 Correct 5 ms 6912 KB Output is correct
32 Correct 5 ms 6912 KB Output is correct
33 Correct 5 ms 6912 KB Output is correct
34 Correct 5 ms 6912 KB Output is correct
35 Correct 5 ms 6912 KB Output is correct
36 Correct 5 ms 6912 KB Output is correct
37 Correct 6 ms 6912 KB Output is correct
38 Correct 5 ms 6912 KB Output is correct
39 Correct 6 ms 6912 KB Output is correct
40 Correct 5 ms 6912 KB Output is correct
41 Correct 5 ms 6912 KB Output is correct
42 Correct 5 ms 6912 KB Output is correct
43 Correct 5 ms 6912 KB Output is correct
44 Correct 5 ms 6912 KB Output is correct
45 Correct 5 ms 6912 KB Output is correct
46 Correct 5 ms 6912 KB Output is correct
47 Correct 5 ms 6912 KB Output is correct
48 Correct 5 ms 6912 KB Output is correct
49 Correct 5 ms 6912 KB Output is correct
50 Correct 5 ms 6912 KB Output is correct
51 Runtime error 9 ms 6912 KB Execution killed with signal 11 (could be triggered by violating memory limits)
52 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 670 ms 30960 KB Output is partially correct : V - N = 13
2 Partially correct 522 ms 27360 KB Output is partially correct : V - N = 13
3 Partially correct 211 ms 19808 KB Output is partially correct : V - N = 13
4 Partially correct 18 ms 15104 KB Output is partially correct : V - N = 13
5 Partially correct 133 ms 17992 KB Output is partially correct : V - N = 13
6 Partially correct 457 ms 25360 KB Output is partially correct : V - N = 13
7 Partially correct 675 ms 30760 KB Output is partially correct : V - N = 13
8 Partially correct 594 ms 29072 KB Output is partially correct : V - N = 13
9 Partially correct 305 ms 21944 KB Output is partially correct : V - N = 13
10 Partially correct 44 ms 15872 KB Output is partially correct : V - N = 13
11 Partially correct 68 ms 16520 KB Output is partially correct : V - N = 13
12 Partially correct 359 ms 23160 KB Output is partially correct : V - N = 13
13 Partially correct 667 ms 29808 KB Output is partially correct : V - N = 13
14 Partially correct 628 ms 30312 KB Output is partially correct : V - N = 13
15 Partially correct 401 ms 24176 KB Output is partially correct : V - N = 13
16 Partially correct 99 ms 17144 KB Output is partially correct : V - N = 13
17 Partially correct 25 ms 15608 KB Output is partially correct : V - N = 13
18 Partially correct 268 ms 20904 KB Output is partially correct : V - N = 13
19 Partially correct 579 ms 28416 KB Output is partially correct : V - N = 13
20 Partially correct 709 ms 30872 KB Output is partially correct : V - N = 13
21 Partially correct 181 ms 15328 KB Output is partially correct : V - N = 13
22 Partially correct 151 ms 14504 KB Output is partially correct : V - N = 13
23 Partially correct 86 ms 12528 KB Output is partially correct : V - N = 13
24 Partially correct 12 ms 11264 KB Output is partially correct : V - N = 13
25 Partially correct 33 ms 12032 KB Output is partially correct : V - N = 13
26 Partially correct 128 ms 13872 KB Output is partially correct : V - N = 13
27 Partially correct 172 ms 15288 KB Output is partially correct : V - N = 13
28 Partially correct 163 ms 14904 KB Output is partially correct : V - N = 13
29 Partially correct 83 ms 13072 KB Output is partially correct : V - N = 13
30 Partially correct 13 ms 11264 KB Output is partially correct : V - N = 13
31 Partially correct 15 ms 15104 KB Output is partially correct : V - N = 13
32 Partially correct 14 ms 15104 KB Output is partially correct : V - N = 13
33 Partially correct 16 ms 15104 KB Output is partially correct : V - N = 13
34 Partially correct 14 ms 15104 KB Output is partially correct : V - N = 13
35 Partially correct 15 ms 15104 KB Output is partially correct : V - N = 13
36 Partially correct 692 ms 30896 KB Output is partially correct : V - N = 13
37 Partially correct 692 ms 30920 KB Output is partially correct : V - N = 13
38 Partially correct 685 ms 31144 KB Output is partially correct : V - N = 13
39 Partially correct 651 ms 30944 KB Output is partially correct : V - N = 13
40 Partially correct 687 ms 30928 KB Output is partially correct : V - N = 13
41 Partially correct 124 ms 17904 KB Output is partially correct : V - N = 13
42 Partially correct 107 ms 17296 KB Output is partially correct : V - N = 13
43 Partially correct 115 ms 17544 KB Output is partially correct : V - N = 13
44 Partially correct 15 ms 15104 KB Output is partially correct : V - N = 13
45 Partially correct 70 ms 16768 KB Output is partially correct : V - N = 13
46 Partially correct 246 ms 20272 KB Output is partially correct : V - N = 13
47 Partially correct 124 ms 17832 KB Output is partially correct : V - N = 13
48 Partially correct 324 ms 22112 KB Output is partially correct : V - N = 13
49 Partially correct 68 ms 16368 KB Output is partially correct : V - N = 13
50 Partially correct 23 ms 15864 KB Output is partially correct : V - N = 13
51 Partially correct 556 ms 27648 KB Output is partially correct : V - N = 13
52 Partially correct 15 ms 15360 KB Output is partially correct : V - N = 13
53 Partially correct 459 ms 25152 KB Output is partially correct : V - N = 13
54 Partially correct 583 ms 29360 KB Output is partially correct : V - N = 13
55 Partially correct 34 ms 16128 KB Output is partially correct : V - N = 13
56 Partially correct 336 ms 23024 KB Output is partially correct : V - N = 13
57 Partially correct 663 ms 29728 KB Output is partially correct : V - N = 13
58 Partially correct 89 ms 17080 KB Output is partially correct : V - N = 13
59 Partially correct 219 ms 20736 KB Output is partially correct : V - N = 13
60 Partially correct 694 ms 30304 KB Output is partially correct : V - N = 13
61 Partially correct 7 ms 7168 KB Output is partially correct : V - N = 13
62 Partially correct 7 ms 7424 KB Output is partially correct : V - N = 13
63 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
64 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
65 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
66 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
67 Partially correct 6 ms 7424 KB Output is partially correct : V - N = 13
68 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
69 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
70 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
71 Partially correct 7 ms 7168 KB Output is partially correct : V - N = 13
72 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
73 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
74 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
75 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
76 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
77 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
78 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
79 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
80 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
81 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
82 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
83 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
84 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
85 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
86 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
87 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
88 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
89 Partially correct 6 ms 7424 KB Output is partially correct : V - N = 13
90 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
91 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
92 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
93 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
94 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
95 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
96 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
97 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
98 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
99 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
100 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
101 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
102 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
103 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
104 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
105 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
106 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
107 Partially correct 6 ms 7424 KB Output is partially correct : V - N = 13
108 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
109 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
110 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
111 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
112 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
113 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
114 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
115 Partially correct 5 ms 7424 KB Output is partially correct : V - N = 13
116 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
117 Partially correct 7 ms 7168 KB Output is partially correct : V - N = 13
118 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
119 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
120 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
121 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
122 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
123 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
124 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
125 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
126 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
127 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
128 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
129 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
130 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
131 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
132 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
133 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
134 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
135 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
136 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
137 Partially correct 7 ms 6976 KB Output is partially correct : V - N = 13
138 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
139 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
140 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
141 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
142 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
143 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
144 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
145 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
146 Partially correct 5 ms 7168 KB Output is partially correct : V - N = 13
147 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
148 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
149 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
150 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
151 Partially correct 6 ms 6976 KB Output is partially correct : V - N = 13
152 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
153 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
154 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
155 Partially correct 7 ms 6912 KB Output is partially correct : V - N = 13
156 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
157 Partially correct 6 ms 7168 KB Output is partially correct : V - N = 13
158 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
159 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
160 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
161 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
162 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
163 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
164 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
165 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
166 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
167 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
168 Partially correct 6 ms 6912 KB Output is partially correct : V - N = 13
169 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
170 Partially correct 5 ms 6912 KB Output is partially correct : V - N = 13
171 Runtime error 7 ms 6912 KB Execution killed with signal 11 (could be triggered by violating memory limits)
172 Halted 0 ms 0 KB -