About Me

About Me : I have been working as a Software Engineer for various international companies for four years.Currently, I am working as a full stack Javascript developer in Petronas(Malaysia).

Skills

Skills • Javascript •Typescript •Python •C •Java •ReactJs • Redux • VueJs • NestJs • React Testing Library • Django• PostgreSQL • MySQL • NodeJs • Git • Docker • Jira • Visual Studio Code • Slack

শনিবার, ১৭ জানুয়ারী, ২০১৫

UVA SOLUTION:11559 - Event Planning

//MH RIYAD
//lan:c++

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<string>
#include<map>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<vector>
#include<stack>
#define inf 1<<31
using namespace std;


int main()
{  

vector<int>vc;
int ary[500];
int per, bud, hotel, week;
while (cin >> per >> bud >> hotel >> week)
{  
int weekendprice;
int p = 0;
while (hotel--)
{
cin>>weekendprice;
for (int i = 0; i < week; i++) cin >> ary[i];
for (int i = 0; i < week; i++)
{
if (ary[i] >= per)
{
p = 1;
vc.push_back(weekendprice*per);
break;

}

}


         }
//cout << vc[0] << endl;
if (p == 0) printf("stay home\n");
else
{
sort(vc.begin(), vc.end());
if (vc[0]>bud)
printf("stay home\n");
else cout << vc[0] << endl;
}


vc.clear();

}


return 0;
}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন