diff --git a/Searching and sorting applications/Momos market.cpp b/Searching and sorting applications/Momos market.cpp index f15797a..9d48f61 100644 --- a/Searching and sorting applications/Momos market.cpp +++ b/Searching and sorting applications/Momos market.cpp @@ -1,3 +1,87 @@ +*/ + + Name: Bhavya Tyagi + Thapar Institute of Engineering & Technology, Patiala + + + PROBLEM STATEMENT +Shreya loves to eat momos. Her mother gives her money to buy vegetables but she +manages to save some money out of it daily. After buying vegetables, she goes to +"Momos Market", where there are ā€˜n’ number of shops of momos. Each of the shop of +momos has a rate per momo. She visits the market and starts buying momos (one from +each shop) starting from the first shop. She will visit the market for ā€˜q’ days. +You have to tell that how many momos she can buy at each day if she starts buying +from the first shop daily. She cannot use the remaining money of one day on some other +day. But she will save them for other expenses in future, so, +you also need to tell the sum of money left with her at the end of each day. +*/ + + //This Code gives TLE for only 1 test case + +#include +using namespace std; +typedef long long ll; + +void momos(vector a,ll n,vector b,ll q) +{ + ll p=q,j=0; + while(p--&&j a,b; + cin>>n; + ll m=n; + while(m--) + { + ll input; + cin>>input; + a.push_back(input); + } + ll q; + cin>>q; + ll p=q; + while(p--) + { + ll days; + cin>>days; + b.push_back(days); + } + + momos(a,n,b,q); + return 0; +} + + + + + + + + + + + + + +//Code By the Original Author - Time-Limit-Exceeded for 3 testcases /* Name: Mehul Chaturvedi