Submission #291693

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2916932020-09-05 16:31:13nvmdavaSwapping Cities (APIO20_swap)C++17
100 / 100
431 ms31768 KiB
#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int INF = 1000000005;
#define ff first
#define ss second
vector<pair<int, pair<int, int> > > edge;
vector<pair<int, int> > dsu[N];
int ans[N];
int d[N];
vector<int> gr[N];
void init(int N, int M,
std::vector<int> U, std::vector<int> V, std::vector<int> W) {
cerr<<"BEGIN";
for(int i = 0; i < N; ++i)
ans[i] = INF;
for(int i = 0; i < N; ++i){
dsu[i].push_back({0, i});
gr[i].push_back(i);
}
for(int i = 0; i < M; ++i)
edge.push_back({W[i], {V[i], U[i]}});
sort(edge.begin(), edge.end());
for(auto& wtf : edge){
int v = wtf.ss.ff;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...