# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
217270 | theStaticMind | New Home (APIO18_new_home) | C++14 | 5078 ms | 263548 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define INF 100000000000000000
#define modulo 1000000007
#define mod 998244353
#define int long long int
using namespace std;
#define rand() (1ll * rand() * rand() + rand() + 1)
int S;
struct MaxSeg{
vector<int> seg;
void build(){
S = (1 << (int)ceil(log2(sz(seg))));
int l = S - sz(seg);
for(int i = 0; i < l; i++) seg.pb(-INF);
reverse(all(seg));
for(int i = 1; i < sz(seg); i += 2) seg.pb(max(seg[i - 1], seg[i]));
seg.pb(0);
reverse(all(seg));
}
MaxSeg(int n){
seg = vector<int>(n, -INF);
build();
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |