Submission #399698

#TimeUsernameProblemLanguageResultExecution timeMemory
399698mshandilyaGame (IOI14_game)C++14
15 / 100
1 ms312 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; int nodes, edges = 0, questions; std::vector<int> to_ask; std::vector<bool> connected; void initialize(int n) { nodes = n; questions = n*(n-1)/2; to_ask.assign(n, n-1); connected.assign(n, false); } int hasEdge(int u, int v) { if(questions<=nodes-edges-1 or (to_ask[u]==1 and !connected[u]) or (to_ask[v]==1 and !connected[v])) { to_ask[u]--; to_ask[v]--; connected[u] = true; connected[v] = true; edges++; questions--; return 1; } else { to_ask[u]--; to_ask[v]--; questions--; return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...