# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
501930 | nighty | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 3035 ms | 38632 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int calcMaxInv(vector<int>& a, int l, int r) {
int maxVal = 0, res = 0;
for (int i = l; i <= r; ++i) {
if (maxVal > a[i]) {
res = max(res, maxVal + a[i]);
}
maxVal = max(maxVal, a[i]);
}
return res;
}
const int K = 470;
const int N = 1e6;
vector<int> s[N / K + 10];
int maxInverse[N / K + 10];
int calcMaxInv2(vector<int>& a, int l, int r) {
int res = 0, maxVal = 0;
if (l % K != 0) {
res = calcMaxInv(a, l, min(r, l - l % K + K - 1));
maxVal = *max_element(a.begin() + l, a.begin() + l - l % K + K - 1 + 1);
l = l - l % K + K;
}
while (l + K - 1 <= r) {
res = max(res, maxInverse[l / K]);
컴파일 시 표준 에러 (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... |