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>
using namespace std;
const int N = 2e6 + 12, MOD = 998244353;
typedef long long ll;
#include "game.h"
int _n;
//int read_int() {
// int x;
// assert(scanf("%d", &x) == 1);
// return x;
//}
void initialize(int n) {
_n = n;
}
int col[N];
int hasEdge(int u, int v) {
if(col[u] == _n - 2){
return 1;
}
if(col[v] == _n - 2){
return 1;
}
col[v]++;
col[u]++;
return 0;
}
int p[N];
int get(int v){
if(p[v] == v) return v;
return p[v] = get(p[v]);
}
void merge(int a,int b){
a = get(a);
b = get(b);
p[a] = b;
}
//int main() {
// int n, u, v;
// n = read_int();
// initialize(n);
// for(int i = 0;i < n;i++){
// p[i] = i;
// }
// for (int i = 0; i < n * (n - 1) / 2; i++) {
// u = read_int();
// v = read_int();
// if (hasEdge(u, v)) {
// puts("1");
// merge(u,v);
// }
// else puts("0");
//
// }
// 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... |