# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401624 | maximath_1 | Floppy (RMI20_floppy) | C++17 | 151 ms | 15160 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>
#include "floppy.h"
using namespace std;
const int MX = 1e5;
pair<int, int> st[MX * 4];
vector<int> _v;
int n;
string bits = "";
void build(int nd, int cl, int cr){
if(cl == cr) return void(st[nd] = {_v[cl], cl});
build(nd * 2, cl, (cl + cr) / 2);
build(nd * 2 + 1, (cl + cr) / 2 + 1, cr);
st[nd] = max(st[nd * 2], st[nd * 2 + 1]);
}
pair<int, int> que(int nd, int cl, int cr, int lf, int rg){
if(lf > rg || cr < lf || rg < cl) return {-2000000000, -1};
if(lf <= cl && cr <= rg) return st[nd];
pair<int, int> L = que(nd * 2, cl, (cl + cr) / 2, lf, rg);
pair<int, int> R = que(nd * 2 + 1, (cl + cr) / 2 + 1, cr, lf, rg);
return max(L, R);
}
void create(int lf, int rg){
int nw = que(1, 0, n - 1, lf, rg).second;
if(lf <= nw - 1){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |