Submission #983527

#TimeUsernameProblemLanguageResultExecution timeMemory
983527Jawad_Akbar_JJGame (APIO22_game)C++17
60 / 100
435 ms4068 KiB
#include <iostream> #include <vector> using namespace std; const int N = 3e4 + 5; vector<int> nei[N]; int n,k; int Mnr[N]; bool ans = false; void dfs(int u,int p = -1){ for (int i : nei[u]){ int Mn = Mnr[u]; if (u <= k) Mn = u; if (Mn < Mnr[i]) Mnr[i] = Mn,dfs(i,u); } } int add_teleporter(int u,int v){ u++; v++; nei[v].push_back(u); dfs(v); for (int i=1;i<=k;i++) if (Mnr[i] <= i) return 1; return 0; } void init(int NN,int KK){ n = NN,k = KK; for (int i=1;i<=k;i++) Mnr[i] = i+1; for (int i=k+1;i<=n;i++) Mnr[i] = 1e9; }
#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...