# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1009801 | pcc | Game (APIO22_game) | C++17 | 6 ms | 14424 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
const int mxn = 3e5+10;
bool flag = false;
int cnt[mxn];
void add(int k){
cnt[k]++;
if(cnt[k] >= 2)flag = true;
return;
}
struct GRAPH{
vector<int> paths[mxn];
bitset<mxn> vis;
GRAPH(){}
void DFS(int now){
if(vis[now])return;
vis[now] = true;
add(now);
for(auto nxt:paths[now]){
if(vis[nxt])continue;
DFS(nxt);
}
return;
}
void add_edge(int a,int b){
paths[a].push_back(b);
if(vis[a])DFS(b);
return;
}
};
GRAPH g,rg;
int N,K;
void init(int n, int k) {
g.vis[0] = true;
rg.vis[k-1] = true;
N = n;
K = k;
for(int i = k-2;i>=0;i--){
g.add_edge(i,i+1);
rg.add_edge(i+1,i);
}
flag = false;
cerr<<"INIT DONE!"<<endl;
for(int i = 0;i<N;i++)cerr<<g.vis[i];cerr<<endl;
for(int i = 0;i<N;i++)cerr<<rg.vis[i];cerr<<endl;
return;
}
int add_teleporter(int u, int v) {
if(0<=u&&u<K&&0<=v&&v<K&&u>v)return 1;
g.add_edge(u,v);
rg.add_edge(v,u);
return flag;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |