Submission #46537

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
465372018-04-21 10:56:58RayaBurong25_1Game (IOI14_game)C++17
100 / 100
618 ms160324 KiB
#include "game.h"
#include <stdio.h>
int Cut[1505][1505];
int P[1505], Sz[1505];
int N;
int UF(int u)
{
return (P[u] == -1)?u:(P[u] = UF(P[u]));
}
void initialize(int n)
{
N = n;
int i;
for (i = 0; i < n; i++)
{
P[i] = -1;
Sz[i] = 1;
}
}
int hasEdge(int u, int v)
{
int pu = UF(u);
int pv = UF(v);
int i;
// printf("Cut %d Sz %d %d\n", Cut[pu][pv], Sz[pu], Sz[pv]);
if (Cut[pu][pv] + 1 == Sz[pu]*Sz[pv])
{
P[pu] = pv;
for (i = 0; i < N; i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...