제출 #1016632

#제출 시각아이디문제언어결과실행 시간메모리
1016632simona1230게임 (IOI14_game)C++17
0 / 100
1 ms2396 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int n; int l[1501]; int ways[1501][1501]; void initialize(int N) { n=N; for(int i=0;i<n;i++) l[i]=i; for(int i=0;i<n;i++) for(int j=0;j<n;j++) ways[i][j]=1; } int hasEdge(int u, int v) { if(l[u]!=l[v]&&ways[l[u]][l[v]]==1) { for(int i=0;i<n;i++) if(l[i]==l[v])l[i]=l[u]; for(int i=0;i<n;i++) { ways[l[u]][i]+=ways[l[v]][i]; ways[i][l[u]]=ways[l[u]][i]; } return 1; } ways[l[u]][l[v]]--; ways[l[v]][l[u]]--; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...