#include<bits/stdc++.h>
using namespace std;
long long n,k,i,l,i2;
pair<long long,long long> xy[1000009],p1,p2;
bool ok;
vector<long long> ans;
int main()
{
cin>>n>>k;
for(i=1;i<=n;i++)
{
cin>>p1.first>>p1.second;
xy[i]=p1;
if(p1.second!=0)
{
ok=true;
}
}
for(i=1;i<=n;i++)
{
for(i2=i+1;i2<=n;i2++)
{
ans.push_back(abs(xy[i2].first-xy[i].first)+abs(xy[i2].second-xy[i].second));
}
}
sort(ans.begin(),ans.end());
for(i=0;i<k;i++)
{
cout<<ans[i]<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
467 ms |
7028 KB |
Output is correct |
2 |
Correct |
450 ms |
6928 KB |
Output is correct |
3 |
Correct |
429 ms |
4972 KB |
Output is correct |
4 |
Correct |
432 ms |
5040 KB |
Output is correct |
5 |
Correct |
447 ms |
5800 KB |
Output is correct |
6 |
Correct |
31 ms |
4540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2274 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2246 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2246 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
467 ms |
7028 KB |
Output is correct |
2 |
Correct |
450 ms |
6928 KB |
Output is correct |
3 |
Correct |
429 ms |
4972 KB |
Output is correct |
4 |
Correct |
432 ms |
5040 KB |
Output is correct |
5 |
Correct |
447 ms |
5800 KB |
Output is correct |
6 |
Correct |
31 ms |
4540 KB |
Output is correct |
7 |
Runtime error |
2060 ms |
2097156 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
467 ms |
7028 KB |
Output is correct |
2 |
Correct |
450 ms |
6928 KB |
Output is correct |
3 |
Correct |
429 ms |
4972 KB |
Output is correct |
4 |
Correct |
432 ms |
5040 KB |
Output is correct |
5 |
Correct |
447 ms |
5800 KB |
Output is correct |
6 |
Correct |
31 ms |
4540 KB |
Output is correct |
7 |
Runtime error |
2274 ms |
2097156 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |