#include <bits/stdc++.h> // pA
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define debug(x) cerr << #x << " = " << (x) << ' '
#define endl cerr << '\n'
#define all(v) (v).begin(), (v).end()
#define lowbit(x) (x)&-(x)
#define pb emplace_back
#define F first
#define S second
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const int N = 2e5+5;
//sconst int INF = 2e9;
pll p[N];
vector<ll> v;
int main(void)
{ IO
ll n, i, Q, j;
cin >> n >> Q;
if (n > 1000) assert(0);
for (i=1; i <= n; ++i) cin >> p[i].F >> p[i].S;
for (i=1; i <= n; ++i)
{
for (j=1; j < i; ++j) v.pb(abs(p[i].F-p[j].F)+abs(p[i].S-p[j].S));
}
sort(all(v));
for (i=0; i < Q; ++i) cout << v[i] << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
7096 KB |
Output is correct |
2 |
Correct |
51 ms |
6988 KB |
Output is correct |
3 |
Correct |
32 ms |
5068 KB |
Output is correct |
4 |
Correct |
33 ms |
5068 KB |
Output is correct |
5 |
Correct |
47 ms |
6100 KB |
Output is correct |
6 |
Correct |
18 ms |
5844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
7096 KB |
Output is correct |
2 |
Correct |
51 ms |
6988 KB |
Output is correct |
3 |
Correct |
32 ms |
5068 KB |
Output is correct |
4 |
Correct |
33 ms |
5068 KB |
Output is correct |
5 |
Correct |
47 ms |
6100 KB |
Output is correct |
6 |
Correct |
18 ms |
5844 KB |
Output is correct |
7 |
Runtime error |
1 ms |
476 KB |
Execution killed with signal 6 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
7096 KB |
Output is correct |
2 |
Correct |
51 ms |
6988 KB |
Output is correct |
3 |
Correct |
32 ms |
5068 KB |
Output is correct |
4 |
Correct |
33 ms |
5068 KB |
Output is correct |
5 |
Correct |
47 ms |
6100 KB |
Output is correct |
6 |
Correct |
18 ms |
5844 KB |
Output is correct |
7 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
8 |
Halted |
0 ms |
0 KB |
- |