Submission #945758

#TimeUsernameProblemLanguageResultExecution timeMemory
945758itslqRoad Construction (JOI21_road_construction)C++17
5 / 100
1304 ms2097152 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int N, K; cin >> N >> K; vector<int> dist; vector<pair<int, int>> pos(N); for (int i = 0; i < N; i++) cin >> pos[i].first >> pos[i].second; for (int i = 1; i < N; i++) { for (int j = 0; j < i; j++) { dist.push_back(abs(pos[i].first - pos[j].first) + abs(pos[i].second - pos[j].second)); } } sort(dist.begin(), dist.end()); for (int i = 0; i < K; i++) cout << dist[i] << '\n'; }
#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...