제출 #808737

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8087372023-08-05 10:19:03oscar1f3단 점프 (JOI19_jumps)C++17
100 / 100
677 ms114100 KiB
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAX_VAL=500*1000+5,INFINI=1000*1000*1000,DECA=(1<<19);
struct noeud {
int maxDF=-INFINI,maxD=-INFINI,maxF=-INFINI;
};
noeud prod(noeud a,noeud b) {
return {max(max(a.maxDF,b.maxDF),a.maxD+b.maxF),max(a.maxD,b.maxD),max(a.maxF,b.maxF)};
}
struct segtree {
vector<noeud> tree;
int n;
segtree(int _n) {
n=_n;
tree.resize(2*n);
}
void modif(int pos,noeud nouvVal) {
pos+=n;
tree[pos]=nouvVal;
while (pos>1) {
pos/=2;
tree[pos]=prod(tree[2*pos],tree[2*pos+1]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...