# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
601166 | lordlorinc | Road Construction (JOI21_road_construction) | C++17 | 3784 ms | 28948 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, k;
vector<pair<ll, ll> > sor;
set<pair<ll, ll> > ck;
vector<ll> mo;
vector<ll> calc(ll r){
ck.clear();
vector<ll> res;
ll ind = 0;
for (ll i = 0; i < n; i++){
// cout << sor[i].first << " " << sor[i].second << ": " << endl;
while (ind < i && sor[i].first - sor[ind].first > r) {
ck.erase(make_pair(sor[ind].second, sor[ind].first));
ind++;
}
// for (auto x : ck){
// cout << x.first << " " << x.second << endl;
// }
auto it = ck.lower_bound(make_pair(sor[i].second - r, -4000000001));
while (res.size() < k && it != ck.end() && it -> first <= sor[i].second + r){
// cout << it -> first << " " << it -> second << endl;
ll x1 = (sor[i].first + sor[i].second) / 2, y1 = (sor[i].first - sor[i].second) / 2;
ll x2 = (it -> first + it -> second) / 2, y2 = (it -> second - it -> first) / 2;
// cout << x1 << " " << y1 << " " << x2 << " " << y2 << ": " << abs(x1 - x2) + abs(y1 - y2) << endl;
res.push_back(abs(x1 - x2) + abs(y1 - y2));
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |