I was participating in may lunchtime 2020 division and was working on LOSTWKND
my solution is :
int main() {
int test,A[5],P;
double sum;
cin>>test;
while(test–){
cin>>A[0]>>A[1]>>A[2]>>A[3]>>A[4]>>P;
sum=A[0]+A[1]+A[2]+A[3]+A[4];
if( ((sum*P)/5.000000) <= 24.000000)
{cout<<"NO\n";}
else
{cout<<"YES\n";}
}
return 0;
}
and the setter’s solution :
int main(){
ll t;
cin>>t;
while(t–){
ll a[5],p;
ll sum = 0;
for(ll i=0;i<5;i++){
cin>>a[i];
sum += a[i];
}
cin>>p;
if(sump > 245)
cout<<“Yes\n”;
else
cout<<“No\n”;
}
return 0;
}
is exactly the same but little different in condition but the overall meaning is the same , then why my code is wrong.