제출 #949095

#제출 시각아이디문제언어결과실행 시간메모리
949095temmieowoRoad Construction (JOI21_road_construction)C++14
5 / 100
3442 ms2097152 KiB
#include <bits/stdc++.h> #define int long long #define fastio ios::sync_with_stdio(0), cin.tie(0); using namespace std; const int MAX_N = 5e5+10; const int INF = 2e18; int n, m; int a, b; vector<pair<int, int>> v; vector<int> p; void solve1(){ // input cin >> n >> m; for (int i=0 ; i<n ; i++){ cin >> a >> b; v.push_back({a, b}); } // process for (int i=0 ; i<n ; i++){ for (int j=i+1 ; j<n ; j++){ p.push_back(abs(v[i].first-v[j].first)+abs(v[i].second-v[j].second)); } } sort(p.begin(), p.end()); // output for (int i=0 ; i<m ; i++){ cout << p[i] << "\n"; } return; } signed main(){ fastio; int t = 1; while (t--){ solve1(); } return 0; }
#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...