Submission #315485

#TimeUsernameProblemLanguageResultExecution timeMemory
315485qpwoeirutGame (IOI14_game)C++17
0 / 100
1 ms384 KiB
#include "game.h" const int MN = 1501; int N; int mat[MN][MN]; int ct[MN]; void initialize(int n) { N = n; for (int i=0; i<N; ++i) { for (int j=0; j<N; ++j) { mat[i][j] = -1; } ct[i] = 0; mat[i][i] = 1; } } int hasEdge(int u, int v) { if (mat[u][v] != -1) return mat[u][v]; ++ct[u]; ++ct[v]; mat[u][v] = ct[u] == N-1 || ct[v] == N-1; return mat[u][v]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...