# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
738135 | onebit1024 | 비밀 (JOI14_secret) | C++17 | 470 ms | 4436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>>dp;
void Init(int N, int A[]) {
dp = vector<vector<int>>(N, vector<int>(11));
for(int i = 0;i<N;++i)dp[i][0] = A[i];
for(int j = 1;j<=10;++j){
for(int i = 0;(i+(1ll<<j))-1 < N;++i){
dp[i][j] = Secret(dp[i][j-1],dp[i+(1ll<<(j-1))][j-1]);
}
}
}
int Query(int L, int R) {
int res = -1;
for(int i = 10;i>=0;--i){
if((L+(1ll<<i))-1 <= R){
if(res==-1)res = dp[L][i];
else res = Secret(res, dp[L][i]);
L+=(1ll<<i);
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |