Program related to Help Ramu!


can anyone please help me why i have got 83.33 score in this ,why i m not able to pass one test case?

Anisha, pls use the following approach in your code :

long long int c1,c2,c3,c4;
long long int n,m;
long long int rick[1000];
long long int cab[1000];
while(t>0)
{
cin>>c1>>c2>>c3>>c4;
cin>>n>>m;
for(int i=0;i<n;i++)
{
cin>>rick[i];
}
for(int i=0;i<m;i++)
{
cin>>cab[i];
}
long long int rickcost=0;
for(int i=0;i<m;i++)
{
rickcost=rickcost+min(c1rick[i],c2);
}
rickcost=min(rickcost,c3);
long long int cabcost=0;
for(int i=0;i<m;i++)
{
cabcost=cabcost+min(c1
cab[i],c2);
}
cabcost=min(cabcost,c3);
long long int final_cost=min(c4,cabcost+rickcost);
cout<<final_cost<<endl;
t–;
}

Mam , you have given the solution taking the help of array and i have not reached array yet . kindly check my solution and plz tell what is wrong ?

I have edited your code… Try to submit now…

mam this is not my code its data structure and i think you have sent the wrong one !

Sry…I send the correct ide …

Mam the code that you sent includes the whole data structure graphs etc… and also when i m executing your program the output is not correct.Your ide contains city ,etc which is not related to help ramu program. And moreover i want to know where i am wrong in my code.Kindly help!

Anisha, sry I send the wrong ide earlier… Pls refer to this edited code. Try to submit now…


The sum values were not getting updated for every test case. Thts why I declared then inside the loop, instead of outside… Rest code was ok.

yeah it worked now. thank you

Pls mark your doubt as resolved…if you were able to submit the code…