2006 Canadian Computing Competition, Stage 1

Problem J1: The New CCC (Canadian Calorie Counting)

At Chip’s Fast Food emporium there is a very simple menu. Each food item is selected by entering a digit choice.

Here are the three burger choices:
1 – Cheeseburger (461 Calories)
2 – Fish Burger (431 Calories)
3 – Veggie Burger (420 Calories)
4 – no burger
Here are the three drink choices:
1 – Soft Drink ( 130 Calories)
2 – Orange Juice (160 Calories)
3 – Milk (118 Calories)
4 – no drink
Here are the three side order choices:
1 – Fries (100 Calories)
2 – Baked Potato (57 Calories)
3 – Chef Salad (70 Calories)
4 – no side order
Here are the three dessert choices:
1 – Apple Pie (167 Calories)
2 – Sundae (266 Calories)
3 – Fruit Cup (75 Calories)
4 – no dessert

Write a program that will compute the total Calories of a meal.

Input

The program should input a number for each type of item then calculate and display the Calorie total. The first line will be the customer's choice of burger, the second will be the choice of side, then drink, then dessert. You may assume that each input will be a number from 1 to 4. That is, each customer has to pick exactly one number from each of the four options out of each of the four categories.

Output

The program prints out the total Calories of the selected meal, and stops executing after this output.

Sample Input

2
1
3
4

Sample Output

Your total Calorie count is 649.

Explanation

The customer chose Burger #2, Side #1, Drink #3 and Dessert #4.

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 30, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

I am a bit confused as to how the judge works. For some reason, my code runs perfectly on my IDE but I still get a 0/50.

Do we have to put "Your total Calorie count is" before the actual count? because this is very confusing

the problem statement is clear enough, your program should output the exact same thing as the sample


I am a bit curious as to what am I doing wrong in my code? My code for some reason always seems to be in megabytes and always takes 0.003sec. My approach is very similar to some of the people in the best solutions part but I am a bit unsure as to why is my time soo off and program is soo huge?

Typically it's easiest to submit a "best solution" on a problem with a little more meat to it than this one; everyone's runtime is going to be about the same when there's not much work for the computer to do.

Compare this to a 10+ point problem where it's possible to time out with an inefficient solution, and the better algorithm you can come up with, the higher in the "best solutions" page you will be

This is due to a multitude of factors. The judge's specs have changed over time, and the time and memory measurements have become more precise (if not more accurate). If we rejudged the submissions on the best solutions page they'd likely have similar numbers to yours.

If the memory used is reporting as 64k, you can assume it's because it's from an age where it wasn't quite measured that well.

I can only get 40/50... output clipped after "Your total Calorie c"...id get why...

Output clipped just means we don't show you *all* of your output. You only get to see part of it.

Rest assured, your program is still outputting the rest. Your answer just happens to be wrong.