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;
vector< int > degrees;
void initialize(int n) {
degrees.resize(n,n-1);
}
int hasEdge(int u, int v) {
if(degrees[u] == 1 || degrees[v] == 1){
degrees[u]--;
degrees[v]--;
return 1;
}else{
degrees[u]--;
degrees[v]--;
return 0;
}
}
/*
signed main(){
int n;
cin >> n;
initialize(n);
for(int i = 0; i < n; i++){
for(int j = i+1; j < n; j++){
cout << i << ' ' << j << ' ' << hasEdge(i,j) << endl;
}
}
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |