# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
644003 | ymm | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 502 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;
const int N = 1'000'010;
struct node {
vector<ll> srt;
ll mxs;
} seg[N<<2];
ll a[N];
int n;
void build(int i=0, int b=0, int e=n)
{
if (e-b == 1) {
seg[i].srt = {a[b]};
seg[i].mxs = 0;
return;
}
build(2*i+1, b, (b+e)/2);
build(2*i+2, (b+e)/2, e);
seg[i].mxs = max(seg[2*i+1].mxs, seg[2*i+2].mxs);
auto it = lower_bound(seg[2*i+2].srt.begin(), seg[2*i+2].srt.end(), seg[2*i+1].srt.back());
if (it != seg[2*i+2].srt.begin())
seg[i].mxs = max(seg[i].mxs, seg[2*i+1].srt.back() + *--it);
컴파일 시 표준 에러 (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... |