#include "game.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 100100;
vector<int> g[N], us, ex;
int n, k, ok;
void dfs(int s)
{
if(ok) return;
++us[s];
for(int t : g[s])
{
if(us[t] == 200)
{
ok |= (t <= k);
return;
}
dfs(t);
}
}
void init(int NN, int KK)
{
n = NN;
k = KK;
ex.resize(n + 1);
for(int i = 1; i < k; ++i)
g[i].push_back(i + 1);
}
int add_teleporter(int u, int v)
{
if(ok) return ok;
++u, ++v;
if(u <= k && v <= k && u >= v)
{
ok = 1;
return ok;
}
g[u].push_back(v);
for(int i = 1; i <= k; ++i)
{
us = ex;
dfs(i);
}
return ok;
}
//signed main()
//{
// ios_base::sync_with_stdio(0);
// cin.tie(0), cout.tie(0);
// solve();
//}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2648 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2648 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2648 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2648 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2648 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |