Submission #836216

#TimeUsernameProblemLanguageResultExecution timeMemory
836216unnickCity Mapping (NOI18_citymapping)C++14
0 / 100
2 ms512 KiB
#include "citymapping.h" #include <algorithm> #include <numeric> #include <vector> using namespace std; #define ll long long void find_roads(int N, int Q, int A[], int B[], int W[]) { // vector<ll> dists(N*N); vector<ll> dists(N); dists[0] = 0; vector<int> ids(N); iota(ids.begin(), ids.end(), 0); for (int i = 2; i <= N; i++) { dists[i-1] = get_distance(1,i); } sort(ids.begin(), ids.end(), [&](int a, int b) { return dists[a] < dists[b]; }); for (int i = 0; i < N-1; i++) { A[i] = ids[i]+1; B[i] = ids[i+1]+1; W[i] = dists[ids[i+1]] - dists[ids[i]]; } }
#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...