CODEIT03 - Play with Dates
Play with dates
Given the date, month and year, find the day.
The first line consists of an integer t, the number of test cases. Then for each test case there are three integers the date, month and year.
For each test case print the day in words in a separate line(The first character should be caps followed by small letters).
Date/month/year >= 11/1/2012
The given date will always be a valid date
11 1 2012
12 1 2012
13 1 2012
Read Zeller’s Congruence if you want a O(1) solution. Interesting method.
nice ques...had to check with my phone's calendar to make sure I m getting the correct answer in all cases...ACC in one go...:p
That awkward moment when you google the spellings of the days of the week just to make sure you don't get a WA for that. :P AC at one go, I calculated the days passed since 1/ 1/ 2012 in O(1) and calculated the weekday using the fact that 1/ 1/ 2012 was Sunday.
Ac in one go ;)
now i will never forget the logic behind leap years :) AC !
Problem is easy but implementation is hard
same logic.. WA in java ..accepted in C++..
too easy....check for leap years....
Acin 1st go :D 0.0s