Submission #1116173

#TimeUsernameProblemLanguageResultExecution timeMemory
1116173vladiliusGame (IOI14_game)C++17
42 / 100
1064 ms2556 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define pb push_back #define ff first #define ss second vector<vector<int>> G; vector<bool> used; int n; void dfs(int v){ used[v] = 1; for (int i: G[v]){ if (!used[i]){ dfs(i); } } } int hasEdge(int u, int v){ auto it = find(G[u].begin(), G[u].end(), v); G[u].erase(it); it = find(G[v].begin(), G[v].end(), u); G[v].erase(it); fill(used.begin(), used.end(), 0); dfs(0); for (int i = 0; i < n; i++){ if (!used[i]){ G[u].pb(v); G[v].pb(u); return 1; } } return 0; } void initialize(int N){ n = N; used.resize(n); G.resize(n); for (int i = 0; i < n; i++){ for (int j = i + 1; j < n; j++){ G[i].pb(j); G[j].pb(i); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...