Submit | All submissions | Best solutions | Back to list |
CODEIT03 - Play with Dates |
Given the date, month and year, find the day.
Input
The first line consists of an integer t, the number of test cases. Then for each test case there are three integers the day, month and year.
Output
For each test case print the day in words in a separate line (the first character should be capitalised followed by lowercase).
Constraints
1 ≤ t ≤ 100
Date/month/year ≥ 11/01/2012
Date/month/year ≤ 31/12/3000
The given date will always be a valid date.
Example
Input: 3 11 1 2012 12 1 2012 13 1 2012 Output: Wednesday Thursday Friday
Added by: | cegprakash |
Date: | 2012-01-09 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
hide comments
|
||||||||
2023-11-16 03:01:43
@cegprakash Isn't there any invalid date? I use the Kim Larson F/A and output none when the date is invalid such that 29 2 2013 cost me 1 WA... When I delete this special judge to invalid dates and my program output Friday for previous sample, it got AC. Therefore, please check the test case and figure out if there is any invalid date in it. Added by myself: My program runs well in https://www.spoj.com/problems/CLOCK1/ , so I think you shouldn't doubt the correctness of the F/A or the program. Reply by author: There is no test case with 29 as the date for February month in the judge. You can add a check for the same to verify this if you have an AC solution. I initially created a simple generator to avoid these issues. Last edit: 2024-03-06 16:58:22 |
||||||||
2018-07-01 19:47:05
Read Zeller’s Congruence if you want a O(1) solution. Interesting method. |
||||||||
2015-10-21 13:25:07 Tim Wargon
now i will never forget the logic behind leap years :) AC ! |
||||||||
2015-08-23 01:04:59 Ajay Pilaniya
Problem is easy but implementation is hard |
||||||||
2015-07-27 13:24:25
same logic.. WA in java ..accepted in C++.. |
||||||||
2015-07-22 15:20:25
too easy....check for leap years.... |
||||||||
2015-07-12 19:27:23 Shubhransh Srivastav
http://www.spoj.com/submit/CODEIT03/id=14655301 wa always though getting test cases correct.. someone help plz :( |
||||||||
2015-06-24 14:50:36 kp
after each WA .. got one tricky case :P AC :) |
||||||||
2015-05-31 09:52:27 i_am_looser
Google it.... ;) |
||||||||
2015-05-24 06:47:02 kartikay singh
_/\_ problem setter B-) |