이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int n;
int ok[maxn][maxn];
int chex(int u) {
int a[1] = {u}, b[maxn];
int sz_a = 1, sz_b = 0;
for(int i = 1; i <= n; i++) {
if(i == u) continue;
if(ok[u][i] == 0) {
b[sz_b++] = i;
}
}
if(sz_b == 0) return 0;
return query(sz_a, sz_b, a, b);
}
int find_another(int u) {
int a[1] = {u}, b[1];
for(int i = 1; i <= n; i++) {
if(i == u) continue;
if(!ok[u][i]) {
b[0] = i;
if(query(1, 1, a, b)) {
return i;
}
}
} assert(false);
}
void run(int N) {
n = N;
while(true) {
int u = -1;
for(int i = 1; i <= n; i++) {
if(chex(i)) {
u = i;
break;
}
}
int v = find_another(u);
setRoad(u, v);
ok[u][v] = 1;
ok[v][u] = 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |