# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
942113 |
2024-03-10T09:20:28 Z |
sysia |
Game (APIO22_game) |
C++17 |
|
2 ms |
7256 KB |
//Sylwia Sapkowska
#include "game.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
void __print(int x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << "'" << x << "'";}
void __print(const char *x) {cerr << '"' << x << '"';}
void __print(const string &x) {cerr << '"' << x << '"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef LOCAL
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
typedef pair<int, int> T;
const int oo2 = 1e9+7, K = 30;
const int mod = 998244353;
const int mx = 3e5+7;
int n, k;
vector<int>g[mx];
vector<bool>vis;
void init(int _n, int _k) {
n = _n, k = _k;
for (int i = 0; i<=k-2; i++){
g[i].emplace_back(i+1);
}
}
bool dfs(int v){
vis[v] = 1;
bool ans = 0;
for (auto x: g[v]){
if (vis[x]){
if (x < k) {
return true;
} else {
return false;
}
} else {
ans |= dfs(x);
}
if (ans) break;
}
return ans;
}
int add_teleporter(int u, int v) {
g[u].emplace_back(v);
vis.assign(n, 0);
auto curr = dfs(0);
return (int)curr;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
7256 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
7256 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
7256 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
7256 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
7256 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |