为什么0分?
#include<bits/stdc++.h>
using namespace std;
struct node {
int x,v;
} a[200005];
int b[200005];
struct sal {
int tp,l,r,w;
} zhe[100005];
bool cmp(node x,node y) {
return x.x<y.x;
}
int main() {
int n,num=0;
cin>>n;
for(int i=1; i<=n; i++) {
cin>>zhe[i].tp;
if(zhe[i].tp==1)cin>>zhe[i].l>>zhe[i].r>>zhe[i].w;
else cin>>zhe[i].l>>zhe[i].w;
if(zhe[i].tp!=1) {
a[++num].x=b[num]=zhe[i].l;
} else {
a[++num].x=b[num]=zhe[i].l;
a[++num].x=b[num]=zhe[i].r;
}
}
sort(a+1,a+num+1,cmp);
sort(b+1,b+num+1);
for(int i=1; i<=n; i++) {
if(zhe[i].tp==1) {
int l=lower_bound(b+1,b+n+1,zhe[i].l)-b,r=lower_bound(b+1,b+n+1,zhe[i].r)-b;
a[l].v+=zhe[i].w;
a[r+1].v-=zhe[i].w;
}
if(zhe[i].tp==2) {
int l=lower_bound(b+1,b+n+1,zhe[i].l)-b;
a[l].v+=zhe[i].w;
a[l+1].v-=zhe[i].w;
}
if(zhe[i].tp==3) {
int l=lower_bound(b+1,b+n+1,zhe[i].l)-b;
a[0].v+=zhe[i].w;
a[l].v-=zhe[i].w;
a[l+1].v+=zhe[i].w;
}
}
int ans=0,v,sum=a[0].v;
for(int i=1; i<=num; i++) {
sum+=a[i].v;
if(sum>ans) {
ans=sum;
v=a[i].x;
}
}
cout<<ans<<" "<<v;
}