#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define fr front()
using namespace std;
int main () {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n,k;
cin>>n>>k;
ll a[n],b[n];
multiset<ll> s;
for(int i=0;i<n;i++){
cin>>a[i]>>b[i];
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
s.insert(abs(a[i]-a[j])+abs(b[i]-b[j]));
}
}
multiset<ll> :: iterator it=s.begin();
for(int i=0;i<k;i++){
cout<<*it<<' ';
it++;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
368 ms |
26292 KB |
Output is correct |
2 |
Correct |
355 ms |
26244 KB |
Output is correct |
3 |
Correct |
143 ms |
14696 KB |
Output is correct |
4 |
Correct |
146 ms |
14728 KB |
Output is correct |
5 |
Correct |
278 ms |
25240 KB |
Output is correct |
6 |
Correct |
152 ms |
23688 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10085 ms |
401164 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10062 ms |
399992 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10062 ms |
399992 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
368 ms |
26292 KB |
Output is correct |
2 |
Correct |
355 ms |
26244 KB |
Output is correct |
3 |
Correct |
143 ms |
14696 KB |
Output is correct |
4 |
Correct |
146 ms |
14728 KB |
Output is correct |
5 |
Correct |
278 ms |
25240 KB |
Output is correct |
6 |
Correct |
152 ms |
23688 KB |
Output is correct |
7 |
Execution timed out |
10096 ms |
401544 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
368 ms |
26292 KB |
Output is correct |
2 |
Correct |
355 ms |
26244 KB |
Output is correct |
3 |
Correct |
143 ms |
14696 KB |
Output is correct |
4 |
Correct |
146 ms |
14728 KB |
Output is correct |
5 |
Correct |
278 ms |
25240 KB |
Output is correct |
6 |
Correct |
152 ms |
23688 KB |
Output is correct |
7 |
Execution timed out |
10085 ms |
401164 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |