# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
983920 |
2024-05-16T08:00:45 Z |
vjudge1 |
Game (APIO22_game) |
C++17 |
|
3 ms |
2900 KB |
#include "game.h"
#include<bits/stdc++.h>
#define ll int
using namespace std;
const ll N = 100100;
vector<ll> v[N], us, ex;
ll n, k, ok;
void dfs(ll s)
{
if(ok) return;
++us[s];
for(ll t : v[s])
{
if(us[t] == 200)
{
ok |= (t <= k);
return;
}
dfs(t);
}
}
void init(ll NN, ll KK)
{
n = NN;
k = KK;
ex.resize(n + 1);
for(ll i = 1; i < k; ++i)
v[i].push_back(i + 1);
}
ll add_teleporter(ll x, ll y)
{
if(ok) return ok;
++x, ++y;
if(x <= k && y <= k && x >= y)
{
ok = 1;
return ok;
}
v[x].push_back(y);
for(ll 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();
//}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2900 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2784 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2900 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2784 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2900 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2784 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2900 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2784 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2900 KB |
Output is correct |
3 |
Incorrect |
3 ms |
2784 KB |
Wrong Answer[1] |
4 |
Halted |
0 ms |
0 KB |
- |