# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
935443 | Baizho | 비밀 (JOI14_secret) | C++14 | 429 ms | 4624 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
// #pragma GCC optimize("Ofast,unroll-loops,fast-math")
// #pragma GCC target("popcnt")
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pll;
#define sz size()
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define pb push_back
const int mod = ll(1e9)+7;
const ll MOD = 998244353;
const long long inf = 5e18;
const int M = 1005;
int Secret(int x, int y);
int val[10][M], n, a[M];
void Init(int N, int A[]) {
n = N;
for(int i = 0; i < N; i ++) a[i] = A[i];
for(int i = 0; i < n; i ++) val[0][i] = a[i];
for(int j = 1; j <= 9; j ++) {
for(int i = 0; i + (1 << j) - 1 < n; i ++) {
val[j][i] = Secret(val[j - 1][i], val[j - 1][i + (1 << j - 1)]);
}
}
}
int Query(int L, int R) {
int l = L, r = R, siz = r - l + 1, res = -1;
for(int j = 9; l <= r && j >= 0; j --) {
if(siz & (1 << j)) {
if(res == -1) res = val[j][l];
else res = Secret(res, val[j][l]);
l += (1 << j);
}
}
return res;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |