제출 #762286

#제출 시각아이디문제언어결과실행 시간메모리
762286gun_gan게임 (IOI14_game)C++17
100 / 100
279 ms19296 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; const int MX = 1505; int N; int cnt[MX], a[MX][MX]; void initialize(int _N) { N = _N; for(int i = 0; i < N; i++) cnt[i] = N - i - 1, a[i][i] = 1; } int hasEdge(int u, int v) { if(u > v) swap(u, v); if(a[u][v] > 0) return a[u][v] - 1; if(cnt[u] == 1) a[u][v] = 2; else a[u][v] = 1; cnt[u]--; return a[u][v] - 1; } // int main() { // int N; // cin >> N; // initialize(N); // for(int i = 0; i < N * (N - 1) / 2; i++) { // int u, v; // cin >> u >> v; // cout << hasEdge(u, v) << '\n'; // } // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...