# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
744761 |
2023-05-19T05:01:22 Z |
Teemka |
Game (APIO22_game) |
C++17 |
|
3 ms |
4944 KB |
#include "bits/stdc++.h"
#include "game.h"
#define F first
#define S second
#define OK cout << "------OK---------" << endl;
#define deb(x) cout << #x << " = " << x << endl;
#define ll long long ;
using namespace std ;
const int N = 2e5 + 7;
const int INF = 1e9 + 7 ;
const int dx[4] = {0 , 1 , 0 , -1} , dy[4] = {1 , 0 , -1 , 0} ;
int n , k , used[N] , tim = 0 , ok = 0;
vector<int > g[N] ;
void dfs(int v){
used[v] = tim ;
for(int to : g[v]){
if(used[to] == tim){
if(to <= k - 1)
ok = 1;
continue ;
}
dfs(to) ;
}
}
void init(int _n, int _k) {
n = _n , k = _k ;
for(int i = 0; i< k - 1; i++){
g[i].push_back(i + 1) ;
}
}
int add_teleporter(int u, int v) {
g[u].push_back(v) ;
tim++ ;
dfs(1) ;
return 1 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4944 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4944 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4944 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4944 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4944 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4944 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4944 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4944 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4944 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4944 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |