# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
638476 |
2022-09-06T08:50:15 Z |
Nelt |
Game (APIO22_game) |
C++17 |
|
4000 ms |
276 KB |
#include "game.h"
#include <bits/stdc++.h>
#define S second
#define F first
#define ll long long
#define ull unsigned long long
#define ld long double
#define npos ULLONG_MAX
#define INF LLONG_MAX
#define elif else if
#define vv(a) vector<a>
#define pp(a, b) pair<a, b>
#define pq(a) priority_queue<a>
#define qq(a) queue<a>
#define ss(a) set<a>
#define mm(a, b) map<a, b>
#define ump(a, b) unordered_map<a, b>
#define pb push_back
#define sync \
ios_base::sync_with_stdio(0); \
cin.tie(); \
cout.tie();
#define endl "\n"
#define allc(a) begin(a), end(a)
#define all(a) a, a + sizeof(a) / sizeof(a[0])
#define mpr make_pair
#define ins insert
using namespace std;
using namespace __cxx11;
typedef char chr;
typedef basic_string<chr> str;
ll n, k;
const ll sz = 1005;
vv(ll) g[sz];
ll used[sz];
bool dfs(ll v, ll par = 0)
{
if (used[v] == 1)
return 1;
used[v] = 1;
for (ll to : g[v])
{
if (dfs(to, v) and to != par)
return 1;
}
used[v] = 2;
return 0;
}
void init(int n1, int k1)
{
n = n1;
k = k1;
for (ll i = 1; i < k; i++)
g[i].pb(i + 1);
}
int add_teleporter(int u, int v)
{
u++, v++;
g[u].pb(v);
for (ll i = 1; i <= n; i++)
used[i] = 0;
return dfs(1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
276 KB |
Output is correct |
3 |
Execution timed out |
4078 ms |
208 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
276 KB |
Output is correct |
3 |
Execution timed out |
4078 ms |
208 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
276 KB |
Output is correct |
3 |
Execution timed out |
4078 ms |
208 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
276 KB |
Output is correct |
3 |
Execution timed out |
4078 ms |
208 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
276 KB |
Output is correct |
3 |
Execution timed out |
4078 ms |
208 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |