s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s297553069
p00027
u540744789
1426608569
Python
Python
py
Accepted
10
4232
411
days_sum={1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30, 10:31,11:30,12:31} days2month={1:'Thursday',2:'Friday',3:'Saturday',4:'Sunday', 5:'Monday',6:'Tuesday',0:'Wednesday'} while True: month,day=map(int,raw_input().split(" ")) if month==0 and day==0: break keika=0 for i in range(1,month): keika += days_sum[i] keika+=day print days2month[keika%7]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,002
s693168692
p00027
u145563629
1429521696
Python
Python
py
Accepted
20
4428
443
import datetime try: while 1: s = raw_input().split() s[0] = int(s[0]) s[1] = int(s[1]) if s[0] + s[1] == 0: exit() n = datetime.date(2004, s[0], s[1]).weekday() if n == 0: print("Monday") elif n == 1: print("Tuesday") elif n == 2: print("Wednesday") elif n == 3: print("Thursday") elif n == 4: print("Friday") elif n == 5: print("Saturday") elif n == 6: print("Sunday") except: pass
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,003
s074010277
p00027
u067299340
1433400490
Python
Python
py
Accepted
20
4480
120
from datetime import date while 1: m,d=map(int,raw_input().split()) if m==0:break print date(2004,m,d).strftime("%A")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,004
s363356007
p00027
u067299340
1433400494
Python
Python
py
Accepted
10
4480
120
from datetime import date while 1: m,d=map(int,raw_input().split()) if m==0:break print date(2004,m,d).strftime("%A")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,005
s124082042
p00027
u873482706
1434553701
Python
Python
py
Accepted
10
4292
619
def create(month, days): day = 1 while week: calendar[(month, day)] = week[0] week.append(week[0]) del week[0] if day == days: break day += 1 week = ['Thursday','Friday','Saturday','Sunday','Monday','Tuesday','Wednesday'] calendar = {} for i in range(12): month = i+1 if month in (1,3,5,7,8,10,12): create(month, 31) elif month == 2: create(month, 29) else: create(month, 30) while True: month, day = map(int, raw_input().split()) if month == 0 and day == 0: break print calendar[(month, day)]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,006
s200511585
p00027
u534550471
1434573157
Python
Python
py
Accepted
10
4376
764
import sys import math dayy = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def days(a, day): if a == 0: return day else: return days(a-1, day + dayy[a]) while 1: inp = raw_input().split() ii = int(inp[0]) jj = int(inp[1]) if ii == 0 and jj== 0: break ans = days(ii-1, 0) + jj ans = ans % 7 if ans == 1: print "Thursday" continue if ans == 2: print "Friday" continue if ans == 3: print "Saturday" continue if ans == 4: print "Sunday" continue if ans == 5: print "Monday" continue if ans == 6: print "Tuesday" continue if ans == 0: print "Wednesday" continue
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,007
s763356026
p00027
u873482706
1434584640
Python
Python
py
Accepted
10
4292
596
def create(month, days): day = 1 while day <= days: calendar[(month, day)] = week[0] week.append(week[0]) del week[0] day += 1 week = ['Thursday','Friday','Saturday','Sunday','Monday','Tuesday','Wednesday'] calendar = {} for i in range(12): month = i+1 if month in (1,3,5,7,8,10,12): create(month, 31) elif month == 2: create(month, 29) else: create(month, 30) while True: month, day = map(int, raw_input().split()) if month == 0 and day == 0: break print calendar[(month, day)]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,008
s270465633
p00027
u873482706
1434585085
Python
Python
py
Accepted
10
4292
589
def create(month, days): day = 1 while day <= days: calendar[(month, day)] = week[0] week.append(week[0]) del week[0] day += 1 week = ['Thursday','Friday','Saturday','Sunday','Monday','Tuesday','Wednesday'] calendar = {} for i in range(12): month = i+1 if month == 2: create(month, 29) elif month in (4,6,9,11): create(month, 30) else: create(month, 31) while True: month, day = map(int, raw_input().split()) if month == 0 and day == 0: break print calendar[(month, day)]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,009
s414376325
p00027
u873482706
1434585399
Python
Python
py
Accepted
20
4288
581
def create(month, days): for i in range(days): day = i+1 calendar[(month, day)] = week[0] week.append(week[0]) del week[0] week = ['Thursday','Friday','Saturday','Sunday','Monday','Tuesday','Wednesday'] calendar = {} for i in range(12): month = i+1 if month == 2: create(month, 29) elif month in (4,6,9,11): create(month, 30) else: create(month, 31) while True: month, day = map(int, raw_input().split()) if month == 0 and day == 0: break print calendar[(month, day)]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,010
s040627017
p00027
u379956761
1435314168
Python
Python3
py
Accepted
30
6720
362
import sys day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] num = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] for s in sys.stdin: M, D = map(int, s.strip().split()) if M == 0: break totalDay = D M -= 1 while M > 0: totalDay += num[M-1] M -= 1 print(day[(totalDay+2)%7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,011
s748613220
p00027
u140201022
1444545775
Python
Python
py
Accepted
20
6408
270
ans=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] c=[31,29,31,30,31,30,31,31,30,31,30,31] while 1: a,b=map(int,raw_input().split()) if a==0: break t=3 for i in range(a-1): t+=c[i] t+=b print ans[(t-1)%7]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,012
s992458487
p00027
u071010747
1445316573
Python
Python3
py
Accepted
20
7612
755
# -*- coding:utf-8 -*- def main(): LIST=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] while True: try: count=3 M,D=map(int,input().split()) if M==0: break if M in [1,4,7]: pass elif M in [10]: count+=1 elif M in [5]: count+=2 elif M in [2,8]: count+=3 elif M in [3,11]: count+=4 elif M in [6]: count+=5 elif M in [9,12]: count+=6 count+=D%7 print(LIST[count%7]) except: break if __name__ == '__main__': main()
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,013
s974874298
p00027
u461370825
1449744265
Python
Python
py
Accepted
10
6400
393
from math import * PI = 3.1415926535898 res = [0,31,29,31,30,31,30,31,31,30,31,30,31] wk = ["Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday"] pas = [0] for i in range(1, len(res)): pas.append(pas[i-1] + res[i]) while True: try: m, d = map(int, raw_input().strip().split(' ')) if m == 0 and d == 0: break print wk[(pas[m-1]+d)%7] except EOFError: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,014
s929465513
p00027
u560214129
1450499934
Python
Python3
py
Accepted
30
8048
550
from datetime import date import sys for line in sys.stdin.readlines(): m , d = map(int,line.split()) if m != 0 and d != 0 : val = date(2004,m,d) day = val.isoweekday() if day == 7: print("Sunday") elif day == 1: print("Monday") elif day == 2: print("Tuesday") elif day == 3: print("Wednesday") elif day == 4: print("Thursday") elif day == 5: print("Friday") else: print("Saturday") else: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,015
s531150878
p00027
u075836834
1458327341
Python
Python3
py
Accepted
30
7672
547
def day(x,y): start=0 if x==2 or x==8 : start=0 elif x==3 or x==11: start=1 elif x==6: start=2 elif x==9 or x==12: start=3 elif x==1 or x==4 or x==7: start=4 elif x==10: start=5 elif x==5: start=6 day=(start+y)%7 if day==1: return "Sunday" elif day==2: return "Monday" elif day==3: return "Tuesday" elif day==4: return "Wednesday" elif day==5: return "Thursday" elif day==6: return "Friday" else:#0 return "Saturday" while True: x,y=map(int,input().split()) if x==y==0: break print(day(x,y))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,016
s744997911
p00027
u650459696
1458738958
Python
Python3
py
Accepted
20
7504
260
month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30] day = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday'] while True: m, d = map(int, input().split()) if m == 0: break print(day[(sum(month[:m - 1]) + d) % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,017
s564401342
p00027
u148101999
1459389864
Python
Python
py
Accepted
10
6460
504
#encoding=utf-8 import datetime def tako(): while True: month, day = map(int, raw_input().split()) if month == day == 0: break date1 = datetime.date(2004,month,day) tag = date1.weekday() print syori(tag + 1) def syori(m): if m == 1: return "Monday" elif m == 2: return "Tuesday" elif m == 3: return "Wednesday" elif m == 4: return "Thursday" elif m == 5: return "Friday" elif m == 6: return "Saturday" elif m == 7: return "Sunday" if __name__ == "__main__": tako()
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,018
s946256312
p00027
u966364923
1459781543
Python
Python3
py
Accepted
20
7660
503
DAY_OF_WEEK = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] def day_of_week(y, m, d): # ?????\?????????(?????§???????????¬???) # ??\?????\???0,????????\???6 # Zeller's congruence if m == 1 or m == 2: m += 12 y -= 1 h = (y + y // 4 - y // 100 + y // 400 + (13 * m + 8) // 5 + d) % 7 return h while True: m,d = map(int, input().split()) if m==0: exit() print(DAY_OF_WEEK[day_of_week(2004,m,d)])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,019
s707396797
p00027
u476672042
1460027237
Python
Python
py
Accepted
10
6472
428
from datetime import date while 1: input_data = map(int,raw_input().split()) day = 0 if input_data[0] == 0: break day = date(2004,int(input_data[0]),int(input_data[1])).weekday() if day == 6: print("Sunday") elif day == 0: print("Monday") elif day == 1: print("Tuesday") elif day == 2: print("Wednesday") elif day == 3: print("Thursday") elif day == 4: print("Friday") elif day == 5: print("Saturday")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,020
s390363576
p00027
u130979865
1460028241
Python
Python
py
Accepted
10
6260
451
# -*- coding: utf-8 -*- import sys days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] while True: ans = 3 m, d = map(int, raw_input().split()) if m == 0: break for i in range(1, m): if i == 2: ans = (ans+1)%7 elif i == 4 or i == 6 or i == 9 or i == 11: ans = (ans+2)%7 else: ans = (ans+3)%7 ans = (ans+d)%7 print days[ans]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,021
s232937234
p00027
u572790226
1460627601
Python
Python3
py
Accepted
20
7568
322
while True: m, d = map(int, input().split()) if m == d == 0: break dim = {1: 0, 2: 31, 3: 60, 4: 91, 5: 121, 6: 152, 7: 182, 8: 213, 9: 244, 10: 274, 11: 305, 12: 335} ds = dim[m] + d -1 print({0:'Thursday', 1:'Friday', 2:'Saturday', 3:'Sunday', 4:'Monday', 5:'Tuesday', 6:'Wednesday'}[ds % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,022
s350512273
p00027
u910692917
1463983357
Python
Python3
py
Accepted
30
7664
295
daymonth = [0, 2, 5, 6, 2, 4, 0, 2, 5, 1, 3, 6, 1] str = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] #print(input().split(" ")) m = 1 d = 1 while m!=0: md = input().split(" ") m = int(md[0]) d = int(md[1]) if m != 0: print(str[(daymonth[m] + d) % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,023
s241405357
p00027
u765849500
1466216996
Python
Python
py
Accepted
10
6504
282
from datetime import date while 1: m, d = map(int, raw_input().split()) if m == d == 0: break ans = date(2004,m,d).weekday() ansday = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] for i in range(7): if ans == i: print ansday[i]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,024
s168528330
p00027
u203261375
1466908109
Python
Python3
py
Accepted
30
8104
464
from datetime import date while True: m,d = map(int, input().split()) if m == 0 or d == 0: break wDay = date(2004, m, d).weekday() if wDay == 0: print("Monday") elif wDay == 1: print("Tuesday") elif wDay == 2: print("Wednesday") elif wDay == 3: print("Thursday") elif wDay == 4: print("Friday") elif wDay == 5: print("Saturday") elif wDay == 6: print("Sunday")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,025
s147404820
p00027
u766477342
1467674526
Python
Python3
py
Accepted
30
8056
303
from datetime import date day = ( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Sunday',) while 1: m, d = list(map(int, input().split())) if m == 0: break print(day[date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,026
s336365276
p00027
u766477342
1467760668
Python
Python3
py
Accepted
30
7636
395
day = ( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ) mm = {1:4, 2:0, 3:1, 4:4, 5:6, 6:2, 7:4, 8:0, 9:3, 10:5, 11:1, 12:3, } while 1: m, d = list(map(int, input().split())) if m == 0: break print(day[(mm[m] + d - 1)%7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,027
s367790766
p00027
u300946041
1468677779
Python
Python3
py
Accepted
30
8116
581
# -*- coding:utf-8 -*- import datetime def main(a, b): dt = datetime.datetime(2004, a, b) week_num = dt.weekday() if week_num == 0: print('Monday') elif week_num == 1: print('Tuesday') elif week_num == 2: print('Wednesday') elif week_num == 3: print('Thursday') elif week_num == 4: print('Friday') elif week_num == 5: print('Saturday') elif week_num == 6: print('Sunday') while True: a, b = [int(e) for e in input().split()] if a == 0 and b == 0: break main(a, b)
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,028
s990188193
p00027
u896025703
1469599873
Python
Python3
py
Accepted
30
7564
337
mday = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] youbi = ["Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday"] while True: month, day = map(int, input().split()) if month == day == 0: break days = 0 for m in range(12): if month-1 <= m: break days += mday[m] days += day print(youbi[days % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,029
s109431738
p00027
u146816547
1471277291
Python
Python
py
Accepted
10
6412
239
from datetime import date weeks = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: s = map(int, raw_input().split()) if s[0] == 0: break print weeks[date(2004, s[0], s[1]).weekday()]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,030
s165284931
p00027
u358919705
1471992258
Python
Python3
py
Accepted
20
7600
314
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] nums = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] while True: try: m, d = map(int, input().split()) if not m: break except: break print(days[(sum(nums[:m - 1]) + d + 2) % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,031
s606709369
p00027
u379499530
1473141625
Python
Python
py
Accepted
10
6276
339
c = [] m = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] w = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] s = 3 for d in m: c.append([(s + i) % 7 for i in xrange(d)]) s = c[-1][-1] + 1 while 1: mon, day = map(int, raw_input().split()) if mon == 0: break print w[c[mon - 1][day - 1]]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,032
s213766551
p00027
u922871577
1479443679
Python
Python
py
Accepted
10
6512
250
import sys import datetime w = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] while True: m, d = map(int, raw_input().split()) if m == 0 and d == 0: break print w[datetime.date(2004,m,d).weekday()]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,033
s462649979
p00027
u777299405
1479966103
Python
Python3
py
Accepted
30
8008
265
import datetime daylist = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: m, d = map(int, input().split()) if m == 0: break day = datetime.date(2004, m, d).weekday() print(daylist[day])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,034
s417136244
p00027
u301729341
1481121565
Python
Python3
py
Accepted
20
7800
714
import math def Wit(y,m,d): if m == 1 or m == 2: y -= 1 m += 12 e = math.floor((26 * (m + 1)) / 10) Y = y % 100 C = math.floor(y / 100) f = math.floor(C / 4) g = math.floor(Y / 4) h = d + e + Y + f + g + 5 * C h = int(h % 7) return h while True: y = 2004 m,d = map(int,input().split()) if m == 0 and d == 0: break You = Wit(y,m,d) if You == 1: print("Sunday") elif You == 3: print("Tuesday") elif You == 2: print("Monday") elif You == 4: print("Wednesday") elif You == 5: print("Thursday") elif You == 6: print("Friday") elif You == 0: print("Saturday")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,035
s068556471
p00027
u811733736
1481635384
Python
Python3
py
Accepted
40
8024
313
from datetime import date if __name__ == '__main__': while True: # ??????????????\??? month, day = [int(x) for x in input().split(' ')] if month == 0: break # ?????\????¨??????¨??????????????? dt = date(2004, month, day) print(dt.strftime('%A'))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,036
s113842821
p00027
u546285759
1482125477
Python
Python3
py
Accepted
20
8084
275
from datetime import date while True: m, d = map(int, input().split()) if (m, d) == (0, 0): break weeks = {1:'Monday',2:'Tuesday',3:'Wednesday',4:'Thursday',5:'Friday',6:'Saturday',7:'Sunday'} w = date.isoweekday(date(2004, m, d)) print(weeks[w])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,037
s996177779
p00027
u661290476
1482374792
Python
Python3
py
Accepted
30
8116
217
from datetime import date week=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] while True: a,b=map(int,input().split()) if a==0: break print(week[date(2004,a,b).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,038
s814772299
p00027
u711765449
1484414811
Python
Python3
py
Accepted
30
8004
223
from datetime import date LIST=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] while True: m, d = map(int,input().split()) if m == 0: break print(LIST[date(2004,m,d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,039
s263649274
p00027
u078042885
1484905981
Python
Python3
py
Accepted
20
7532
191
while 1: m,d=map(int,input().split()) if m==0:break print(['Wednes', 'Thurs', 'Fri', 'Satur', 'Sun', 'Mon', 'Tues'][([0,31,60,91,121,152,182,213,244,274,305,335][m-1]+d)%7]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,040
s996429552
p00027
u078042885
1484906084
Python
Python3
py
Accepted
20
7552
185
while 1: m,d=map(int,input().split()) if m==0:break print(['Wednes','Thurs','Fri','Satur','Sun','Mon','Tues'][([0,31,60,91,121,152,182,213,244,274,305,335][m-1]+d)%7]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,041
s812668965
p00027
u078042885
1484907050
Python
Python3
py
Accepted
30
8000
179
import datetime while 1: m,d=map(int,input().split()) if m==0:break print(['Mon','Tues','Wednes','Thurs','Fri','Satur','Sun'][datetime.date(2004,m,d).weekday()]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,042
s027423619
p00027
u252414452
1486147060
Python
Python
py
Accepted
10
6432
252
import datetime l = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] while True: m, d = raw_input().rstrip().split(" ") if int(m) == 0 and int(d) == 0: break print(l[datetime.date(2004, int(m), int(d)).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,043
s219092170
p00027
u797673668
1486717600
Python
Python3
py
Accepted
40
8964
176
from datetime import date import calendar while True: m, d = map(int, input().split()) if not m: break print(calendar.day_name[date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,044
s869954028
p00027
u964040941
1489446428
Python
Python3
py
Accepted
30
7444
434
month = [0,31,29,31,30,31,30,31,31,30,31,30,31] week = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'] while True: m,d = list(map(int,input().split())) if m == 0 and d == 0: break day = 3 x = 1 y = 1 while x != m or y != d: if y == month [x]: x += 1 y = 1 else: y += 1 day += 1 day %= 7 print(week [day])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,045
s205894532
p00027
u901080241
1491632201
Python
Python3
py
Accepted
30
7596
247
days = [31,29,31,30,31,30,31,31,30,31,30,31] ans = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] while True: idx = 3 m,d = map(int, input().split()) if m==0: break print(ans[(idx+sum(days[:m-1])+d-1)%7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,046
s259464353
p00027
u462831976
1492731390
Python
Python3
py
Accepted
30
8120
411
# -*- coding: utf-8 -*- import sys import os import datetime DAY_OF_WEEK = ['Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday'] MONTH = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] for s in sys.stdin: month, day = map(int, s.split()) if month == day == 0: break past_day = sum(MONTH[:month]) + day - 1 a = past_day % 7 print(DAY_OF_WEEK[a])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,047
s174468725
p00027
u868716420
1494377049
Python
Python3
py
Accepted
20
8052
259
from datetime import date DOTW = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] while True : try : month,day = [int(_) for _ in input().split()] print(DOTW[date(2004,month,day).weekday()]) except : break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,048
s531582569
p00027
u421983421
1496066707
Python
Python
py
Accepted
10
6248
361
monthday = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] days = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday'] def nthday(m, d): cnt = d for i in range(0, m): cnt += monthday[i] return cnt while True: inpt = map(int, raw_input().split()) if inpt[0] == 0: break else: print days[nthday(inpt[0], inpt[1]) % 7]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,049
s328426116
p00027
u905313459
1496473251
Python
Python3
py
Accepted
30
7980
182
import sys from datetime import * for line in sys.stdin: m, d = map(int,line.split()) try: print(date(2004, m, d).strftime("%A")) except ValueError: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,050
s045973309
p00027
u395334793
1499330268
Python
Python3
py
Accepted
30
8076
269
import datetime days = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] while True: m, d = map(int, input().split(' ')) if m == 0: break print(days[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,051
s918940612
p00027
u546285759
1502353263
Python
Python3
py
Accepted
30
7980
312
from datetime import date while True: m, d = map(int, input().split()) if m == 0: break result = date(2004, m, d).isoweekday() print("Monday"*(result==1)+"Tuesday"*(result==2)+"Wednesday"*(result==3)+"Thursday"*(result==4)+"Friday"*(result==5)+"Saturday"*(result==6)+"Sunday"*(result==7))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,052
s352816851
p00027
u546285759
1502353328
Python
Python3
py
Accepted
20
7980
297
from datetime import date while True: m, d = map(int, input().split()) if m == 0: break result = date(2004, m, d).isoweekday() print("Mon"*(result==1)+"Tues"*(result==2)+"Wednes"*(result==3)+"Thurs"*(result==4)+"Fri"*(result==5)+"Satur"*(result==6)+"Sun"*(result==7)+"day")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,053
s382319838
p00027
u821624310
1502795004
Python
Python3
py
Accepted
20
7544
322
while True: m, d = map(int, input().split()) if m == d == 0: break dim = {1: 0, 2: 31, 3: 60, 4: 91, 5: 121, 6: 152, 7: 182, 8: 213, 9: 244, 10: 274, 11: 305, 12: 335} ds = dim[m] + d -1 print({0:'Thursday', 1:'Friday', 2:'Saturday', 3:'Sunday', 4:'Monday', 5:'Tuesday', 6:'Wednesday'}[ds % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,054
s510459460
p00027
u584777171
1503151738
Python
Python3
py
Accepted
30
7584
387
week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] while 1: key = 2 data = list(map(int, input().split())) if data[0] == 0 and data[1] == 0: break month = data[0] day = data[1] for i in range(month-1): key += days[i] key += day print(week[key % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,055
s622246190
p00027
u957021183
1504849130
Python
Python3
py
Accepted
50
8060
414
# Aizu Problem 0027: What day is today? # import sys, math, os, datetime # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") DAY = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: m, d = [int(_) for _ in input().split()] if m == d == 0: break print(DAY[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,056
s840193568
p00027
u957021183
1504849152
Python
Python3
py
Accepted
30
8144
414
# Aizu Problem 0027: What day is today? # import sys, math, os, datetime # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") DAY = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: m, d = [int(_) for _ in input().split()] if m == d == 0: break print(DAY[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,057
s036903196
p00027
u933096856
1506217820
Python
Python3
py
Accepted
50
9136
453
import sys from datetime import * from time import * day = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] while True: try: user_input_date = '2004/'+'/'.join(input().split()) if user_input_date == '2004/0/0': break else: a = datetime.strptime(user_input_date,'%Y/%m/%d') print(day[a.weekday()]) except ValueError: pass else: sys.exit(1)
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,058
s735666000
p00027
u933096856
1506218105
Python
Python3
py
Accepted
40
9048
452
import sys from datetime import * from time import * day = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] while True: try: user_input_date = '2004/'+'/'.join(input().split()) if user_input_date == '2004/0/0': break else: a = datetime.strptime(user_input_date,'%Y/%m/%d') print(day[a.weekday()]) except ValueError: pass else: sys.exit(1)
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,059
s438980265
p00027
u933096856
1506218142
Python
Python
py
Accepted
20
6996
455
import sys from datetime import * from time import * day = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] while True: try: user_input_date = '2004/'+'/'.join(raw_input().split()) if user_input_date == '2004/0/0': break else: a = datetime.strptime(user_input_date,'%Y/%m/%d') print day[a.weekday()] except ValueError: pass else: sys.exit(1)
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,060
s170593520
p00027
u214404619
1509028416
Python
Python3
py
Accepted
30
7716
358
day = ['Wednesday','Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday'] month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] m, d = [int(i) for i in input().split()] while m != 0: sum = 0 for i in range(0, m - 1): sum += month[i] sum += d print(day[sum % 7]) m, d = [int(i) for i in input().split()]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,061
s954271658
p00027
u845643816
1509253272
Python
Python3
py
Accepted
30
8080
256
# 0027 import datetime day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] while True : month, date = map(int, input().split()) if month == date == 0: break print(day[datetime.date(2004, month, date).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,062
s073673276
p00027
u236679854
1512519026
Python
Python3
py
Accepted
20
5592
373
days_in_month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] while True: m, d = map(int, input().split()) if m == 0 or d == 0: break days = 0 for month in range(0, m-1): days += days_in_month[month] days += d + 2 days %= 7 print(day[days])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,063
s592200706
p00027
u205327055
1513436685
Python
Python
py
Accepted
10
4648
375
month, day = map(int, raw_input().split()) days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] youbi = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] while month != 0: Days = 0 for i in range(month - 1): Days += days[i] Days += day print youbi[(Days + 3) % 7] month, day = map(int, raw_input().split())
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,064
s684741404
p00027
u299798926
1513757068
Python
Python3
py
Accepted
20
5596
491
lis=[0 for i in range(7)] lis[0]="Wednesday" lis[1]="Thursday" lis[2]="Friday" lis[3]="Saturday" lis[4]="Sunday" lis[5]="Monday" lis[6]="Tuesday" while 1: date=0 x,y=map(int,input().split()) if x!=0 and y!=0: for i in range(1,x): if i==4 or i==6 or i==9 or i==11: date=date+30 elif i==2: date =date+29 else: date=date+31 k=(date+y)%7 print(lis[k]) else: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,065
s423476808
p00027
u471400255
1514306401
Python
Python3
py
Accepted
20
5596
559
f = lambda x:x%7 p = print def judge(x): if f(x)== 1: p("Thursday") elif f(x) == 2: p("Friday") elif f(x) == 3: p("Saturday") elif f(x) == 4: p("Sunday") elif f(x) == 5: p("Monday") elif f(x) == 6: p("Tuesday") else: p("Wednesday") days = [31,29,31,30,31,30,31,31,30,31,30,31] while True: month,day = [int(i) for i in input().split()] if month == 0: break elif month == 1: x = day else: x = sum(days[:month-1]) + day judge(x)
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,066
s196133739
p00027
u028347703
1514567509
Python
Python3
py
Accepted
20
5600
441
import sys DoD = ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"] def getPNoD(n): if n == 1: return 0 elif n == 3: return 29 + getPNoD(n-1) elif (n % 2 == 0 and n <= 8) or (n % 2 != 0 and n > 8): return 31 + getPNoD(n-1) else: return 30 + getPNoD(n-1) for line in sys.stdin: m, d = [int(i) for i in line.split()] if m == 0: break n = getPNoD(m) + d - 1 print(DoD[n % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,067
s430725726
p00027
u585035894
1514626309
Python
Python3
py
Accepted
20
6044
284
import datetime weekdays = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] while True: m,d = [int(i) for i in input().split()] if not(m or d): break print(weekdays[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,068
s682948171
p00027
u024715419
1516004235
Python
Python3
py
Accepted
20
6036
257
import datetime date_list = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: m, d = map(int, input().split()) if m == 0 and d == 0: break print(date_list[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,069
s924066018
p00027
u024715419
1516097553
Python
Python3
py
Accepted
20
6032
257
import datetime date_list = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: m, d = map(int, input().split()) if m == 0 and d == 0: break print(date_list[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,070
s898559374
p00027
u957840591
1516437621
Python
Python3
py
Accepted
20
5592
397
accum = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335] youbi = ["Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", ] def getYoubi(month, day): total = accum[month - 1] + day return youbi[total % 7] month = 13 day = 32 while True: month, day = map(int, input().split()) if month == 0: break print(getYoubi(month, day))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,071
s436594368
p00027
u737311644
1516790552
Python
Python3
py
Accepted
20
5596
463
while True: a,b=map(int,input().split()) c=0 if a==0: break tuki=[31,29,31,30,31,30,31,31,30,31,30,31] a-=1 for i in range(a): c=c+tuki[i] c+=b if c%7==1: ans="Thursday" if c%7==2: ans="Friday" if c%7==3: ans="Saturday" if c%7==4: ans="Sunday" if c%7==5: ans="Monday" if c%7==6: ans="Tuesday" if c%7==0: ans="Wednesday" print(ans)
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,072
s713327534
p00027
u764789069
1516804862
Python
Python
py
Accepted
10
4648
351
month=[31,29,31,30,31,30,31,31,30,31,30,31] week =['Wednesday','Thursday','Friday','Saturday','Sunday','Monday','Tuesday'] while True: sum=0 m,d=map(int,raw_input().split()) if m==0 and d==0: break else: for i in range(m-1): sum += month[i] sum += d flag = sum % 7 print week[flag]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,073
s285395324
p00027
u150984829
1516994919
Python
Python3
py
Accepted
30
6032
159
import datetime for e in iter(input,'0 0'):print(['Mon','Tues','Wednes','Thurs','Fri','Satur','Sun'][datetime.date(2004,*map(int,e.split())).weekday()]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,074
s398919924
p00027
u150984829
1516994923
Python
Python3
py
Accepted
30
6032
159
import datetime for e in iter(input,'0 0'):print(['Mon','Tues','Wednes','Thurs','Fri','Satur','Sun'][datetime.date(2004,*map(int,e.split())).weekday()]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,075
s659256447
p00027
u150984829
1516994925
Python
Python3
py
Accepted
20
6032
159
import datetime for e in iter(input,'0 0'):print(['Mon','Tues','Wednes','Thurs','Fri','Satur','Sun'][datetime.date(2004,*map(int,e.split())).weekday()]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,076
s106883624
p00027
u150984829
1516995270
Python
Python3
py
Accepted
20
5600
175
for e in iter(input,'0 0'): m,d=map(int,e.split()) print(['Wednes','Thurs','Fri','Satur','Sun','Mon','Tues'][([0,31,60,91,121,152,182,213,244,274,305,335][m-1]+d)%7]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,077
s128638370
p00027
u150984829
1516995433
Python
Python3
py
Accepted
20
6048
105
import datetime for e in iter(input,'0 0'):print(datetime.date(2004,*map(int,e.split())).strftime("%A"))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,078
s891716091
p00027
u150984829
1516995475
Python
Python3
py
Accepted
30
6052
103
from datetime import * for e in iter(input,'0 0'):print(date(2004,*map(int,e.split())).strftime("%A"))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,079
s377250391
p00027
u150984829
1516995478
Python
Python3
py
Accepted
20
6048
103
from datetime import * for e in iter(input,'0 0'):print(date(2004,*map(int,e.split())).strftime("%A"))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,080
s666253218
p00027
u150984829
1516995847
Python
Python3
py
Accepted
20
6052
103
from datetime import * for e in iter(input,'0 0'):print(date(2004,*map(int,e.split())).strftime('%A'))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,081
s865627097
p00027
u150984829
1516995856
Python
Python3
py
Accepted
30
6052
103
from datetime import * for e in iter(input,'0 0'):print(date(2004,*map(int,e.split())).strftime('%A'))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,082
s100306577
p00027
u150984829
1516995860
Python
Python3
py
Accepted
30
6048
103
from datetime import * for e in iter(input,'0 0'):print(date(2004,*map(int,e.split())).strftime('%A'))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,083
s841615807
p00027
u150984829
1516995864
Python
Python3
py
Accepted
20
6048
103
from datetime import * for e in iter(input,'0 0'):print(date(2004,*map(int,e.split())).strftime('%A'))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,084
s963523412
p00027
u043254318
1517177317
Python
Python3
py
Accepted
20
5596
520
def get_input(): while True: try: yield ''.join(input()) except EOFError: break daylist = [31,29,31,30,31,30,31,31,30,31,30,31] namelist = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] N = list(get_input()) m,d = [int(i) for i in N[0].split()] cnt = 1 while m != 0 or d != 0: ans = 2 for i in range(m-1): ans += daylist[i] ans += d ans %= 7 print(namelist[ans]) m,d = [int(i) for i in N[cnt].split()] cnt += 1
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,085
s819533283
p00027
u548155360
1517459601
Python
Python3
py
Accepted
20
5596
500
# coding=utf-8 day_1_list = [4, 7, 1, 4, 6, 2, 4, 7, 3, 5, 1, 3] while True: month, day = map(int, input().split()) if month == 0: break dw = (day_1_list[month-1] + day - 1) % 7 if dw == 1: print("Monday") elif dw == 2: print("Tuesday") elif dw == 3: print("Wednesday") elif dw == 4: print("Thursday") elif dw == 5: print("Friday") elif dw == 6: print("Saturday") elif dw == 0: print("Sunday")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,086
s824616735
p00027
u553148578
1523847174
Python
Python3
py
Accepted
20
5604
208
while 1: day = ['Wednes','Thurs','Fri','Satur','Sun','Mon','Tues'] month = [0,31,60,91,121,152,182,213,244,274,305,335] m,d=map(int,input().split()) if m == 0: break print(day[(month[m-1]+d)%7]+'day')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,087
s491949766
p00027
u898097781
1525421188
Python
Python3
py
Accepted
50
7336
383
from datetime import datetime youbi = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] while True: line = input() if line.strip() == '0 0': break else: month, day = map(int, line.strip().split(' ')) f = '%Y-%m-%d' a = datetime.strptime('2004-{}-{}'.format(month, day), f) print(youbi[a.weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,088
s042778908
p00027
u724548524
1525854277
Python
Python3
py
Accepted
20
5596
239
s = (0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30) w = ("Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday") while True: m, d = map(int, input().split()) if m == 0:break print(w[(d + sum(s[:m])) % 7])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,089
s206830171
p00027
u481456091
1526129146
Python
Python3
py
Accepted
30
6052
172
from datetime import datetime y = 2004 while (True): m, d = map(int, input().split()) if m == 0: break day = datetime(y, m, d) print(day.strftime('%A'))
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,090
s186219776
p00027
u136916346
1527396488
Python
Python3
py
Accepted
30
6040
411
from datetime import datetime r=[] while 1: l=list(map(int,input().split())) if not l[0] and not l[1]:break r.extend([datetime(year=2004,month=l[0],day=l[1]).weekday()]) for i in r: if i==0:print("Monday") elif i==1:print("Tuesday") elif i==2:print("Wednesday") elif i==3:print("Thursday") elif i==4:print("Friday") elif i==5:print("Saturday") elif i==6:print("Sunday")
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,091
s029712187
p00027
u352394527
1527451096
Python
Python3
py
Accepted
30
6040
257
from datetime import date dic = {0:"Monday", 1:"Tuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"} while True: month, day = map(int, input().split()) if not month: break print(dic[date(2004, month, day).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,092
s622760264
p00027
u847467233
1528695187
Python
Python3
py
Accepted
20
5604
439
# AOJ 0027 What day is today? # Python3 2018.6.11 bal4u def Zeller(y, m, d): if m == 1 or m == 2: y -= 1 m += 12 return (y + y//4 - y//100 + y//400 + (13*m + 8)//5 + d) % 7 import sys week = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] for line in sys.stdin: m, d = list(map(int, line.split())) if m >= 1: print(week[Zeller(2004, m, d)]) else: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,093
s113013722
p00027
u650035614
1530636934
Python
Python3
py
Accepted
20
5664
498
def day(Y, m, d, Gregorian=True): from math import floor # ツェラーの公式 if m <= 2: Y -= 1 m += 12 y = Y%100 c = Y//100 g = 5*c+floor(c/4) if Gregorian else 5-c return (d + floor(26*(m+1)/10) + y + floor(y/4) + g) %7 # 0->土曜, 6->金曜 day_en = ["Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] while True: m, d = map(int, input().split()) if m == 0: break print(day_en[day(2004, m, d)])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,094
s808540987
p00027
u724947062
1347278432
Python
Python
py
Accepted
10
5396
807
import sys dictionary = { 0:0, 1:31, 2:60, 3:91, 4:121, 5:152, 6:182, 7:213, 8:244, 9:274, 10:305, 11:335, 12:366} for line in sys.stdin.readlines(): line = line.strip() month, day = map(int, line.split()) if month == 0: break else: pastDay = dictionary[month - 1] + day - 1 if pastDay % 7 == 0: print "Thursday" elif pastDay % 7 == 1: print "Friday" elif pastDay % 7 == 2: print "Saturday" elif pastDay % 7 == 3: print "Sunday" elif pastDay % 7 == 4: print "Monday" elif pastDay % 7 == 5: print "Tuesday" else: print "Wednesday"
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,095
s118640094
p00027
u504990413
1353416728
Python
Python
py
Accepted
20
5648
969
dates = [] youbi = [] for i in range(1,13): if i == 1 or i == 3 or i == 5 or i == 7 or i == 8 or i == 10 or i == 12: for j in range(1,32): dates.append([i,j]) elif i == 4 or i == 6 or i == 9 or i == 11: for j in range(1,31): dates.append([i,j]) elif i == 2: for j in range(1,30): dates.append([i,j]) while True: x = map(int, raw_input().split(' ')) if x == [0,0]: for yo in youbi: print yo break elif dates.index(x) % 7 == 0: youbi.append('Thursday') elif dates.index(x) % 7 == 1: youbi.append('Friday') elif dates.index(x) % 7 == 2: youbi.append('Saturday') elif dates.index(x) % 7 == 3: youbi.append('Sunday') elif dates.index(x) % 7 == 4: youbi.append('Monday') elif dates.index(x) % 7 == 5: youbi.append('Tuesday') elif dates.index(x) % 7 == 6: youbi.append('Wednesday')
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,096
s318190013
p00027
u647766105
1355031671
Python
Python
py
Accepted
10
4944
275
import calendar week={0:"Monday", 1:"Tuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"} while True: month,day=map(int,raw_input().split()) if month==0:break print week[calendar.weekday(2004,month,day)]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,097
s640018786
p00027
u647766105
1355034118
Python
Python
py
Accepted
10
5000
154
import calendar while True: month,day=map(int,raw_input().split()) if month==0:break print calendar.day_name[calendar.weekday(2004,month,day)]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,098
s907560337
p00027
u759949288
1355211489
Python
Python
py
Accepted
10
5484
258
day = ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"] month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] while True: m, d = map(int, raw_input().split()) if m == d == 0: break print day[(sum(month[0:m-1]) + d - 1) % 7]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,099
s526401438
p00027
u735362704
1355402140
Python
Python
py
Accepted
10
4988
1,067
#!/usr/bin/env python # coding: utf-8 import sys import datetime """ Input 複数のデータセットを処理しなければなりません。 1つのデータセットに月と日が1つのスペース区切られて1行に与えられます。 月が 0 となったとき入力の最後とします (この場合は処理をしないでプログラムを終了させる)。 Output 各データセットごとに曜日を英語で1行に出力して下さい。 以下の訳を参考にして出力して下さい。 Monday Tuesday Wednesday Thursday Friday Saturday Sunday """ def get_weekday(month, day): weekdays = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday") return weekdays[datetime.date(2004, month, day).weekday()] def main(): while 1: s = sys.stdin.readline() month, day = [int(x) for x in s.split(" ")] if month == 0: return print get_weekday(month, day) if __name__ == '__main__': main()
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,100
s610669281
p00027
u419407022
1356270007
Python
Python
py
Accepted
20
4424
269
import datetime week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: (m, d) = [int(i) for i in raw_input().split()] if m == 0: break dt = datetime.datetime(2004, m, d) print week[dt.weekday()]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day. </p> <p> The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> For each dataset, print the day (please see the following words) in a line. </p> <pre> Monday Tuesday Wednesday Thursday Friday Saturday Sunday </pre> <H2>Sample Input</H2> <pre> 1 1 2 29 0 0 </pre> <H2>Output for the Sample Input</H2> <pre> Thursday Sunday </pre>
1 1 2 29 0 0
Thursday Sunday
8,101