제출 #529856

#제출 시각아이디문제언어결과실행 시간메모리
529856aris12345678게임 (IOI14_game)C++14
15 / 100
1 ms332 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int mxN = 1505; int cc[mxN]; bool vis[mxN][mxN]; int N, edges; void initialize(int n) { N = n; edges = 1; for(int i = 0; i < N; i++) { cc[i] = 0; vis[i][i] = true; if(i == 0) continue; edges *= i; } } int hasEdge(int u, int v) { cc[u]++, cc[v]++; if(cc[u] == N-1 || cc[v] == N-1 || edges == N-1) { if(!vis[u][v]) { vis[u][v] = vis[v][u] = true; return true; } } edges--; return false; } // int main() { // int n; // scanf("%d", &n); // initialize(n); // int r = n*(n-1)/2; // while(r--) { // int u, v; // scanf("%d %d", &u, &v); // bool ok = hasEdge(u, v); // if(ok) // printf("yes\n"); // else // printf("no\n"); // } // return 0; // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...