Submission #793095

#TimeUsernameProblemLanguageResultExecution timeMemory
793095TimDeeGame (IOI14_game)C++17
100 / 100
232 ms6948 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; #define forn(i,n) for(int i=0;i<n;++i) #define pb push_back const int N=1500; int ord[N]; int vis[N]; int cnt[N]; int z=0; int n; void initialize(int _n) { n=_n; } int hasEdge(int u, int v) { if (!vis[u]) { vis[u]=1; ord[u]=z++; cnt[u]=ord[u]; } swap(u,v); if (!vis[u]) { vis[u]=1; ord[u]=z++; cnt[u]=ord[u]; } if (ord[u]>ord[v]) swap(u,v); if (cnt[v]>1) { --cnt[v]; return 0; } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...