# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
340210 | _ani | K개의 묶음 (IZhO14_blocks) | C++17 | 1080 ms | 9964 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#define BUGO(x) cerr << #x << " = " << (x) << '\n';
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
using ll = long long;
const int N = 100'002;
const int K = 20;
int lg[N];
ll dp[N][102], a[N];
ll mx[N][K];
void Build(int n)
{
lg[1] = 0;
for (int i = 2; i <= n; i++)
lg[i] = lg[i / 2] + 1;
int k = lg[n];
for (int i = 0; i < n; i++)
mx[i][0] = a[i + 1];
for (int j = 1; j <= k; j++)
for (int i = 0; i + (1 << j) - 1 <= n; i++)
mx[i][j] = max(mx[i][j - 1], mx[i + (1 << (j - 1))][j - 1]);
}
ll Mx(int l, int r)
{
l--; r--;
int j = lg[r - l + 1];
return max(mx[l][j], mx[r - (1 << j) + 1][j]);
}
# | 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... |