# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
799724 | MilosMilutinovic | Collapse (JOI18_collapse) | C++14 | 15073 ms | 19268 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 "collapse.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> simulateCollapse(int n, vector<int> t, vector<int> x, vector<int> y, vector<int> w, vector<int> p) {
int m = (int) t.size();
int q = (int) w.size();
for (int i = 0; i < m; i++) {
if (x[i] > y[i]) {
swap(x[i], y[i]);
}
}
vector<int> to(m);
map<pair<int, int>, int> mp;
for (int i = 0; i < m; i++) {
if (t[i] == 0) {
to[i] = m - 1;
mp[make_pair(x[i], y[i])] = i;
} else {
to[mp[make_pair(x[i], y[i])]] = i - 1;
}
}
vector<vector<int>> qs(m);
for (int i = 0; i < q; i++) {
qs[w[i]].push_back(i);
}
vector<int> par(n);
vector<int> sz(n, 1);
vector<tuple<int, int, int>> stk;
# | 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... |