제출 #136858

#제출 시각아이디문제언어결과실행 시간메모리
136858reda게임 (IOI14_game)C++14
15 / 100
3 ms380 KiB
#include<bits/stdc++.h> #include "game.h" #define MAXN 1501 using namespace std; set<int> g[MAXN]; void initialize(int n) { for(int i = 0; i < n; i++) for(int j = 0; j < n;j++) { if(i == j)continue; g[i].insert(j); } } int hasEdge(int u, int v) { bool ans =(g[u].size()==1||g[v].size()==1); if(g[u].count(v)) g[u].erase(v); if(g[v].count(u)) g[v].erase(u); if(g[u].size() == 1) { int it =*g[u].begin(); if(g[it].count(u)) g[it].erase(u); } if(g[v].size() == 1) { int it = *g[v].begin(); if(g[it].count(v)) g[it].erase(v); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...