ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1201. Which Day Is It?

WA 10 and I have no idea what could be wrong
Posted by MishaRash 21 Jul 2015 22:33
I wrote the program on Python 3.4. The output for '30 1 2012' is
mon........2....9...16...23..[30]
tue........3...10...17...24...31
wed........4...11...18...25.....
thu........5...12...19...26.....
fri........6...13...20...27.....
sat........7...14...21...28.....
sun...1....8...15...22...29.....
It should be right, but I still got WA.
I think there is too few data about the output format in the problem statement. For example, I had to go to forum to get that there must be 4 spaces between first and second coulumn and no space in the end of the second line in this case.
Re: WA 10 and I have no idea what could be wrong
Posted by MishaRash 25 Jul 2015 00:56
I rewrote the program on C (GCC) and found the problem.
On '1 1 1600' I got
mon........3...10...17...24
tue........4...11...18...25
wed........5...12...19...26
thu........6...13...20...27
fri........7...14...21...28
sat.[.1]...8...15...22...29
sun...2....9...16...23...30
My program calculated number of weeks in the month wrong. When I solved this, I got AC.
Probably the 10th test is not '30 1 2012' any more.