제출 #945746

#제출 시각아이디문제언어결과실행 시간메모리
945746itslqRoad Construction (JOI21_road_construction)C++17
0 / 100
2025 ms2097152 KiB
#include <bits/stdc++.h> using namespace std; int 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...