Submission #280146

#TimeUsernameProblemLanguageResultExecution timeMemory
280146SamAndGame (IOI14_game)C++17
42 / 100
1095 ms1536 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; #define m_p make_pair #define fi first #define se second #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()) typedef long long ll; const int N = 1503; int n; bool a[N][N]; void initialize(int n) { ::n = n; for (int x = 1; x <= n; ++x) { for (int y = 1; y <= n; ++y) { a[x][y] = true; } } } bool c[N]; bool dfs(int x, int y) { c[x] = true; if (x == y) return true; for (int h = 1; h <= n; ++h) { if (a[x][h]) { if (!c[h]) { if (dfs(h, y)) return true; } } } return false; } int hasEdge(int x, int y) { ++x; ++y; a[x][y] = false; a[y][x] = false; memset(c, false, sizeof c); if (dfs(x, y)) return 0; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...