2009 Canadian Computing Competition, Stage 1

Problem J3: Good Times

A mobile cell service provider in Ottawa broadcasts an automated time standard to its mobile users that reflects the local time at the user's actual location in Canada. This ensures that text messages have a valid local time attached to them.

For example, when it is 1420 in Ottawa on Tuesday February 24, 2009 (specified using military, 24 hour format), the times across the country are shown in the table below:

Pacific Time Mountain Time Central Time Eastern Time Atlantic Time Newfoundland Time
Victoria, BC
Tuesday
2/24/2009
1120 PST
Edmonton, AB
Tuesday
2/24/2009
1220 MST
Winnipeg, MB
Tuesday
2/24/2009
1320 CST
Toronto, ON
Tuesday
2/24/2009
1420 EST
Halifax, NS
Tuesday
2/24/2009
1520 AST
St. John's, NL
Tuesday
2/24/2009
1550 Newfoundland ST

Write a program that accepts the time in Ottawa in 24 hour format and outputs the local time in each of the cities listed above including Ottawa. You should assume that the input time will be valid (i.e., an integer between 0 and 2359 with the last two digits being between 00 and 59).

You should note that 2359 is one minute to midnight, midnight is 0, and 13 minutes after midnight is 13. You do not need to print leading zeros, and input will not contain any extra leading zeros.

Sample Input

1300

Sample Output

1300 in Ottawa
1000 in Victoria
1100 in Edmonton
1200 in Winnipeg
1300 in Toronto
1400 in Halifax
1430 in St. John's

All Submissions
Best Solutions


Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: May 14, 2009

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

Comments (Search)

Why does my output clip on test case 5

all outputs are clipped, so you can't cheat and hardcode stuff

But why only test case 5???

um, i pretty sure its all clipped, the other cases were also clipped, each test case is allowed put 20 bytes of memory of your output, so all test cases should be clipped, but i don't think this should matter since your code is not right and this shouldn't affect your program, TO CLARIFY, YOUR CODE DOES NOT OUTPUT THE RIGHT OUTPUT, SO TEST CASE # 5 SHOWS A BIT OF YOUR OUTPUT, THIS MEANS YOU NEED TO CHECK OVER YOUR CODE BECAUSE ITS NOT RIGHT FOR THIS PROBLEM

why do i get test case number 5

You're outputting a nonexistent time, such as 1695 or 360.


please learn to use the reply feature

sorry?

When you post a comment as a reply to another comment, make sure you click the plus sign at the right of the box of the comment to which you intend to reply, instead of clicking "Post New" above. I edited your comment in order to make it a reply, as it should be.

Also, please do not use the subject line of a comment to contain your entire message. Instead, leave the subject blank, and put your message in the body. Of course, if you would just use the Reply feature properly, the subject field would be taken care for you automatically.

Ah, but you might not be testing the relevant value.
Try inputting 59.