Submission #702405

#TimeUsernameProblemLanguageResultExecution timeMemory
702405safaricolaGame (APIO22_game)C++17
30 / 100
101 ms604 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; int N,K; bool vis[1010],top[1010]; vector<int> adj[1010]; void init(int n, int k) { N=n;K=k; for(int i=0; i<k-1; i++){ adj[i].push_back(i+1); } } bool ord(int a){ if(vis[a] && top[a]==0 && a<K){ //cout<<'>'<<a<<endl; return true; } if(vis[a])return false; vis[a] = true; for (int it: adj[a]){ if(ord(it)){ //cout<<'>'<<a<<endl; return true; } } top[a]=1; return false; } int add_teleporter(int u, int v) { for(int i=0; i<N; i++)vis[i]=0,top[i]=0; adj[u].push_back(v); for(int i=0; i<N; i++)if(!vis[i])if(ord(i))return 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...