제출 #87989

#제출 시각아이디문제언어결과실행 시간메모리
87989Pajaraja게임 (IOI14_game)C++17
100 / 100
790 ms160704 KiB
#include "game.h" #include <bits/stdc++.h> int km[1520]; int rel[1520][1520]; int gln; void initialize(int n) { gln=n; for(int i=0;i<n;i++) km[i]=i; for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(i!=j) rel[i][j]=1; } int hasEdge(int u, int v) { if(rel[km[u]][km[v]]>1) { rel[km[u]][km[v]]--; rel[km[v]][km[u]]--; return 0; } int x=km[u]; for(int i=0;i<gln;i++) if(km[i]==x) km[i]=km[v]; for(int i=0;i<1500;i++) rel[i][km[v]]=rel[km[v]][i]=rel[km[v]][i]+rel[x][i]; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...