Submission #52893

#TimeUsernameProblemLanguageResultExecution timeMemory
52893szawinisGame (IOI14_game)C++17
100 / 100
508 ms152016 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; const int N = 1501; vector<pair<int,int> > edges; bitset<N> mark, adj[N]; int cnt_mark; void initialize(int n) { } int hasEdge(int u, int v) { if(!cnt_mark) { mark[u] = mark[v] = 1; cnt_mark = 2; adj[u][v] = adj[v][u] = true; return 1; } if(!mark[u] && !mark[v]) { adj[u][v] = adj[v][u] = true; return 0; } if(mark[u]) swap(u, v); int cnt = (adj[u] & mark).count(); adj[u][v] = adj[v][u] = true; if(cnt < cnt_mark - 1) return 0; ++cnt_mark; mark[u] = true; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...