#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define s second
#define f first
using namespace std;
const int N = 250005;
int x[N],y[N];
vector <ll> ans;
int main (){
ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
int n,m;
cin>>n>>m;
for (int i=1;i<=n;i++)
cin>>x[i]>>y[i];
if (n <= 1000){
for (int i=1;i<=n;i++)
for (int j=1;j<i;j++)
ans.pb(abs(x[i]-x[j]) + abs(y[i] - y[j]));
}
else{
for (int i=1;i<=n;i++)
ans.pb(x[i]);
}
sort(ans.begin(),ans.end());
for (int i=0;i<m;i++)
cout<<ans[i]<<"\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
98 ms |
6972 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
118 ms |
6860 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
90 ms |
4424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
90 ms |
4424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
98 ms |
6972 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
98 ms |
6972 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |