Submission #733680

#TimeUsernameProblemLanguageResultExecution timeMemory
733680Erkinoff_MohammedGame (APIO22_game)C++17
0 / 100
0 ms208 KiB
#include "game.h" #include "bits/stdc++.h" using namespace std; #define INF 2000000000 #define INFLL 3000000000000000000LL #define ll long long int spec; int num; vector<vector<int>>adj; vector<bool>vis; void dfs(int i){ if(!vis[i]){ vis[i]=1; num--; } for(int u:adj[i]){ if(!vis[u]){ dfs(u); } } } void init(int n, int k) { adj.resize(n); vis.assign(n, 0); spec=k; num=n-k; for(int i=0;i<k;i++)vis[i]=1; } int add_teleporter(int u, int v) { adj[u].push_back(v); if(vis[u])dfs(u); return num==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...