#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;
ll 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(abs(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 |
Correct |
89 ms |
6956 KB |
Output is correct |
2 |
Correct |
76 ms |
6940 KB |
Output is correct |
3 |
Correct |
50 ms |
5044 KB |
Output is correct |
4 |
Correct |
50 ms |
5124 KB |
Output is correct |
5 |
Correct |
69 ms |
5800 KB |
Output is correct |
6 |
Correct |
27 ms |
4548 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
101 ms |
8760 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
95 ms |
6484 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
95 ms |
6484 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
89 ms |
6956 KB |
Output is correct |
2 |
Correct |
76 ms |
6940 KB |
Output is correct |
3 |
Correct |
50 ms |
5044 KB |
Output is correct |
4 |
Correct |
50 ms |
5124 KB |
Output is correct |
5 |
Correct |
69 ms |
5800 KB |
Output is correct |
6 |
Correct |
27 ms |
4548 KB |
Output is correct |
7 |
Runtime error |
51 ms |
6476 KB |
Execution killed with signal 11 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
89 ms |
6956 KB |
Output is correct |
2 |
Correct |
76 ms |
6940 KB |
Output is correct |
3 |
Correct |
50 ms |
5044 KB |
Output is correct |
4 |
Correct |
50 ms |
5124 KB |
Output is correct |
5 |
Correct |
69 ms |
5800 KB |
Output is correct |
6 |
Correct |
27 ms |
4548 KB |
Output is correct |
7 |
Incorrect |
101 ms |
8760 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |