Submission #260393

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

static int G[1010][1010], 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[1010];
static bool chk[1010];
static int id[1010];

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 6912 KB Output is correct
2 Correct 5 ms 6912 KB Output is correct
3 Correct 6 ms 6912 KB Output is correct
4 Correct 5 ms 6912 KB Output is correct
5 Correct 6 ms 6912 KB Output is correct
6 Correct 5 ms 6912 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 5 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 6912 KB Output is correct
14 Correct 7 ms 6912 KB Output is correct
15 Correct 6 ms 6912 KB Output is correct
16 Correct 6 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 7 ms 6912 KB Output is correct
20 Correct 5 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 6 ms 6912 KB Output is correct
25 Correct 5 ms 6912 KB Output is correct
26 Correct 7 ms 6912 KB Output is correct
27 Correct 5 ms 6912 KB Output is correct
28 Correct 6 ms 6912 KB Output is correct
29 Correct 5 ms 6912 KB Output is correct
30 Correct 6 ms 6912 KB Output is correct
31 Correct 6 ms 6912 KB Output is correct
32 Correct 6 ms 6912 KB Output is correct
33 Correct 6 ms 6912 KB Output is correct
34 Correct 7 ms 6912 KB Output is correct
35 Correct 6 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 6 ms 6912 KB Output is correct
42 Correct 6 ms 6912 KB Output is correct
43 Correct 6 ms 6912 KB Output is correct
44 Correct 7 ms 6912 KB Output is correct
45 Correct 6 ms 6912 KB Output is correct
46 Correct 6 ms 6912 KB Output is correct
47 Correct 7 ms 6912 KB Output is correct
48 Correct 7 ms 6912 KB Output is correct
49 Correct 6 ms 6912 KB Output is correct
50 Correct 6 ms 6976 KB Output is correct
51 Runtime error 8 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 6912 KB Output is correct
2 Correct 5 ms 6912 KB Output is correct
3 Correct 6 ms 6912 KB Output is correct
4 Correct 5 ms 6912 KB Output is correct
5 Correct 6 ms 6912 KB Output is correct
6 Correct 5 ms 6912 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 5 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 6912 KB Output is correct
14 Correct 7 ms 6912 KB Output is correct
15 Correct 6 ms 6912 KB Output is correct
16 Correct 6 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 7 ms 6912 KB Output is correct
20 Correct 5 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 6 ms 6912 KB Output is correct
25 Correct 5 ms 6912 KB Output is correct
26 Correct 7 ms 6912 KB Output is correct
27 Correct 5 ms 6912 KB Output is correct
28 Correct 6 ms 6912 KB Output is correct
29 Correct 5 ms 6912 KB Output is correct
30 Correct 6 ms 6912 KB Output is correct
31 Correct 6 ms 6912 KB Output is correct
32 Correct 6 ms 6912 KB Output is correct
33 Correct 6 ms 6912 KB Output is correct
34 Correct 7 ms 6912 KB Output is correct
35 Correct 6 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 6 ms 6912 KB Output is correct
42 Correct 6 ms 6912 KB Output is correct
43 Correct 6 ms 6912 KB Output is correct
44 Correct 7 ms 6912 KB Output is correct
45 Correct 6 ms 6912 KB Output is correct
46 Correct 6 ms 6912 KB Output is correct
47 Correct 7 ms 6912 KB Output is correct
48 Correct 7 ms 6912 KB Output is correct
49 Correct 6 ms 6912 KB Output is correct
50 Correct 6 ms 6976 KB Output is correct
51 Runtime error 8 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 Incorrect 532 ms 15192 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -