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;
#define ll long long
#define pb push_back
const int INF=100000000;
int memoria[2000][2000];
vector<int> posiblesarist;
void initialize(int n) {
for(int i=0;i<n;i++){
posiblesarist.pb(n-1);
}
}
int hasEdge(int u, int v) {
if(memoria[u][v]==1){
return 1;
}
//cout<<posiblesarist[u]<<" POSIBLEARISTA U"<<endl;
//cout<<posiblesarist[v]<<" POSIBLEARISTA V"<<endl;
if(posiblesarist[u]>1 && posiblesarist[v]>1){
posiblesarist[u]--;
posiblesarist[v]--;
return 0;
}else{
memoria[u][v]=1;
memoria[v][u]=1;
posiblesarist[u]--;
posiblesarist[v]--;
//posiblesarist[u]=INF;
//posiblesarist[v]=INF;
return 1;
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |