#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 + 10*N + 1000);
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++;
}
}
c += 20;
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 || special[i]) 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 );
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
6656 KB |
Output is correct |
2 |
Correct |
8 ms |
6912 KB |
Output is correct |
3 |
Correct |
8 ms |
6912 KB |
Output is correct |
4 |
Correct |
10 ms |
6656 KB |
Output is correct |
5 |
Correct |
11 ms |
6912 KB |
Output is correct |
6 |
Correct |
10 ms |
6912 KB |
Output is correct |
7 |
Correct |
11 ms |
6656 KB |
Output is correct |
8 |
Correct |
10 ms |
6656 KB |
Output is correct |
9 |
Correct |
9 ms |
6912 KB |
Output is correct |
10 |
Correct |
8 ms |
6656 KB |
Output is correct |
11 |
Correct |
9 ms |
6912 KB |
Output is correct |
12 |
Correct |
11 ms |
6912 KB |
Output is correct |
13 |
Correct |
9 ms |
6912 KB |
Output is correct |
14 |
Correct |
9 ms |
6912 KB |
Output is correct |
15 |
Correct |
10 ms |
6912 KB |
Output is correct |
16 |
Correct |
9 ms |
6656 KB |
Output is correct |
17 |
Correct |
27 ms |
6656 KB |
Output is correct |
18 |
Correct |
8 ms |
6656 KB |
Output is correct |
19 |
Correct |
10 ms |
6912 KB |
Output is correct |
20 |
Correct |
9 ms |
6656 KB |
Output is correct |
21 |
Correct |
10 ms |
6656 KB |
Output is correct |
22 |
Correct |
9 ms |
6656 KB |
Output is correct |
23 |
Correct |
10 ms |
6912 KB |
Output is correct |
24 |
Correct |
9 ms |
6656 KB |
Output is correct |
25 |
Correct |
9 ms |
6656 KB |
Output is correct |
26 |
Correct |
9 ms |
6656 KB |
Output is correct |
27 |
Correct |
9 ms |
6760 KB |
Output is correct |
28 |
Correct |
11 ms |
6912 KB |
Output is correct |
29 |
Correct |
10 ms |
6912 KB |
Output is correct |
30 |
Correct |
8 ms |
6656 KB |
Output is correct |
31 |
Correct |
8 ms |
6656 KB |
Output is correct |
32 |
Correct |
8 ms |
6656 KB |
Output is correct |
33 |
Correct |
9 ms |
6656 KB |
Output is correct |
34 |
Correct |
9 ms |
6656 KB |
Output is correct |
35 |
Correct |
8 ms |
6656 KB |
Output is correct |
36 |
Correct |
8 ms |
6656 KB |
Output is correct |
37 |
Correct |
11 ms |
6912 KB |
Output is correct |
38 |
Correct |
10 ms |
6912 KB |
Output is correct |
39 |
Correct |
10 ms |
6656 KB |
Output is correct |
40 |
Correct |
10 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 |
9 ms |
6912 KB |
Output is correct |
45 |
Correct |
9 ms |
6656 KB |
Output is correct |
46 |
Correct |
9 ms |
6912 KB |
Output is correct |
47 |
Correct |
8 ms |
6656 KB |
Output is correct |
48 |
Correct |
8 ms |
6912 KB |
Output is correct |
49 |
Correct |
8 ms |
6656 KB |
Output is correct |
50 |
Correct |
9 ms |
6912 KB |
Output is correct |
51 |
Correct |
11 ms |
6912 KB |
Output is correct |
52 |
Correct |
9 ms |
6656 KB |
Output is correct |
53 |
Correct |
8 ms |
6656 KB |
Output is correct |
54 |
Correct |
9 ms |
6912 KB |
Output is correct |
55 |
Correct |
10 ms |
6912 KB |
Output is correct |
56 |
Correct |
8 ms |
6912 KB |
Output is correct |
57 |
Correct |
9 ms |
6912 KB |
Output is correct |
58 |
Correct |
10 ms |
6656 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
6656 KB |
Output is correct |
2 |
Correct |
8 ms |
6912 KB |
Output is correct |
3 |
Correct |
8 ms |
6912 KB |
Output is correct |
4 |
Correct |
10 ms |
6656 KB |
Output is correct |
5 |
Correct |
11 ms |
6912 KB |
Output is correct |
6 |
Correct |
10 ms |
6912 KB |
Output is correct |
7 |
Correct |
11 ms |
6656 KB |
Output is correct |
8 |
Correct |
10 ms |
6656 KB |
Output is correct |
9 |
Correct |
9 ms |
6912 KB |
Output is correct |
10 |
Correct |
8 ms |
6656 KB |
Output is correct |
11 |
Correct |
9 ms |
6912 KB |
Output is correct |
12 |
Correct |
11 ms |
6912 KB |
Output is correct |
13 |
Correct |
9 ms |
6912 KB |
Output is correct |
14 |
Correct |
9 ms |
6912 KB |
Output is correct |
15 |
Correct |
10 ms |
6912 KB |
Output is correct |
16 |
Correct |
9 ms |
6656 KB |
Output is correct |
17 |
Correct |
27 ms |
6656 KB |
Output is correct |
18 |
Correct |
8 ms |
6656 KB |
Output is correct |
19 |
Correct |
10 ms |
6912 KB |
Output is correct |
20 |
Correct |
9 ms |
6656 KB |
Output is correct |
21 |
Correct |
10 ms |
6656 KB |
Output is correct |
22 |
Correct |
9 ms |
6656 KB |
Output is correct |
23 |
Correct |
10 ms |
6912 KB |
Output is correct |
24 |
Correct |
9 ms |
6656 KB |
Output is correct |
25 |
Correct |
9 ms |
6656 KB |
Output is correct |
26 |
Correct |
9 ms |
6656 KB |
Output is correct |
27 |
Correct |
9 ms |
6760 KB |
Output is correct |
28 |
Correct |
11 ms |
6912 KB |
Output is correct |
29 |
Correct |
10 ms |
6912 KB |
Output is correct |
30 |
Correct |
8 ms |
6656 KB |
Output is correct |
31 |
Correct |
8 ms |
6656 KB |
Output is correct |
32 |
Correct |
8 ms |
6656 KB |
Output is correct |
33 |
Correct |
9 ms |
6656 KB |
Output is correct |
34 |
Correct |
9 ms |
6656 KB |
Output is correct |
35 |
Correct |
8 ms |
6656 KB |
Output is correct |
36 |
Correct |
8 ms |
6656 KB |
Output is correct |
37 |
Correct |
11 ms |
6912 KB |
Output is correct |
38 |
Correct |
10 ms |
6912 KB |
Output is correct |
39 |
Correct |
10 ms |
6656 KB |
Output is correct |
40 |
Correct |
10 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 |
9 ms |
6912 KB |
Output is correct |
45 |
Correct |
9 ms |
6656 KB |
Output is correct |
46 |
Correct |
9 ms |
6912 KB |
Output is correct |
47 |
Correct |
8 ms |
6656 KB |
Output is correct |
48 |
Correct |
8 ms |
6912 KB |
Output is correct |
49 |
Correct |
8 ms |
6656 KB |
Output is correct |
50 |
Correct |
9 ms |
6912 KB |
Output is correct |
51 |
Correct |
11 ms |
6912 KB |
Output is correct |
52 |
Correct |
9 ms |
6656 KB |
Output is correct |
53 |
Correct |
8 ms |
6656 KB |
Output is correct |
54 |
Correct |
9 ms |
6912 KB |
Output is correct |
55 |
Correct |
10 ms |
6912 KB |
Output is correct |
56 |
Correct |
8 ms |
6912 KB |
Output is correct |
57 |
Correct |
9 ms |
6912 KB |
Output is correct |
58 |
Correct |
10 ms |
6656 KB |
Output is correct |
59 |
Correct |
10 ms |
7424 KB |
Output is correct |
60 |
Correct |
11 ms |
7168 KB |
Output is correct |
61 |
Correct |
10 ms |
7424 KB |
Output is correct |
62 |
Correct |
12 ms |
7424 KB |
Output is correct |
63 |
Correct |
12 ms |
7168 KB |
Output is correct |
64 |
Correct |
9 ms |
7168 KB |
Output is correct |
65 |
Correct |
11 ms |
7168 KB |
Output is correct |
66 |
Correct |
11 ms |
7168 KB |
Output is correct |
67 |
Correct |
12 ms |
7168 KB |
Output is correct |
68 |
Correct |
10 ms |
7424 KB |
Output is correct |
69 |
Correct |
11 ms |
7168 KB |
Output is correct |
70 |
Correct |
11 ms |
7424 KB |
Output is correct |
71 |
Correct |
9 ms |
7168 KB |
Output is correct |
72 |
Correct |
12 ms |
7168 KB |
Output is correct |
73 |
Correct |
12 ms |
7168 KB |
Output is correct |
74 |
Correct |
11 ms |
7168 KB |
Output is correct |
75 |
Correct |
10 ms |
7168 KB |
Output is correct |
76 |
Correct |
11 ms |
7168 KB |
Output is correct |
77 |
Correct |
10 ms |
7168 KB |
Output is correct |
78 |
Correct |
10 ms |
7168 KB |
Output is correct |
79 |
Correct |
10 ms |
6912 KB |
Output is correct |
80 |
Correct |
10 ms |
7168 KB |
Output is correct |
81 |
Correct |
9 ms |
7168 KB |
Output is correct |
82 |
Correct |
9 ms |
7168 KB |
Output is correct |
83 |
Correct |
9 ms |
6912 KB |
Output is correct |
84 |
Correct |
11 ms |
7168 KB |
Output is correct |
85 |
Correct |
13 ms |
7168 KB |
Output is correct |
86 |
Correct |
10 ms |
7096 KB |
Output is correct |
87 |
Correct |
9 ms |
7168 KB |
Output is correct |
88 |
Correct |
8 ms |
6968 KB |
Output is correct |
89 |
Correct |
9 ms |
7424 KB |
Output is correct |
90 |
Correct |
10 ms |
7424 KB |
Output is correct |
91 |
Correct |
11 ms |
7424 KB |
Output is correct |
92 |
Correct |
12 ms |
7424 KB |
Output is correct |
93 |
Correct |
11 ms |
7168 KB |
Output is correct |
94 |
Correct |
12 ms |
7168 KB |
Output is correct |
95 |
Correct |
10 ms |
7424 KB |
Output is correct |
96 |
Correct |
12 ms |
7168 KB |
Output is correct |
97 |
Correct |
10 ms |
7168 KB |
Output is correct |
98 |
Correct |
10 ms |
7168 KB |
Output is correct |
99 |
Correct |
11 ms |
7424 KB |
Output is correct |
100 |
Correct |
10 ms |
7424 KB |
Output is correct |
101 |
Correct |
10 ms |
7168 KB |
Output is correct |
102 |
Correct |
10 ms |
7424 KB |
Output is correct |
103 |
Correct |
10 ms |
7168 KB |
Output is correct |
104 |
Correct |
11 ms |
7168 KB |
Output is correct |
105 |
Correct |
11 ms |
7168 KB |
Output is correct |
106 |
Correct |
11 ms |
7168 KB |
Output is correct |
107 |
Correct |
12 ms |
7168 KB |
Output is correct |
108 |
Correct |
9 ms |
7168 KB |
Output is correct |
109 |
Correct |
10 ms |
7168 KB |
Output is correct |
110 |
Correct |
10 ms |
6912 KB |
Output is correct |
111 |
Correct |
10 ms |
7168 KB |
Output is correct |
112 |
Correct |
9 ms |
7168 KB |
Output is correct |
113 |
Correct |
9 ms |
7168 KB |
Output is correct |
114 |
Correct |
9 ms |
7168 KB |
Output is correct |
115 |
Correct |
8 ms |
7168 KB |
Output is correct |
116 |
Correct |
9 ms |
7168 KB |
Output is correct |
117 |
Correct |
12 ms |
7424 KB |
Output is correct |
118 |
Correct |
10 ms |
6912 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
611 ms |
127332 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |