Submission #594413

#TimeUsernameProblemLanguageResultExecution timeMemory
594413shrimbGame (IOI14_game)C++17
0 / 100
1 ms212 KiB
#include "game.h" int cnt[1501]; int cnt2[1501]; int adj[1501]; int N; void initialize(int n) { N = n; for (int i = 0 ; i < n ; i++) { cnt[i] = -1; cnt2[i] = -1; adj[i] = n - 1; } } int hasEdge(int u, int v) { bool take = 0; if (adj[u] - (cnt[u] != -1 and cnt2[cnt[u]] == v) <= 2) take = 1; if (adj[v] - (cnt[v] != -1 and cnt2[cnt[v]] == u) <= 2) take = 1; if (take) { if (cnt[u] != -1) cnt2[u] = v; else cnt[u] = v; if (cnt[v] != -1) cnt2[v] = u; else cnt[v] = u; } else { adj[u]--; adj[v]--; } return take; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...