This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include<bits/stdc++.h>
using namespace std;
int f[1505][1505], k1, k2, i, m;
void initialize(int n)
{
m = n;
}
int hasEdge(int u, int v)
{
k1 = k2 = m - 1;
for(i = 0; i < m; i++)
{
if(f[u][i] == -1) k1--;
if(f[v][i] == -1) k2--;
}
if(k1 == 1 || k2 == 1)
{
f[u][v] = f[v][u] = 1;
for(i = 0; i < m; i++)
if(f[u][i] == 1) f[v][i] = f[i][v] = 1;
for(i = 0; i < m; i++)
if(f[v][i] == 1) f[u][i] = f[i][u] = 1;
return 1;
}
f[u][v] = f[v][u] = -1;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |