답안 #604823

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
604823 2022-07-25T10:09:07 Z alireza_kaviani 항공 노선도 (JOI18_airline) C++17
37 / 100
783 ms 27280 KB
#include "Alicelib.h"
#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> pii;

#define X		first
#define Y 		second
#define SZ(x)	int((x).size())

const int MAXN = 1510;
const int LOG = 10;

void Alice(int N, int M, int A[], int B[]){
	vector<pii> E;
	for(int i = 0 ; i < M ; i++){
		E.push_back({A[i] , B[i]});
	}
	for(int i = N ; i <= N + 100 ; i++){
		for(int j = 0 ; j < i ; j++){
			E.push_back({j , i});
		}
	}
	for(int i = N + 101 ; i <= N + 200 ; i++){
		for(int j = N ; j <= N + 100 ; j++){
			if(i % 2 == j % 2){
				E.push_back({j , i});
			}
		}
	}
	for(int i = 0 ; i < LOG ; i++){
		for(int j = 0 ; j < N ; j++){
			if(j & (1 << i)){
				E.push_back({j , N + 201 + i});
			}
		}
		for(int j = N ; j < N + i ; j++){
			E.push_back({j , N + 201 + i});
		}
	}
	InitG(N + 201 + LOG , SZ(E));
	for(int i = 0 ; i < SZ(E) ; i++){
		MakeG(i , E[i].X , E[i].Y);
	}
}

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

typedef pair<int, int> pii;

#define X		first
#define Y 		second
#define SZ(x)	int((x).size())

const int MAXN = 1510;
const int LOG = 10;

int deg[MAXN] , deg2[MAXN] , ind[MAXN] , type[MAXN];

void Bob(int N, int M, int A[], int B[]){
	for(int i = 0 ; i < M ; i++){
		deg[A[i]]++;
		deg[B[i]]++;
	}
	for(int i = 0 ; i < N ; i++){
		if(deg[i] >= N - LOG - 50 - 1){
			type[i] = 1;
		}
	}
	for(int i = 0 ; i < M ; i++){
		if(type[A[i]] == 1)	deg2[B[i]]++;
		if(type[B[i]] == 1)	deg2[A[i]]++;
	}
	int n = 0 , m = 0;
	for(int i = 0 ; i < N ; i++){
		if(type[i] == 1)	continue;
		if(deg2[i] >= 100){
			type[i] = 0;
			n++;
		}
		else if(deg2[i] >= 50){
			type[i] = 2;
		}
		else{
			type[i] = 3;
		}
	}
	vector<pii> E;
	for(int i = 0 ; i < M ; i++){
		if(type[A[i]] > type[B[i]])	swap(A[i] , B[i]);
		if(type[A[i]] == 0 && type[B[i]] == 3){
			ind[A[i]] |= (1 << deg2[B[i]]);
		}
		if(type[B[i]] == 0){
			E.push_back({A[i] , B[i]});
		}
	}
	m = SZ(E);
	InitMap(n , m);
	for(pii i : E){
		MakeMap(ind[i.X] , ind[i.Y]);
	}
}

# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 5028 KB Output is correct
2 Correct 10 ms 5000 KB Output is correct
3 Correct 7 ms 5024 KB Output is correct
4 Correct 7 ms 5112 KB Output is correct
5 Correct 6 ms 5116 KB Output is correct
6 Correct 6 ms 5172 KB Output is correct
7 Correct 6 ms 5092 KB Output is correct
8 Correct 8 ms 5120 KB Output is correct
9 Correct 7 ms 5052 KB Output is correct
10 Correct 6 ms 5132 KB Output is correct
11 Correct 6 ms 5072 KB Output is correct
12 Correct 8 ms 5260 KB Output is correct
13 Correct 10 ms 5028 KB Output is correct
14 Correct 7 ms 5052 KB Output is correct
15 Correct 7 ms 5024 KB Output is correct
16 Correct 5 ms 5052 KB Output is correct
17 Correct 8 ms 5052 KB Output is correct
18 Correct 6 ms 5120 KB Output is correct
19 Correct 7 ms 5024 KB Output is correct
20 Correct 6 ms 5024 KB Output is correct
21 Correct 7 ms 5136 KB Output is correct
22 Correct 7 ms 5104 KB Output is correct
23 Correct 7 ms 5052 KB Output is correct
24 Correct 6 ms 5132 KB Output is correct
25 Correct 7 ms 5028 KB Output is correct
26 Correct 7 ms 5028 KB Output is correct
27 Correct 6 ms 5076 KB Output is correct
28 Correct 6 ms 5144 KB Output is correct
29 Correct 7 ms 5024 KB Output is correct
30 Correct 5 ms 5120 KB Output is correct
31 Correct 6 ms 5052 KB Output is correct
32 Correct 7 ms 5132 KB Output is correct
33 Correct 6 ms 5024 KB Output is correct
34 Correct 6 ms 5132 KB Output is correct
35 Correct 8 ms 5080 KB Output is correct
36 Correct 7 ms 5104 KB Output is correct
37 Correct 6 ms 5024 KB Output is correct
38 Correct 7 ms 5112 KB Output is correct
39 Correct 7 ms 5136 KB Output is correct
40 Correct 7 ms 5048 KB Output is correct
41 Correct 7 ms 5024 KB Output is correct
42 Correct 8 ms 5116 KB Output is correct
43 Correct 7 ms 5080 KB Output is correct
44 Correct 7 ms 5132 KB Output is correct
45 Correct 6 ms 5040 KB Output is correct
46 Correct 8 ms 5112 KB Output is correct
47 Correct 8 ms 5160 KB Output is correct
48 Correct 8 ms 5024 KB Output is correct
49 Correct 7 ms 5028 KB Output is correct
50 Correct 7 ms 5100 KB Output is correct
51 Correct 6 ms 5000 KB Output is correct
52 Correct 6 ms 5064 KB Output is correct
53 Correct 8 ms 5116 KB Output is correct
54 Correct 7 ms 5052 KB Output is correct
55 Correct 7 ms 5112 KB Output is correct
56 Correct 8 ms 5052 KB Output is correct
57 Correct 7 ms 5024 KB Output is correct
58 Correct 7 ms 5052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 5028 KB Output is correct
2 Correct 10 ms 5000 KB Output is correct
3 Correct 7 ms 5024 KB Output is correct
4 Correct 7 ms 5112 KB Output is correct
5 Correct 6 ms 5116 KB Output is correct
6 Correct 6 ms 5172 KB Output is correct
7 Correct 6 ms 5092 KB Output is correct
8 Correct 8 ms 5120 KB Output is correct
9 Correct 7 ms 5052 KB Output is correct
10 Correct 6 ms 5132 KB Output is correct
11 Correct 6 ms 5072 KB Output is correct
12 Correct 8 ms 5260 KB Output is correct
13 Correct 10 ms 5028 KB Output is correct
14 Correct 7 ms 5052 KB Output is correct
15 Correct 7 ms 5024 KB Output is correct
16 Correct 5 ms 5052 KB Output is correct
17 Correct 8 ms 5052 KB Output is correct
18 Correct 6 ms 5120 KB Output is correct
19 Correct 7 ms 5024 KB Output is correct
20 Correct 6 ms 5024 KB Output is correct
21 Correct 7 ms 5136 KB Output is correct
22 Correct 7 ms 5104 KB Output is correct
23 Correct 7 ms 5052 KB Output is correct
24 Correct 6 ms 5132 KB Output is correct
25 Correct 7 ms 5028 KB Output is correct
26 Correct 7 ms 5028 KB Output is correct
27 Correct 6 ms 5076 KB Output is correct
28 Correct 6 ms 5144 KB Output is correct
29 Correct 7 ms 5024 KB Output is correct
30 Correct 5 ms 5120 KB Output is correct
31 Correct 6 ms 5052 KB Output is correct
32 Correct 7 ms 5132 KB Output is correct
33 Correct 6 ms 5024 KB Output is correct
34 Correct 6 ms 5132 KB Output is correct
35 Correct 8 ms 5080 KB Output is correct
36 Correct 7 ms 5104 KB Output is correct
37 Correct 6 ms 5024 KB Output is correct
38 Correct 7 ms 5112 KB Output is correct
39 Correct 7 ms 5136 KB Output is correct
40 Correct 7 ms 5048 KB Output is correct
41 Correct 7 ms 5024 KB Output is correct
42 Correct 8 ms 5116 KB Output is correct
43 Correct 7 ms 5080 KB Output is correct
44 Correct 7 ms 5132 KB Output is correct
45 Correct 6 ms 5040 KB Output is correct
46 Correct 8 ms 5112 KB Output is correct
47 Correct 8 ms 5160 KB Output is correct
48 Correct 8 ms 5024 KB Output is correct
49 Correct 7 ms 5028 KB Output is correct
50 Correct 7 ms 5100 KB Output is correct
51 Correct 6 ms 5000 KB Output is correct
52 Correct 6 ms 5064 KB Output is correct
53 Correct 8 ms 5116 KB Output is correct
54 Correct 7 ms 5052 KB Output is correct
55 Correct 7 ms 5112 KB Output is correct
56 Correct 8 ms 5052 KB Output is correct
57 Correct 7 ms 5024 KB Output is correct
58 Correct 7 ms 5052 KB Output is correct
59 Correct 10 ms 5068 KB Output is correct
60 Correct 7 ms 5140 KB Output is correct
61 Correct 7 ms 5124 KB Output is correct
62 Correct 12 ms 5084 KB Output is correct
63 Correct 9 ms 5064 KB Output is correct
64 Correct 11 ms 5112 KB Output is correct
65 Correct 10 ms 5060 KB Output is correct
66 Correct 8 ms 5092 KB Output is correct
67 Correct 8 ms 5144 KB Output is correct
68 Correct 9 ms 5028 KB Output is correct
69 Correct 8 ms 5136 KB Output is correct
70 Correct 8 ms 5056 KB Output is correct
71 Correct 10 ms 5096 KB Output is correct
72 Correct 10 ms 5136 KB Output is correct
73 Correct 9 ms 5052 KB Output is correct
74 Correct 13 ms 5028 KB Output is correct
75 Correct 7 ms 5072 KB Output is correct
76 Correct 7 ms 5060 KB Output is correct
77 Correct 9 ms 5172 KB Output is correct
78 Correct 7 ms 5104 KB Output is correct
79 Correct 7 ms 5148 KB Output is correct
80 Correct 7 ms 5120 KB Output is correct
81 Correct 9 ms 5032 KB Output is correct
82 Correct 9 ms 5004 KB Output is correct
83 Correct 7 ms 5112 KB Output is correct
84 Correct 8 ms 5032 KB Output is correct
85 Correct 10 ms 5036 KB Output is correct
86 Correct 7 ms 5156 KB Output is correct
87 Correct 7 ms 5088 KB Output is correct
88 Correct 7 ms 5168 KB Output is correct
89 Correct 10 ms 5176 KB Output is correct
90 Correct 8 ms 5040 KB Output is correct
91 Correct 9 ms 5024 KB Output is correct
92 Correct 8 ms 5028 KB Output is correct
93 Correct 10 ms 5112 KB Output is correct
94 Correct 12 ms 5032 KB Output is correct
95 Correct 9 ms 5068 KB Output is correct
96 Correct 9 ms 5056 KB Output is correct
97 Correct 12 ms 5032 KB Output is correct
98 Correct 9 ms 5120 KB Output is correct
99 Correct 8 ms 5044 KB Output is correct
100 Correct 8 ms 5088 KB Output is correct
101 Correct 7 ms 5220 KB Output is correct
102 Correct 9 ms 5108 KB Output is correct
103 Correct 12 ms 5072 KB Output is correct
104 Correct 9 ms 5056 KB Output is correct
105 Correct 9 ms 5064 KB Output is correct
106 Correct 10 ms 5104 KB Output is correct
107 Correct 8 ms 5056 KB Output is correct
108 Correct 8 ms 5032 KB Output is correct
109 Correct 9 ms 5096 KB Output is correct
110 Correct 7 ms 5132 KB Output is correct
111 Correct 10 ms 5052 KB Output is correct
112 Correct 8 ms 5064 KB Output is correct
113 Correct 8 ms 4960 KB Output is correct
114 Correct 9 ms 5048 KB Output is correct
115 Correct 9 ms 5028 KB Output is correct
116 Correct 7 ms 5052 KB Output is correct
117 Correct 8 ms 5032 KB Output is correct
118 Correct 8 ms 5028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 783 ms 27280 KB Output isn't correct
2 Halted 0 ms 0 KB -