求助为什么玄学RE
感谢大佬帮忙
#include<bits/stdc++.h>
#define N 5000005
#define LD long double
using namespace std;
int n;
LD p,q,x;
LD t[N],s[N],stot;
queue<LD>Q;
int main()
{
scanf("%d%Lf%Lf%Lf",&n,&x,&p,&q);
for(int i=1;i<=n;i++)
{
scanf("%Lf",&t[i]);
Q.push(t[i]);
}
LD r=p*1.00/q; int day=0;
while(1)
{
day++;
LD t = r*x*day;
s[day]=t-stot;
if(s[day]<=0) s[day]=0.00001;
LD use = x-s[day];
LD tot=0;
while(!Q.empty()&&Q.front()+tot<=use)
{
tot+=Q.front();
Q.pop();
}
if(Q.empty())
{
printf("%d",day);
return 0;
}
stot+=x-tot;
}
return 0;
}