제출 #120788

#제출 시각아이디문제언어결과실행 시간메모리
120788win11905게임 (IOI14_game)C++11
15 / 100
2 ms512 KiB
#include "game.h" #include <set> using namespace std; set<int> S[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(S[u].size() == 1) { int a = *S[u].begin(); if(S[a].count(u)) S[a].erase(u); } if(S[v].size() == 1) { 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...