# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172195 | gyg | Keys (IOI21_keys) | C++20 | 3096 ms | 31812 KiB |
#include "keys.h"
#include <bits/stdc++.h>
using namespace std;
#define vec vector
#define arr array
#define pii pair<int, int>
#define fir first
#define sec second
const int N = 3e5 + 5;
// Zero indexing
int n;
arr<int, N> cl;
arr<vec<pii>, N> adj;
arr<bool, N> ngh_vs;
void ngh_dfs(int u, int src) {
ngh_vs[u] = true;
for (pii x : adj[u]) {
if (x.sec != cl[src]) continue;
if (ngh_vs[x.fir]) continue;
ngh_dfs(x.fir, src);
}
}
arr<vec<int>, N> ngh;
void ngh_cmp() {
for (int u = 0; u < n; u++) {
ngh_vs.fill(false);
ngh_dfs(u, u);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |