Submission #108807

# Submission time Handle Problem Language Result Execution time Memory
108807 2019-05-02T08:15:25 Z tictaccat Airline Route Map (JOI18_airline) C++11
0 / 100
632 ms 127040 KB
#include "Alicelib.h"
#include <cassert>
#include <cstdio>
#include <bits/stdc++.h>

using namespace std;

void Alice( int N, int M, int At[], int Bt[] ){

	vector<vector<int>> adj(4*N*N);

	for (int i = 0; i < M; i++) {
		adj[At[i]].push_back(Bt[i]);
		adj[Bt[i]].push_back(At[i]);
	}

	int c = N;
	int e = M;

	for (int i = 0; i < N; i++) {
		for (int j = 0; j <= i; j++) {
			adj[c].push_back(i);
			adj[i].push_back(c);
			e++;
			c++;
		}
	}

	for (int i = N; i < c; i++) {
		adj[c].push_back(i);
		adj[i].push_back(c);
		e++;
	}



	InitG(c+1, e);

	int k = 0;

	for (int i = 0; i <= c; i++) {
		for (int j: adj[i]) {
			if (j < i) continue;
			MakeG(k++,i,j);
		}
	}
	
}

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

using namespace std;

void Bob( int V, int U, int C[], int D[] ){

	vector<vector<int>> adj(V);

	for (int i = 0; i < U; i++) {
		adj[C[i]].push_back(D[i]);
		adj[D[i]].push_back(C[i]);
	}

	int spec = max_element(adj.begin(),adj.end(),[](vector<int> &a, vector<int> &b){return a.size() < b.size();}) - adj.begin();

	vector<bool> special(V,false);

	for (int i: adj[spec]) {
		special[i] = true;
	}

	vector<int> actual(V,-1);

	int N = 0;

	for (int i = 0; i < V; i++) {
		if (i == spec) continue;
		int c = 0;
		for (int j: adj[i]) {
			if (special[j]) c++;
		}
		if (c > 0) {
			actual[i] = c-1;
			N++;
		}
	}

//	cout << N << "\n";

	vector<pair<int,int>> el;

	for (int i = 0; i < U; i++) {
		if (actual[C[i]] != -1 && actual[D[i]] != -1) {
			el.push_back(make_pair(actual[C[i]],actual[D[i]]));
		}
	}

	InitMap(N,el.size());

	for (auto p: el) {
		MakeMap(p.first,p.second);
	}

	// InitMap( 3, 2 );
	// MakeMap( 1, 2 );
	// MakeMap( 1, 3 );
}

# Verdict Execution time Memory Grader output
1 Correct 8 ms 6656 KB Output is correct
2 Correct 8 ms 6912 KB Output is correct
3 Correct 10 ms 6912 KB Output is correct
4 Correct 10 ms 6912 KB Output is correct
5 Correct 9 ms 6656 KB Output is correct
6 Correct 10 ms 6912 KB Output is correct
7 Correct 9 ms 6912 KB Output is correct
8 Correct 9 ms 6656 KB Output is correct
9 Correct 10 ms 6912 KB Output is correct
10 Correct 8 ms 6656 KB Output is correct
11 Correct 10 ms 6656 KB Output is correct
12 Correct 8 ms 6912 KB Output is correct
13 Correct 9 ms 6912 KB Output is correct
14 Correct 12 ms 6656 KB Output is correct
15 Correct 9 ms 6912 KB Output is correct
16 Correct 9 ms 6912 KB Output is correct
17 Correct 9 ms 6912 KB Output is correct
18 Correct 9 ms 6656 KB Output is correct
19 Correct 10 ms 6656 KB Output is correct
20 Correct 10 ms 6656 KB Output is correct
21 Correct 10 ms 6912 KB Output is correct
22 Correct 8 ms 6912 KB Output is correct
23 Correct 10 ms 6656 KB Output is correct
24 Correct 9 ms 6656 KB Output is correct
25 Correct 8 ms 6656 KB Output is correct
26 Correct 8 ms 6656 KB Output is correct
27 Correct 8 ms 6656 KB Output is correct
28 Correct 8 ms 6912 KB Output is correct
29 Correct 9 ms 6656 KB Output is correct
30 Correct 8 ms 6656 KB Output is correct
31 Correct 9 ms 6656 KB Output is correct
32 Correct 10 ms 6912 KB Output is correct
33 Correct 8 ms 6656 KB Output is correct
34 Correct 9 ms 6656 KB Output is correct
35 Correct 7 ms 6912 KB Output is correct
36 Correct 8 ms 6912 KB Output is correct
37 Correct 10 ms 6656 KB Output is correct
38 Correct 9 ms 6656 KB Output is correct
39 Correct 10 ms 6656 KB Output is correct
40 Correct 9 ms 6656 KB Output is correct
41 Correct 10 ms 6912 KB Output is correct
42 Correct 9 ms 6912 KB Output is correct
43 Correct 9 ms 6912 KB Output is correct
44 Correct 10 ms 6656 KB Output is correct
45 Correct 10 ms 6912 KB Output is correct
46 Correct 10 ms 6656 KB Output is correct
47 Correct 9 ms 6912 KB Output is correct
48 Correct 8 ms 6656 KB Output is correct
49 Correct 9 ms 6912 KB Output is correct
50 Correct 8 ms 6656 KB Output is correct
51 Incorrect 9 ms 6656 KB Wrong Answer [10]
52 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 6656 KB Output is correct
2 Correct 8 ms 6912 KB Output is correct
3 Correct 10 ms 6912 KB Output is correct
4 Correct 10 ms 6912 KB Output is correct
5 Correct 9 ms 6656 KB Output is correct
6 Correct 10 ms 6912 KB Output is correct
7 Correct 9 ms 6912 KB Output is correct
8 Correct 9 ms 6656 KB Output is correct
9 Correct 10 ms 6912 KB Output is correct
10 Correct 8 ms 6656 KB Output is correct
11 Correct 10 ms 6656 KB Output is correct
12 Correct 8 ms 6912 KB Output is correct
13 Correct 9 ms 6912 KB Output is correct
14 Correct 12 ms 6656 KB Output is correct
15 Correct 9 ms 6912 KB Output is correct
16 Correct 9 ms 6912 KB Output is correct
17 Correct 9 ms 6912 KB Output is correct
18 Correct 9 ms 6656 KB Output is correct
19 Correct 10 ms 6656 KB Output is correct
20 Correct 10 ms 6656 KB Output is correct
21 Correct 10 ms 6912 KB Output is correct
22 Correct 8 ms 6912 KB Output is correct
23 Correct 10 ms 6656 KB Output is correct
24 Correct 9 ms 6656 KB Output is correct
25 Correct 8 ms 6656 KB Output is correct
26 Correct 8 ms 6656 KB Output is correct
27 Correct 8 ms 6656 KB Output is correct
28 Correct 8 ms 6912 KB Output is correct
29 Correct 9 ms 6656 KB Output is correct
30 Correct 8 ms 6656 KB Output is correct
31 Correct 9 ms 6656 KB Output is correct
32 Correct 10 ms 6912 KB Output is correct
33 Correct 8 ms 6656 KB Output is correct
34 Correct 9 ms 6656 KB Output is correct
35 Correct 7 ms 6912 KB Output is correct
36 Correct 8 ms 6912 KB Output is correct
37 Correct 10 ms 6656 KB Output is correct
38 Correct 9 ms 6656 KB Output is correct
39 Correct 10 ms 6656 KB Output is correct
40 Correct 9 ms 6656 KB Output is correct
41 Correct 10 ms 6912 KB Output is correct
42 Correct 9 ms 6912 KB Output is correct
43 Correct 9 ms 6912 KB Output is correct
44 Correct 10 ms 6656 KB Output is correct
45 Correct 10 ms 6912 KB Output is correct
46 Correct 10 ms 6656 KB Output is correct
47 Correct 9 ms 6912 KB Output is correct
48 Correct 8 ms 6656 KB Output is correct
49 Correct 9 ms 6912 KB Output is correct
50 Correct 8 ms 6656 KB Output is correct
51 Incorrect 9 ms 6656 KB Wrong Answer [10]
52 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 632 ms 127040 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -