洛谷P2357 守墓人
老是写挂:)
#include<bits/stdc++.h>
using namespace std;
using ll=long long ;
const int maxn=2e5+9;
struct Node{
ll l,r,v,tag;
}tr[maxn<<2];
ll n,f,a[maxn];
void build(int l,int r,int tot){
if(l==r){
tr[tot].v=a[l];
more...Cf438D The Child and Sequence
有点吉司机线段树的味
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int maxn=1e5+9;
struct Node{
ll l,r,v,ma;
}tr[maxn<<2];
ll n,m,a[maxn];
void build (int l,int r,int tot){
if(l==r){
tr[tot].v=tr[tot].
more...