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 <iostream>
using namespace std;
const int MAX_NOEUD = 15e2;
int nbNoeud;
int nbArcRelie[MAX_NOEUD];
bool appartient[MAX_NOEUD];
bool reliePossible[MAX_NOEUD][MAX_NOEUD];
void initialize(int n)
{
nbNoeud = n;
for(int i = 0; i < nbNoeud; i++)
{
for(int j = 0; j < nbNoeud; j++)
{
reliePossible[i][j] = true;
}
reliePossible[i][i] = false;
nbArcRelie[i] = 1;
}
nbArcRelie[0] = 0;
appartient[0] = true;
}
int hasEdge(int u, int v)
{
reliePossible[u][v] = false;
reliePossible[v][u] = false;
if(appartient[u] && appartient[v])
{
return 0;
}
if(appartient[v])
{
swap(u, v);
}
if(appartient[u])
{
nbArcRelie[v]--;
if(nbArcRelie[v] == 0)
{
appartient[v] = true;
for(int i = 0; i < nbNoeud; i++)
{
if(reliePossible[v][i])
{
nbArcRelie[i]++;
}
}
return 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... |