# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
930574 |
2024-02-20T06:56:42 Z |
vjudge1 |
Game (IOI14_game) |
C++17 |
|
1 ms |
2396 KB |
#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 |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2396 KB |
Output is correct |
2 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |