#include <bits/stdc++.h>
using namespace std;
vector< long long > v;
int main() {
int n, k;
cin >> n >> k;
long long x[n + 1], y[n + 1];
for( int i = 1; i <= n; i++ ){
cin >> x[i] >> y[i];
}
for( int i = 1; i <= n; i++ ){
for( int j = i + 1; j <= n; j++ ){
v.push_back( abs( x[i] - x[j] ) + abs( y[i] - y[j] ) );
}
}
sort(v.begin(), v.end());
for( int i = 0; i < k; i++ )
cout << v[i] << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
497 ms |
6824 KB |
Output is correct |
2 |
Correct |
452 ms |
6860 KB |
Output is correct |
3 |
Correct |
423 ms |
5144 KB |
Output is correct |
4 |
Correct |
464 ms |
5072 KB |
Output is correct |
5 |
Correct |
440 ms |
5804 KB |
Output is correct |
6 |
Correct |
28 ms |
4540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2350 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2074 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2074 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
497 ms |
6824 KB |
Output is correct |
2 |
Correct |
452 ms |
6860 KB |
Output is correct |
3 |
Correct |
423 ms |
5144 KB |
Output is correct |
4 |
Correct |
464 ms |
5072 KB |
Output is correct |
5 |
Correct |
440 ms |
5804 KB |
Output is correct |
6 |
Correct |
28 ms |
4540 KB |
Output is correct |
7 |
Runtime error |
1910 ms |
2097156 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
497 ms |
6824 KB |
Output is correct |
2 |
Correct |
452 ms |
6860 KB |
Output is correct |
3 |
Correct |
423 ms |
5144 KB |
Output is correct |
4 |
Correct |
464 ms |
5072 KB |
Output is correct |
5 |
Correct |
440 ms |
5804 KB |
Output is correct |
6 |
Correct |
28 ms |
4540 KB |
Output is correct |
7 |
Runtime error |
2350 ms |
2097156 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |