QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#34668 | #4251. Game | lunchbox# | 0 | 1ms | 4648kb | C++17 | 610b | 2022-06-12 04:28:52 | 2024-05-26 00:51:45 |
Judging History
answer
// #include "game.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 30000;
std::vector<int> ej[N];
int ww[N], tt[N], n;
void init(int n_, int k) {
n = n_;
for (int i = 0; i < k - 1; i++)
ej[i].push_back(i + 1), ww[i + 1]++;
}
int add_teleporter(int u, int v) {
static int qu[N];
int head = 0, cnt = 0;
for (int i = 0; i < n; i++)
if ((tt[i] = ww[i]) == 0)
qu[head + cnt++] = i;
while (cnt) {
int i = qu[head++];
cnt--;
for (int j : ej[i])
if (--tt[j] == 0)
qu[head + cnt++] = j;
}
return head != n;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 4648kb
input:
1 1 1 893123 893123 -1
output:
1
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%