Submission #775548

#TimeUsernameProblemLanguageResultExecution timeMemory
775548teokakabadzeGame (IOI14_game)C++17
0 / 100
1 ms212 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; int f[1505][1505], k1, k2, i, m; void initialize(int n) { m = n; } int hasEdge(int u, int v) { k1 = k2 = m - 1; for(i = 0; i < m; i++) { if(f[u][i] == -1) k1--; if(f[v][i] == -1) k2--; } if(k1 == 1 || k2 == 1) { f[u][v] = f[v][u] = 1; for(i = 0; i < m; i++) if(f[u][i] == 1) f[v][i] = f[i][v] = 1; for(i = 0; i < m; i++) if(f[v][i] == 1) f[u][i] = f[i][u] = 1; return 1; } f[u][v] = f[v][u] = -1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...