Submission #1051116

#TimeUsernameProblemLanguageResultExecution timeMemory
1051116TAhmed33Game (IOI14_game)C++98
0 / 100
1 ms604 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int n; bool good[1502]; set <int> dd[1502]; void initialize (int N) { n = N; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i != j) { dd[i].insert(j); } } good[i] = 0; } } void add_edge (int x, int y) { dd[x].erase(y); dd[y].erase(x); } int hasEdge (int u, int v) { if (good[u] && good[v]) { return 0; } if (dd[u].size() == 1) { add_edge(u, v); good[u] = 1; return 1; } if (dd[v].size() == 1) { add_edge(u, v); good[v] = 1; return 1; } add_edge(u, v); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...