# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1144109 | dpsaveslives | Cake (CEOI14_cake) | C++20 | 319 ms | 10096 KiB |
#include<bits/stdc++.h>
using namespace std;
const int Len = 2.5e5 + 5;
struct node
{
int val,idx;
}d[Len];
bool cmp(node x,node y){return x.val > y.val;}
int Id[Len],n,a,q,ans[Len << 2][2],rk[Len];
int ls(int x){return x << 1;}
int rs(int x){return x << 1 | 1;}
void push_up(int x,int t){ans[x][t] = min(ans[ls(x)][t] , ans[rs(x)][t]);}
void build(int p,int l,int r,int t)
{
if(l == r)
{
ans[p][t] = d[l].val;
return;
}
int mid = (l + r) >> 1;
build(ls(p) , l , mid , t);
build(rs(p) , mid + 1 , r , t);
push_up(p , t);
}
void update(int p,int l,int r,int idx,int w,int t)
{
if(l == r)
{
ans[p][t] = w;
return;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |