QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#121692 | #1148. Game | valerikk# | 0 | 0ms | 3688kb | C++17 | 703b | 2023-07-08 18:06:36 | 2024-07-04 00:31:49 |
Judging History
answer
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
const int N = 85;
int n;
int p[N];
int e[N][N];
void merge(int v, int u) {
v = p[v];
u = p[u];
for (int i = 0; i < n; ++i) {
if (p[i] == v) {
p[i] = u;
}
}
}
}
void initialize(int n1) {
n = n1;
for (int i = 0; i < n; ++i) {
p[i] = i;
}
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
e[i][j] = 1;
}
}
}
int hasEdge(int u, int v) {
int cnt = 0;
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
if (min(p[v], p[u]) == min(p[i], p[j]) && max(p[v], p[u]) == max(p[i], p[j])) {
++cnt;
}
}
}
if (cnt == 1) {
merge(v, u);
return 1;
}
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3560kb
input:
4 0 1 3 0 1 2 0 2 3 1 2 3
output:
1 0 0 0 0 1
result:
wrong answer not correct
Subtask #2:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 0ms
memory: 3560kb
input:
4 0 1 3 0 1 2 0 2 3 1 2 3
output:
1 0 0 0 0 1
result:
wrong answer not correct
Subtask #3:
score: 0
Wrong Answer
Test #79:
score: 0
Wrong Answer
time: 0ms
memory: 3688kb
input:
4 0 1 3 0 1 2 0 2 3 1 2 3
output:
1 0 0 0 0 1
result:
wrong answer not correct