有没有佬看看下面这个代码为啥E题能过,D题过不了啊
#include <bits/stdc++.h>
#define int long long
using namespace std;
int f[200001],a[200001];
int qian[200001];
vector<int>pos[200001];
int posf=1;
signed main(){
int n,m;
scanf("%lld%lld",&n,&m);
for(int i=1;i<=n;i++){
scanf("%lld",&f[i]);
qian[i]=f[i]+qian[i-1];
}
while(m--){
int flag;
cin>>flag;
if(flag==1){
int l,r;
scanf("%lld%lld",&l,&r);
bool found=0;
for(int i=1;i<posf;i++){
if(l<=pos[i][1]&&l>=pos[i][0]){
pos[i][1]=max(pos[i][1],r);
found=1;
break;
}
else if(r<=pos[i][1]&&r>=pos[i][0]){
pos[i][0]=min(pos[i][0],l);
found=1;
break;
}
}
if(found==0){
pos[posf].push_back(l);
pos[posf].push_back(r);
posf++;
}
}
else{
int v;
scanf("%lld",&v);
bool found=0;
for(int i=1;i<posf;i++){
if(v<=pos[i][1]&&v>=pos[i][0]){
int f1=(qian[pos[i][1]]-qian[pos[i][0]-1]);
int f2=(pos[i][1]-pos[i][0]+1);
long double iq1=(long double)f1;
long double iq2=(long double)f2;
printf("%.10Lf\n",iq1/iq2);
found=1;
break;
}
}
if(found==0){
printf("%lld\n",f[v]);
}
}
}
return 0;
}