# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1155989 | an22inkle | Game (IOI14_game) | C++17 | 0 ms | 324 KiB |
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
using paira = array<int, 2>;
using ll = long long;
/*
We need to know-
Each vertices' components - To do this in O(1), we need to implement DSU
The count of "no" edges between components
When will we be merging? Exactly when there are |c_u| * |c_j| - 1 "no" edges between two components
*/
int N = 2;
vector<vector<int>> edges(N, vector<int>(N)); // # of NO edges between components
// dsu stuff
vector<int> parent(N);
vector<int> asize(N, 0);
void new_compo(int x) {
parent[x] = x;
asize[x] = 1;
}
int get_compo(int x) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |