| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 366594 | idk321 | 비밀 (JOI14_secret) | C++11 | 610 ms | 4672 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#include "secret.h"
const int N = 1000;
int val[N][9];
void Init(int n, int a[])
{
for (int i = 0; i < n; i++)
{
val[i][0] = a[i];
}
for (int j = 1; j <= 8; j++)
{
for (int i = 0; i + (1 << j) - 1 <n; i++)
{
val[i][j] = Secret(val[i][j - 1], val[i + (1 << (j - 1))][j - 1]);
}
}
}
int Query(int l, int r)
{
int res = -1;
while (l <= r)
{
for (int j = 8; j >= 0; j--)
{
if (l + (1 << j) - 1 <= r)
{
if (res == -1) res = val[l][j];
else res = Secret(res, val[l][j]);
l += (1 << j);
break;
}
}
}
return res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
