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>
#include "game.h"
using namespace std;
int cnt[1503];
bool done[1506];
int N;
void initialize(int n){
for(int i= 0;i<=n+1;i++){
cnt[i] =0;
done[i] = 0;
}
N = n;
}
int hasEdge(int u, int v){
if((cnt[u] == N-2 && done[u] == 0) || (cnt[v] == N-2 && done[v] == 0)){
cnt[u]++;
cnt[v]++;
done[u] = 1;
done[v] = 1;
return 1;
}
cnt[u]++;
cnt[v]++;
return 0;
}
// signed main() {
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
// #ifdef LOCAL
// freopen("input.txt", "r", stdin);
// #endif
// initialize(4);
// for(int i= 0;i<4;i++){
// for(int j= i+1;j<4;j++){
// cout<<i<<' '<<j<<' '<<hasEdge(i, j)<<endl;
// }
// }
// 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... |