Question
Based on UVA Online Judge Problem #11608. Programming contests are being arranged so frequently these days. While this might be a good news for the
Based on UVA Online Judge Problem #11608.
Programming contests are being arranged so frequently these days. While this might be a good news for the contestants, the scenario is completely opposite for the problemsetters. So far, the problemsetters somehow managed to produce enough and say "No problem!". But it is doubtful how long will it be possible if the trend of arranging contests on short notice continues.
You are given the number of problems created in every month of a year and number of problems required in each month. If NNproblems are required in a month and there are not enough problems at that time, all contests that month are canceled. Write a program to determine if there are enough problems for the contests. Please keep in mind that if a problem is created in month XX, it can only be used in month X+1X+1 and later months.
Your work
Write a function vector
Output a vector showing for each month if there are enough problems. If there are enough problems for a month, set the value to No problem! :D. If there are not enough problems for the month, set it to No problem. :(.
Example
For this input:
start = 5 created = {3, 0, 3, 5, 8, 2, 1, 0, 3, 5, 6, 9} needed = {0, 0, 10, 2, 6, 4, 1, 0, 1, 1, 2, 2}
The result would be:
No problem! :D No problem! :D No problem. :( No problem! :D No problem! :D No problem! :D No problem! :D No problem! :D No problem! :D No problem! :D No problem! :D No problem! :D
main.cpp:
#include
using namespace std;
#include "NoProblem.cpp"
int main() {
int start = 5; vector
vector
for(vector
startwith:
vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started