QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#40076 | #4251. Game | ZeinDaner# | 0 | 1ms | 3908kb | C++17 | 550b | 2022-07-16 04:44:26 | 2024-05-26 01:01:44 |
Judging History
answer
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
const int MAX_N=3e5+10;
bool vis[MAX_N];
vector<vi> G;
int K,N;
void init(int n, int k) {
K=k;
N=n;
G.resize(n+1);
for(int i=0;i<k-1;i++){
G[i].push_back(i+1);
}
}
bool dfs(int u){
vis[u]=1;
bool ans=0;
for(auto &v:G[u]){
if(vis[v] && v<K) return 1;
if(!vis[v]) ans|=dfs(v);
}
return ans;
}
int add_teleporter(int u, int v) {
G[u].push_back(v);
for(int i=0;i<=N;i++) vis[i]=0;
return dfs(0);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 2
Accepted
time: 0ms
memory: 3908kb
input:
1 1 1 893123 893123 -1
output:
0
result:
ok interaction finished.
Test #2:
score: -2
Wrong Answer
time: 1ms
memory: 3776kb
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%