이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |