Submission #87989

#TimeUsernameProblemLanguageResultExecution timeMemory
87989PajarajaGame (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...