# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
992296 | Kalata_56 | Road Construction (JOI21_road_construction) | C++14 | 363 ms | 38600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
pair<long long,long long> kor[250001];
vector<long long> kol;
int main(){
long long N,K;
cin>>N>>K;
for(long long i=0;i<N;i++){
cin>>kor[i].first>>kor[i].second;
}
sort(kor,kor+N);
for(int k=1;k<N;k++){
for(long long i=k;i<N;i++){
long long raz=abs(kor[i].first-kor[i-k].first)+abs(kor[i].second-kor[i-k].second);
kol.push_back(raz);
}
if(kol.size()>=K && k>=10){
break;
}
}
for(long long i=0;i<K;i++){
cout<<kol[i]<<endl;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |