#include<bits/stdc++.h>
#define N 500005
using namespace std;
int n,D,Q,x;
int sum[N],d[N],low[N];
int main()
{
scanf("%d%d",&n,&sum[0]); int x=0;
for (int i=1;i<=n;i++){
scanf("%d",&d[i]);
sum[i]=min(sum[i-1],abs(sum[i-1]-d[i]));
}
low[n+1]=1; for (int i=n;i>0;i--){low[i]=low[i+1];if (d[i]<low[i]*2) low[i]+=d[i];}
scanf("%d",&Q); while (Q--){
scanf("%d",&x);
if (low[x+1]<=sum[x-1]) puts("YES");
else puts("NO");
}
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:8:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&sum[0]); int x=0;
^
./Main.cpp:10:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&d[i]);
^
./Main.cpp:14:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&Q); while (Q--){
^
./Main.cpp:15:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&x);
^