# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149492 | お前はもう死んでいる (#200) | Trip to the Galapagos Islands (FXCUP4_island) | C++17 | 3085 ms | 20600 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 "island.h"
#include <vector>
#include <algorithm>
#include <map>
#include <iostream>
const int ms = 100100;
int par[ms], when[ms];
std::vector<int> freq[ms];
std::vector< std::pair<int, int> > times[ms];
int getPar(int x) { return par[x] == x ? x : getPar(par[x]); }
int wtf;
void Init(int K, std::vector<int> F, std::vector<int> S, std::vector<int> E){
int N = F.size(), M = S.size();
for(int i = 0; i < N; i++) {
par[i] = i;
when[i] = 1e9;
freq[F[i]].push_back(i);
times[i].emplace_back(F[i], 0);
}
wtf = M;
for(int i = 0; i < M; i++) {
int u = getPar(S[M-i-1]), v = getPar(E[M-i-1]);
if(u == v) continue;
if(times[u].size() > times[v].size()) {
std::swap(u, v);
}
for(int j = 0; j < times[u].size(); j++) {
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... |