QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#786938 | #4251. Game | isirazeev | 0 | 1ms | 3888kb | C++23 | 643b | 2024-11-27 02:11:30 | 2024-11-27 02:11:31 |
answer
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> g[1010];
bool used[1010];
int start;
bool dfs(int v) {
if (v <= start && used[v]) return true;
if (used[v]) return false;
used[v] = true;
for (auto u: g[v]) {
if (dfs(u)) return true;
}
return false;
}
void init(int this_n, int this_k) {
n = this_n, k = this_k;
}
int add_teleporter(int u, int v) {
if (u == v && u < k) return 1;
fill(used, used + 1010, false);
g[u].emplace_back(v);
for (int i = 0; i < k; i++) {
start = i;
if (dfs(i))
return 1;
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 2
Accepted
time: 1ms
memory: 3888kb
input:
1 1 1 893123 893123 -1
output:
0
result:
ok interaction finished.
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3888kb
input:
9 9 29 893122 893124 893121 893127 893120 893124 893123 893121 893122 893131 893125 893131 893121 893126 893123 893126 893126 893131 893123 893131 893123 893125 893123 893124 893127 893125 893120 893126 893123 893120 893121 893131 893123 893127 893122 893126 893122 893127 893127 893131 893122 893125...
output:
0
result:
wrong answer Wrong Answer [1]
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%