제출 #701395

#제출 시각아이디문제언어결과실행 시간메모리
701395mychecksedad게임 (IOI14_game)C++17
0 / 100
0 ms244 KiB
#include <bits/stdc++.h> #include <game.h> using namespace std; int r, n; vector<int> a; vector<bool> c; void initialize(int nn){ r = 0; n = nn; a.resize(n, n - 1); c.resize(n, 0); } int hasEdge(int u, int v){ a[u]--, a[v]--; if(r == 0){ if(a[u] == 1 || a[v] == 1){ if(!c[u]) r++; if(!c[v]) r++; c[u] = c[v] = 1; return 1; } }else if(r < n - 1){ if(a[u] == 2 || a[v] == 2){ if(!c[u]) r++; if(!c[v]) r++; c[u] = c[v] = 1; return 1; } }else{ if(a[u] == 1 || a[v] == 1){ if(!c[u]) r++; if(!c[v]) r++; c[u] = c[v] = 1; return 1; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...