BlueBook
p307ex10: Days
Given a year Y (0 ≤ Y ≤ 3000), month M (1 ≤ M ≤ 12), and day D (depends on what month it is, but will be correct input), output how many days it has been since the beginning of the year.
Be sure to take care of leap years! The year 0 is a leap year..
Input
Line 1: One integer T (1 ≤ T ≤ 100) denoting the number of test cases.
Lines 2..T+1: Three integers Y, M, D.
Output
Lines 1..T: One integer denoting how many days have passed since the beginning of the year.
Sample Input
2 1990 1 1 1992 3 1
Sample Output
1 61
All Submissions
Best Solutions
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 31, 2008
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
Try coming up with some test cases yourself and solving them by hand. Being able to figure out why your code is wrong is an extremely useful skill.
However, I will tell you that it probably has something to do with your variable "i"
Your error is: ValueError: invalid literal for int() with base 10.
May I suggest asking your PEG leaders for help in the future?