Submission #120791

#TimeUsernameProblemLanguageResultExecution timeMemory
120791win11905Game (IOI14_game)C++11
15 / 100
3 ms484 KiB
#include "game.h" #include <set> using namespace std; set<int> S[1505]; bool nott[1505]; void initialize(int n) { for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j) if(i != j) { S[i].emplace(j); } } int hasEdge(int u, int v) { bool st = S[u].size() <= 1 || S[v].size() <= 1; if(S[u].count(v)) S[u].erase(v); if(S[v].count(u)) S[v].erase(u); if(st) nott[u] = nott[v] = true; if(S[u].size() == 1 && nott[u] == false) { int a = *S[u].begin(); if(S[a].count(u)) S[a].erase(u); } if(S[v].size() == 1 && nott[v] == false) { int a = *S[v].begin(); if(S[a].count(v)) S[a].erase(v); } return st; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...