제출 #1040986

#제출 시각아이디문제언어결과실행 시간메모리
1040986vanea게임 (IOI14_game)C++14
15 / 100
1 ms604 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; using ll = long long; const int mxN = 2e3+10; int n; set<int> adj[mxN]; int hasEdge(int a, int b) { adj[a].erase(b); adj[b].erase(a); if(adj[a].size() == 0 || adj[b].size() == 0) return 1; if(adj[a].size() == 1) { int k = *(adj[a].begin()); if(adj[k].size() == 1) return 1; } if(adj[b].size() == 1) { int k = *(adj[b].begin()); if(adj[k].size() == 1) return 1; } return 0; } void initialize(int N) { n = N; for(int i = 0; i < n; i++) { for(int j = i+1; j < n; j++) { adj[i].insert(j); adj[j].insert(i); } } } /* int main() { initialize(4); cout<<hasEdge(0,1)<<hasEdge(3,0)<<hasEdge(1,2)<<hasEdge(0,2); cout<<hasEdge(1,3)<<hasEdge(2,3); return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...