#include <bits/stdc++.h>
using namespace std;
long long n,k,x[10001],y[10001],a[10000001],s;
int main()
{
cin >> n >> k;
for (int i=1; i<=n; i++){
cin >> x[i] >> y[i];
}
for (int i=1; i<=n-1; i++){
for (int j=i+1; j<=n; j++){
a[s]= abs(x[i]-x[j])+abs(y[i]-y[j]); s++;
}
}
sort(a,a+s);
for (int i=0; i<k; i++){
cout<<a[i]<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
449 ms |
6748 KB |
Output is correct |
2 |
Correct |
464 ms |
6772 KB |
Output is correct |
3 |
Correct |
435 ms |
4932 KB |
Output is correct |
4 |
Correct |
434 ms |
4936 KB |
Output is correct |
5 |
Correct |
451 ms |
5572 KB |
Output is correct |
6 |
Correct |
25 ms |
4172 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10065 ms |
13388 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10065 ms |
13388 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
449 ms |
6748 KB |
Output is correct |
2 |
Correct |
464 ms |
6772 KB |
Output is correct |
3 |
Correct |
435 ms |
4932 KB |
Output is correct |
4 |
Correct |
434 ms |
4936 KB |
Output is correct |
5 |
Correct |
451 ms |
5572 KB |
Output is correct |
6 |
Correct |
25 ms |
4172 KB |
Output is correct |
7 |
Runtime error |
14 ms |
716 KB |
Execution killed with signal 11 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
449 ms |
6748 KB |
Output is correct |
2 |
Correct |
464 ms |
6772 KB |
Output is correct |
3 |
Correct |
435 ms |
4932 KB |
Output is correct |
4 |
Correct |
434 ms |
4936 KB |
Output is correct |
5 |
Correct |
451 ms |
5572 KB |
Output is correct |
6 |
Correct |
25 ms |
4172 KB |
Output is correct |
7 |
Incorrect |
9 ms |
332 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |