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 <bits/stdc++.h>
#define maxn 1550
using namespace std;
typedef long long ll;
int block[maxn], n, ligacoes, faltam;
int hasEdge(int u, int v)
{
if(block[u] == n - 2 || block[v] == n - 2 || ligacoes >= faltam)
{
ligacoes --;
faltam --;
return 1;
}
block[u] ++, block[v] ++;
faltam --;
return 0;
}
void initialize(int N_)
{
n = N_;
faltam = n*(n - 1)/2;
ligacoes = n - 1;
memset(block, 0, sizeof block);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |