Submission #543176

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5431762022-03-29 16:10:24_karan_gandhiSecret (JOI14_secret)C++17
0 / 100
473 ms5488 KiB
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
int MX_lv = 20;
int n;
vector<int> arr;
vector<vector<vector<int>>> dat;
void divi(int l, int r, int level) {
if (l == r) return;
assert(level < MX_lv);
int mid = (l + r) / 2;
dat[mid][level][0] = arr[mid];
dat[mid + 1][level][1] = arr[mid + 1];
for (int i = mid - 1; i >= l; i--) {
dat[i][level][0] = Secret(arr[i], dat[i + 1][level][0]);
}
for (int i = mid + 2; i <= r; i++) {
dat[i][level][1] = Secret(arr[i], dat[i - 1][level][1]);
}
divi(l, mid, level + 1);
divi(mid + 1, r, level + 1);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...