제출 #1036987

#제출 시각아이디문제언어결과실행 시간메모리
1036987vanea게임 (IOI14_game)C++14
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; using ll = long long; const int mxN = 2e3+10; int cnt[mxN]; int n, past = 0; int hasEdge(int u, int v) { ++cnt[u]; ++cnt[v]; if(cnt[u] == n-1 || cnt[v] == n-1) {--past; return 1;} if((cnt[u] == n-2 || cnt[v] == n-2) && past) { if(cnt[u] == n-2) cnt[u] = n; else cnt[v] = n; return 1; } if(cnt[u] == n-2)++past; if(cnt[v] == n-2)++past; return 0; } void initialize(int N) { n = N; } /* int main() { initialize(4); cout << hasEdge(0, 3) << hasEdge(1, 0) << hasEdge(0, 2) << hasEdge(3, 1); cout << hasEdge(1, 2) << hasEdge(2, 3); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...