# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
970300 | mychecksedad | 분수 공원 (IOI21_parks) | C++17 | 96 ms | 17764 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n';
#define ll long long int
const int N = 3e5+10;
int construct_roads(std::vector<int> x, std::vector<int> y) {
if (x.size() == 1) {
build({}, {}, {}, {});
return 1;
}
int n = x.size();
vector<int> u, v, a, b;
vector<pair<int, int>> L, R;
for(int i = 0; i < n; ++i){
if(x[i] == 2) L.pb({y[i], i});
else R.pb({y[i], i});
}
sort(all(L));
sort(all(R));
for(int i = 0; i + 1 < L.size(); ++i){
if(L[i + 1].first - L[i].first > 2){
return 0;
}
u.pb(L[i].second);
v.pb(L[i + 1].second);
a.pb(1);
b.pb(L[i + 1].first + L[i].first>>1);
}
for(int i = 0; i + 1 < R.size(); ++i){
if(R[i + 1].first - R[i].first > 2){
return 0;
}
u.pb(R[i].second);
v.pb(R[i + 1].second);
a.pb(5);
b.pb(R[i + 1].first + R[i].first>>1);
}
if(!R.empty() && !L.empty()){
if(L[0].first > R.back().first) return 0;
if(R[0].first > L.back().first) return 0;
if(R[0].first > L[0].first) L.swap(R);
for(int i = 0; i < R.size(); ++i){
if(R[i].first == L[0].first){
u.pb(R[i].second);
v.pb(L[0].second);
a.pb(3);
b.pb(R[i].first);
break;
}
}
}
build(u, v, a, b);
return 1;
}
컴파일 시 표준 에러 (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... |