Canadian Computing Competition: 2000 Stage 1, Junior #1
Write a program to print out a calendar for a particular month given the day on which the first of the month occurs together with the number of days in the month.
Your program should take as input an integer representing the day of the week on which the month begins (1
for Sunday, 2
for Monday, …, 7
for Saturday), and an integer which is the number of days in the month (between 28 and 31 inclusive). Your program should print the appropriate calendar for the month. You can assume that all input data will be valid.
DMOJ-specific note: None of the output lines should contain trailing whitespace. The last line must end with a newline.
Sample Input
3 30
Sample Output
Sun Mon Tue Wed Thr Fri Sat
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Comments
This comment is a promise that one day I will buy the DMOJ website and delete the whitespace requirement on this question. It has caused me too much pain.
Guys if you are coding it in python 3, just add a .rstrip() thing in the end, it would save you a lot of time, basically removes an extra space
This comment is hidden due to too much negative feedback. Show it anyway.
That's the newline character pretty sure
Yeah if u just highlight first line it'll be gone
Hardest J1, even harder than S1 in the same year.
Just a heads up, it's "Thr", not "Thu".
Can you see other's responses on this website? I'm new
Yes, but only after solving the question
The whitespaces are killing me!
Is it possible to import Pandas to make a data frame?
We (much like the CCC and most online judges) do not support non-standard libraries unless the problem explicitly states otherwise.
This problem can be solved using simple loops and if statements, you are likely severely over complicating it.
Why is this a J1 question. It's so difficult. especially with an 11.0% success rate of 2020 July the 20th.
AC rates are not the best indicator of difficulty, as there are some IOI problems with higher AC rates (and implying this problem is harder than those is a bit of a stretch).
The low AC rate is a result of a mass rejudge that happened some time back, where we replaced the old checker with one that was far more strict about whitespacing (as that is the main difficulty of this problem), so many submissions that were previously deemed correct were rejudged as incorrect.
As for its difficulty relative to other J1s, this problem is (IMHO) harder than the majority of J1s from 2010-2020, but it does still fall under Waterloo's description of what a J1 should be.
tf u mean presentation error its exactly the output given
Reiterating the bolded line in the statement: DMOJ-specific note: None of the output lines should contain trailing whitespace. The last line must end with a newline.
This would include trailing newlines (i.e. unnecessary newlines at the end of input).
Important tip if you get Presentation error: None of the output lines should contain trailing whitespace. The last line must end with a newline.
harder one for a J1...
it took me two hours to do this
It took me almost an entire week
Works on PEG judge for all cases but doesn't here. I suppose it is due to whitespace?
what's whitespace?
Thanks