# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1074650 | Zicrus | Thousands Islands (IOI22_islands) | C++17 | 46 ms | 10580 KiB |
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 "islands.h"
using namespace std;
typedef long long ll;
int n, m;
vector<vector<pair<int, int>>> adj, revAdj; // edgeId, node
vector<bool> vst, edgeUsed;
stack<int> stk;
vector<int> lnk, sz, acc;
vector<int> numPaths;
void dfs1(int cur) {
vst[cur] = true;
for (auto &e : adj[cur]) {
if (vst[e.second]) continue;
dfs1(e.second);
}
stk.push(cur);
}
int dfs2(int cur, int rep) {
vst[cur] = true;
lnk[cur] = rep;
sz[rep]++;
int last = cur;
for (auto &e : revAdj[cur]) {
if (vst[e.second]) continue;
edgeUsed[e.first] = true;
Compilation message (stderr)
# | 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... |