QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#121920 | #1148. Game | Qwerty1232# | 0 | 763ms | 3868kb | C++17 | 886b | 2023-07-09 00:37:08 | 2024-07-04 00:32:44 |
Judging History
answer
#include "game.h"
#include <bits/stdc++.h>
constexpr int N = 1501;
// std::vector<std::vector<int>> gr;
std::array<std::bitset<N>, N> gr;
int n;
void initialize(int n) {
while (clock() * 1.0 / CLOCKS_PER_SEC < 2.0) {
;
}
exit(0);
::n = n;
for (int i = 0; i < n; i++) {
gr[i].reset();
gr[i] = ~gr[i];
gr[i][i] = 0;
}
}
int hasEdge(int u, int v) {
gr[u][v] = gr[v][u] = 0;
std::bitset<N> used;
used.reset();
used = ~used;
auto dfs = [&](auto dfs, int v) -> void {
int t = (used & gr[v])._Find_first();
used[v] = 0;
while (t < n) {
dfs(dfs, t);
t = (used & gr[v])._Find_next(t);
}
};
dfs(dfs, 0);
if (used._Find_first() == n) {
return 0;
}
gr[u][v] = gr[v][u] = 1;
return 1;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 615ms
memory: 3868kb
input:
4 0 1 3 0 1 2 0 2 3 1 2 3
output:
Unauthorized output
result:
wrong output format Expected integer, but "Unauthorized" found
Subtask #2:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 667ms
memory: 3776kb
input:
4 0 1 3 0 1 2 0 2 3 1 2 3
output:
Unauthorized output
result:
wrong output format Expected integer, but "Unauthorized" found
Subtask #3:
score: 0
Wrong Answer
Test #79:
score: 0
Wrong Answer
time: 763ms
memory: 3632kb
input:
4 0 1 3 0 1 2 0 2 3 1 2 3
output:
Unauthorized output
result:
wrong output format Expected integer, but "Unauthorized" found