# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299279 | dolphingarlic | Acrobat (balkan16_acrobat) | C++14 | 362 ms | 42960 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>
using namespace std;
int a[300001], b[300001], cmp[600001];
bool cnt[300001], visited[300001];
vector<pair<int, int>> graph[300001];
vector<array<int, 3>> ans;
int find(int A) {
while (A != cmp[A]) A = cmp[A], cmp[A] = cmp[cmp[A]];
return A;
}
void onion(int A, int B) { cmp[find(A)] = find(B); }
bool dfs(int node) {
visited[node] = true;
for (pair<int, int> i : graph[node]) {
if (!visited[i.first] && dfs(i.first)) {
ans.push_back({1, a[i.second], b[i.second]});
swap(a[i.second], b[i.second]);
cnt[node] ^= 1;
}
}
return cnt[node];
}
int main() {
iostream::sync_with_stdio(false);
cin.tie(0);
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... |