#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;
}
for(long long i=0;i<N;i++){
for(long long j=i+1;j<N;j++){
long long raz=abs(kor[i].first-kor[j].first)+abs(kor[i].second-kor[j].second);
kol.push_back(raz);
}
}
sort(kol.begin(),kol.end());
for(long long i=0;i<K;i++){
cout<<kol[i]<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
286 ms |
7092 KB |
Output is correct |
2 |
Correct |
298 ms |
7096 KB |
Output is correct |
3 |
Correct |
266 ms |
5160 KB |
Output is correct |
4 |
Correct |
269 ms |
5052 KB |
Output is correct |
5 |
Correct |
283 ms |
6092 KB |
Output is correct |
6 |
Correct |
20 ms |
5064 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1561 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1422 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1422 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
286 ms |
7092 KB |
Output is correct |
2 |
Correct |
298 ms |
7096 KB |
Output is correct |
3 |
Correct |
266 ms |
5160 KB |
Output is correct |
4 |
Correct |
269 ms |
5052 KB |
Output is correct |
5 |
Correct |
283 ms |
6092 KB |
Output is correct |
6 |
Correct |
20 ms |
5064 KB |
Output is correct |
7 |
Runtime error |
1338 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
286 ms |
7092 KB |
Output is correct |
2 |
Correct |
298 ms |
7096 KB |
Output is correct |
3 |
Correct |
266 ms |
5160 KB |
Output is correct |
4 |
Correct |
269 ms |
5052 KB |
Output is correct |
5 |
Correct |
283 ms |
6092 KB |
Output is correct |
6 |
Correct |
20 ms |
5064 KB |
Output is correct |
7 |
Runtime error |
1561 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |