QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#40074 | #4251. Game | ZeinDaner# | 0 | 0ms | 3848kb | C++14 | 508b | 2022-07-16 04:41:22 | 2024-05-26 01:01:43 |
Judging History
answer
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
bool vis[1010];
vector<vi> G;
int K;
void init(int n, int k) {
K=k;
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);
memset(vis,0,sizeof vis);
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: 3848kb
input:
1 1 1 893123 893123 -1
output:
0
result:
ok interaction finished.
Test #2:
score: -2
Wrong Answer
time: 0ms
memory: 3824kb
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%