submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s180112839 | p00027 | Accepted | import datetime
w = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
while True:
m,d = map(int, raw_input().split())
if m == 0:
break
print w[datetime.date(2004, m, d).weekday()] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s298074221 | p00027 | Accepted | import datetime
import sys
weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
for line in sys.stdin:
data = line.strip().split()
m = data[0]
d = data[1]
if m == '0':
break
date = datetime.datetime.strptime('2004-' + m + '-' + d + ' 13:13:13', '%Y-%m-%d %H:%M:%S')
print weekdays[date.weekday()] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s738993556 | p00027 | Accepted | y = [31,29,31,30,31,30,31,31,30,31,30,31]
dow = {0:"Monday", 1:"Tuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"}
while True:
m, d = map(int, raw_input().split())
if m == 0 and d == 0:
break
n = 0
for i in range(m):
n += y[i]
n -= (y[m-1]-d+1)
print dow[(n+3)%7] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s223778887 | p00027 | Accepted | wd=["Mon","Tues","Wednes","Thurs","Fri","Satur","Sun"]
md=[0,31,29,31,30,31,30,31,31,30,31,30,31]
while 1:
m,d = map(int, raw_input().split())
if m==0: break
s = sum([md[i] for i in range(m)]) + d + 2
s = wd[s % 7]+"day"
print s | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s310776938 | p00027 | Accepted | import datetime
WEEKDAY = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
while 1:
a, b = map(int, raw_input().split())
if a == b == 0:
break
print WEEKDAY[datetime.date(2004, a, b).weekday()] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s175896051 | p00027 | Accepted | import datetime
while True:
m, d = map(int, raw_input().split())
if m == 0 and d == 0:
break
print ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][datetime.date(2004, m, d).weekday()] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s785191894 | p00027 | Accepted | days=(31,29,31,30,31,30,31,31,30,31,30,31)
day=('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')
while True:
total=0
m,d=map(int,raw_input().split(" "))
if m!=0:
for i in range(m-1):
total+=days[i]
total+=d
print day[(total+3)%7]
else:
break | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s730557172 | p00027 | Accepted | dw = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')
dm = (31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
while True:
m, d = map(int, input().split())
if m == d == 0: break
total = sum(dm[i] for i in range(m - 1)) + d - 1
print(dw[(total + 4) % 7]) | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s337660764 | p00027 | Accepted | day = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30]
for i in range(2,12):
day[i] += day[i-1]
week = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday']
while True:
M, D = map(int, input().split())
if M==0:
break
days = day[M-1] + D
print(week[days%7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s403192069 | p00027 | Accepted | lst = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
while True:
m, d = map(int, input().split())
if m == 0:
break
if m == 1 or m == 4 or m == 7:
print(lst[(d + 2) % 7])
elif m == 2 or m == 8:
print(lst[(d + 5) % 7])
elif m == 3 or m == 11:
print(lst[(d + 6) % 7])
elif m == 5:
print(lst[(d + 4) % 7])
elif m == 6:
print(lst[d % 7])
elif m == 9 or m == 12:
print(lst[(d + 1) % 7])
else:
print(lst[(d + 3) % 7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s168698356 | p00027 | Accepted | while 1:
m,d = map(int,input().split())
if m == 0:
break
w = ["Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"]
day = [0,31,60,91,121,152,182,213,244,274,305,335]
print(w[(day[m-1]+d)%7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s379003483 | p00027 | Accepted | #datetimeモジュールをインポートする
import datetime
#aとbが0になるまで処理を繰り返す
while True:
a,b = map(int,input().split())
if a == 0 and b == 0:break
#detetimeモジュールを使い、youbiに代入し、"strftime"を使い、曜日を取得する
youbi = datetime.datetime(2004,a,b)
print(youbi.strftime("%A"))
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s494225542 | p00027 | Accepted | from datetime import date
import calendar
while True:
m,d = map(int,(input().split()))
if m == 0 and d == 0:
break
x = date(2004,m,d).weekday()
print(["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"][x])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s667676530 | p00027 | Accepted | import sys
readline = sys.stdin.readline
write = sys.stdout.write
def convert(y, m, d):
if m <= 2:
m += 12
y -= 1
mjd = int(365.25*y) + (y//400) - (y//100) + int(30.59*(m-2)) + d - 678912
return mjd
youbi = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
]
def solve():
m, d = map(int, readline().split())
if m == 0:
return False
write("%s\n" % youbi[(convert(2004, m, d) - convert(2004, 1, 1) + 3) % 7])
return True
while solve():
...
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s599850053 | p00027 | Accepted | while True :
M, D = map(int, input().split())
if M == 0 and D == 0 :
break
else :
if M == 1 :
days = D
elif M == 2 :
days = 31 + D
elif M == 3 :
days = 31+29+D
elif M == 4 :
days = 31+29+31+D
elif M == 5 :
days = 31+29+31+30+D
elif M == 6 :
days = 31+29+31+30+31+D
elif M == 7 :
days = 31+29+31+30+31+30+D
elif M == 8 :
days = 31+29+31+30+31+30+31+D
elif M == 9 :
days = 31+29+31+30+31+30+31+31+D
elif M == 10 :
days = 31+29+31+30+31+30+31+31+30+D
elif M == 11 :
days = 31+29+31+30+31+30+31+31+30+31+D
elif M == 12 :
days = 31+29+31+30+31+30+31+31+30+31+30+D
youbi = days % 7
if youbi == 0 :
print("Wednesday")
elif youbi == 1 :
print("Thursday")
elif youbi == 2 :
print("Friday")
elif youbi == 3 :
print("Saturday")
elif youbi == 4 :
print("Sunday")
elif youbi == 5 :
print("Monday")
elif youbi == 6 :
print("Tuesday")
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s020202292 | p00027 | Accepted | from datetime import date
days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
while True:
month,day = map(int, input().split())
if month == 0:
break
print(days[date(2004, month, day).weekday()])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s926895937 | p00027 | Accepted | import datetime
yobi = {0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday"}
try:
while True:
m, d= map(int, input().split())
if m == 0 and d == 0 :
exit()
day = datetime.datetime.strptime("2004/" + str(m) + "/" + str(d),"%Y/%m/%d")
if day.weekday() in yobi:
output = yobi[int(day.weekday())]
print(output)
except EOFError:
pass
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s688038737 | p00027 | Accepted | month = [0,31,60,91,121,152,182,213,244,274,305,335]
day = ["Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"]
while True:
a,b = map(int,input().split())
if a == 0:
break
num = month[a-1]+b
print(day[num%7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s536492251 | p00027 | Accepted | # coding=utf-8
###
### for python program
###
import sys
import math
# math class
class mymath:
### pi
pi = 3.14159265358979323846264338
### Prime Number
def pnum_eratosthenes(self, n):
ptable = [0 for i in range(n+1)]
plist = []
for i in range(2, n+1):
if ptable[i]==0:
plist.append(i)
for j in range(i+i, n+1, i):
ptable[j] = 1
return plist
def pnum_check(self, n):
if (n==1):
return False
elif (n==2):
return True
else:
for x in range(2,n):
if(n % x==0):
return False
return True
### GCD
def gcd(self, a, b):
if b == 0:
return a
return self.gcd(b, a%b)
### LCM
def lcm(self, a, b):
return (a*b)//self.gcd(a,b)
### Mat Multiplication
def mul(self, A, B):
ans = []
for a in A:
c = 0
for j, row in enumerate(a):
c += row*B[j]
ans.append(c)
return ans
### intチェック
def is_integer(self, n):
try:
float(n)
except ValueError:
return False
else:
return float(n).is_integer()
### 幾何学問題用
def dist(self, A, B):
d = 0
for i in range(len(A)):
d += (A[i]-B[i])**2
d = d**(1/2)
return d
### 絶対値
def abs(self, n):
if n >= 0:
return n
else:
return -n
mymath = mymath()
### output class
class output:
### list
def list(self, l):
l = list(l)
#print(" ", end="")
for i, num in enumerate(l):
print(num, end="")
if i != len(l)-1:
print(" ", end="")
print()
output = output()
### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A.append(list(map(int,input().split())))
#for line in sys.stdin.readlines():
# x, y = [int(temp) for temp in line.split()]
#abc list
#abc = [chr(ord('a') + i) for i in range(26)]
### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")
def printA(A):
N = len(A)
for i, n in enumerate(A):
print(n, end='')
if i != N-1:
print(' ', end='')
print()
# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]
# ソート(代入する必要なし)
# N.sort()
# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)
def get_input():
N = []
while True:
try:
N.append(input())
#N.append(int(input()))
#N.append(float(input()))
#N.append([int(x) for x in input().split()])
except EOFError:
break
return N
M = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
A = ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"]
while True:
m, d = [int(x) for x in input().split()]
if m==0 and d==0:
break
B = (sum(M[:m])+d-1)%7
print(A[B])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s120495179 | p00027 | Accepted | import datetime
while 1:
m, d = map(int, input().split())
if m == 0:
break
dt = datetime.datetime(2004, m, d)
print(dt.strftime('%A'))
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s332454593 | p00027 | Accepted |
import datetime
L = [ "Monday", "Tuesday", "Wednesday", "Thursday","Friday",
"Saturday", "Sunday" ]
while True:
m, d = [int(x) for x in input().split()]
if m == 0 and d == 0:
break
dt = datetime.datetime(2004, m, d)
w = dt.weekday()
print(L[w])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s929259183 | p00027 | Accepted | while True:
month,day=list(map(int, input().split()))
if month==day==0:
break
month_day=[30,29,31,30,31,30,31,31,30,31,30,31] #1から12
tmp_day=0
for i in range(month-1):
tmp_day+=month_day[i]
tmp_day+=day
amari=tmp_day%7
if month==day==1:
print("Thursday")
elif amari==0:
print("Thursday")
elif amari==1:
print("Friday")
elif amari==2:
print("Saturday")
elif amari==3:
print("Sunday")
elif amari==4:
print("Monday")
elif amari==5:
print("Tuesday")
elif amari==6:
print("Wednesday")
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s675024853 | p00027 | Accepted | import sys
def zeller(y,m,d):
if m==1 or m==2:
y-=1
m+=12
day=(y+int(y/4)-int(y/100)+int(y/400)+int((13*m+8)/5)+d)%7
D={0:'Sunday',1:'Monday',2:'Tuesday',3:'Wednesday',4:'Thursday',5:'Friday',6:'Saturday'}
return D[day]
for l in sys.stdin:
m,d=list(map(int,l.split()))
if m==0:
break
print(zeller(2004,m,d))
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s158678501 | p00027 | Accepted | w = ["Wednesday", "Thursday", "Friday",
"Saturday", "Sunday", "Monday", "Tuesday"]
a = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
while 1:
m, d = map(int, input().split())
if m == 0:
break
s = 0
for i in range(m - 1):
s += a[i]
print(w[(s+d) % 7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s426669821 | p00027 | Accepted | import datetime
week=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
while True:
a,b=map(int, input().split())
if a == b == 0:
break
print(week[datetime.date(2004, a, b).weekday()])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s395213359 | p00027 | Accepted | W = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')
M = (31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
while True:
m, d = map(int, input().split())
if m == d == 0: break
total = sum(M[i] for i in range(m - 1)) + d - 1
print(W[(total + 4) % 7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s622149155 | p00027 | Accepted | 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])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s421201803 | p00027 | Accepted | import datetime
num2wd={0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday"}
while True:
m,d=[int(i) for i in input().split(" ")]
if m==0 and d==0:
break
date=datetime.datetime(2004,m,d)
print(num2wd[date.weekday()])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s449119927 | p00027 | Accepted | if __name__ == '__main__':
W = ["Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"]
Y = [31,29,31,30,31,30,31,31,30,31,30,31]
while True:
m,d = map(int,input().split())
if m == 0 and d == 0:
break
day = 0
for i in range(m-1):
day += Y[i]
day += d
ans = day % 7
print(W[ans-1])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s750884127 | p00027 | Accepted | m = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
d = ["Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday"]
while True:
a, b = map(int, input().split())
if a + b == 0:
break
mon = 0
for i in range(a):
mon += m[i]
day = mon + b
print(d[day % 7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s503069532 | p00027 | Accepted | month = [3, 1, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3]
while True:
m, d = map(int, input().split())
if m == 0:
break
piv = 3
for i in range(m-1):
piv += month[i]
piv += d
piv %= 7
if piv == 0:
print("Sunday")
elif piv == 1:
print("Monday")
elif piv == 2:
print("Tuesday")
elif piv == 3:
print("Wednesday")
elif piv == 4:
print("Thursday")
elif piv == 5:
print("Friday")
elif piv == 6:
print("Saturday")
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s605877756 | p00027 | Accepted | days = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday']
month = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30]
while True:
m, d = map(int, raw_input().split())
if m == 0: break
for i in range(0, m):
d += month[i]
print days[d%7]
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s369803871 | p00027 | Accepted | import datetime
while 1:
m,d=map(int,input().split())
if m==d==0:break
ans=datetime.datetime(2004, m, d)
print(ans.strftime('%A'))
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s782579081 | p00027 | Accepted | ndays = [31,29,31,30,31,30,31,31,30,31,30,31]
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
offset = 3
while(1):
m,d = [int(i) for i in input().split()]
if m == 0 and d == 0:
break
tot_d = sum(ndays[:m-1]) + d
print(days[(tot_d + offset - 1)%7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s638302539 | p00027 | Accepted | from datetime import *
wd_map = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
while True:
month, day = map(int, input().split())
if month == 0:
break
print(wd_map[date(2004, month, day).weekday()])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s748382095 | p00027 | Accepted | daylist = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
week = ["Wednesday", "Thursday", "Friday", "Saturday",
"Sunday", "Monday", "Tuesday"]
while(1):
m, d = map(int, input().split())
if m == 0:
break
day = 0
for i in range(m-1):
day += daylist[i]
day += d
w = week[day % 7]
print(w)
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s549332604 | p00027 | Accepted | lastDayofLastMonth = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]
dateList = ["Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday"]
inputData = []
while True:
inputData = list(map(int, input().split()))
if inputData[0]==0:
break
dd_date = lastDayofLastMonth[inputData[0]-1] + inputData[1]
print(dateList[dd_date%7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s377663846 | p00027 | Accepted | import datetime
import calendar
def trans(month, day, year=2004):
past = datetime.date(year, month, day)
result = calendar.day_name[past.weekday()]
return result
while True:
month, day = map(int, input().split())
if month == day == 0: break
print(trans(month, day))
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s580817880 | p00027 | Accepted | import datetime
import sys
i_weekday = { i:weekday for i, weekday in enumerate('Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split() ) }
while True:
M, D = map(int, input().split())
if M == 0:
sys.exit()
dt = datetime.datetime.strptime(f'2004-{M}-{D}', '%Y-%m-%d')
#print(dt)
print(i_weekday[ dt.weekday() ] )
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s826354420 | p00027 | Accepted | while(True):
m,d = map(int,input().split())
if m==0 and d==0:
break
dn = sum([[31,29,31,30,31,30,31,31,30,31,30,31][a] for a in range(m-1)]) + d-1
print(["Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"][dn%7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s861459003 | p00027 | Accepted | import datetime
while 1:
try:
m,d=map(int, input().split())
print(datetime.date(2004, m,d).strftime('%A'))
except:break
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s056862794 | p00027 | Accepted | def solve():
day = [
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
'Monday',
'Tuesday',
]
days_month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
days_total = []
for i in range(len(days_month)):
days_total.append(sum(days_month[0:i]))
while True:
mm, dd = map(int, input().split())
if mm == 0 and dd == 0:
break
numd = days_total[mm - 1]
total = numd + dd
idx = total % len(day)
print(day[idx])
if __name__ == "__main__":
solve()
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s333723146 | p00027 | Runtime Error | import datetime
weekdays = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
]
while True:
m, d = map(int, raw_input().strip().split(" "))
print weekdays[datetime.date(2004, m, d).weekday()] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s549130922 | p00027 | Runtime Error | 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',7:'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] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s252086882 | p00027 | Runtime Error | from datetime import date
while 1:
m,d=map(int,raw_input().split())
if m==0:break
print date(404,m,d).strftime("%A") | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s649854134 | p00027 | Runtime Error | 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) % 7 + 2]) | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s073075110 | p00027 | Runtime Error | week = {"1": "Thursday", "2": "Friday", "3": "Saturday", "4": "Sunday", "5": "Monday", "6": "Tuesday", "7": "Wednesday"}
month = {"1": 0, "2": 31, "3": 60, "4": 91, "5": 121, "6": 152, "7": 182, "8": 213, "9": 244, "10": 274, "11": 305, "12": 335}
m, d = input().split()
while m != "0":
days = month[m] + int(d)
print(week[str(days % 7)])
m, d = input().split() | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s470472164 | p00027 | Runtime Error | week = {1: "Thursday", 2: "Friday", 3: "Saturday", 4: "Sunday", 5: "Monday", 6: "Tuesday", 7: "Wednesday"}
month = {1: 0, 2: 31, 3: 60, 4: 91, 5: 121, 6: 152, 7: 182, 8: 213, 9: 244, 10: 274, 11: 305, 12: 335}
m, d = map(int, input().split())
while m:
days = month[m] + d
print(week[days % 7])
m, d = map(int, input().split()) | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s227799393 | p00027 | Runtime Error | week = {1: "Thursday", 2: "Friday", 3: "Saturday", 4: "Sunday", 5: "Monday", 6: "Tuesday", 7: "Wednesday"}
month = {1: 0, 2: 31, 3: 60, 4: 91, 5: 121, 6: 152, 7: 182, 8: 213, 9: 244, 10: 274, 11: 305, 12: 335}
while True:
m, d = map(int, input().split())
if m == 0:
break
days = month[m] + d
print(week[days % 7]) | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s190211638 | p00027 | Runtime Error | import sys
l = []
day = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
size = [31,29,31,30,31,30,31,31,30,31,30,31]
for input in sys.stdin:
l.append(input.split())
for i in range(0,len(l)):
for j in range(0,len(l[i])):
l[i][j] = int(l[i][j])
for i in range(0,len(l)):
temp = 0
if((l[i][0]-1) < 0 or (l[i][0]-1) > 11):
continue
if((l[i][0]-1) > 0):
for j in range(0,l[i][0]-1):
temp += size[j]
temp += l[i][1]
temp = temp - 1
temp = temp % 7
if(temp > 3):
temp -= 3
print day[temp+3]
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s821667514 | p00027 | Runtime Error | s = (0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30)
w = ("Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday")
while True:
m, d = map(int, input().split())
if m == 0:break
print(w[(d + sum(s[:m])) % 7])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s439653022 | p00027 | Runtime Error | day=['0','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
mou=[0,31,29,31,30,31,30,31,31,30,31,30,31]
while True:
try:
n,m=map(int,input().split())
except:
break
if n==0 and m==0:
break
count=0
for a in range(1,n+1):
if a==n :
count+=m
else:
count+=mou[a]
print(day[count%7+3])
| 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s032750763 | p00027 | Runtime Error |
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
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') | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s600862127 | p00027 | Runtime Error | #include <stdio.h>
const char WEEKDAYS[7][10] = {
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
"Sunday"
};
const int MONTHS_1ST_WEEKDAY[] = {
3, 6, 0, 3, 5, 1, 3, 6, 2, 4, 0, 2
};
int main() {
int month, day;
while (1) {
scanf(" %d %d", &month, &day);
if (month == 0 && day == 0)
break;
puts(WEEKDAYS[(MONTHS_1ST_WEEKDAY[month-1] + day - 1) % 7]);
}
return 0;
} | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s321278370 | p00027 | Runtime Error | ans ={}
for i in range(1,13):
if i%2 !=0:
ans[str(i)] = 31
else:
ans[str(i)] = 30
ans['2']=29
while True:
a,b=map(int,raw_input().split())
day =b
if a+b == 0: break;
if a == 1: day = b;
elif a == 2: day+=31
else:
for i in range(a):
if i ==0: pass;
day += ans[str(i)]
print ['Wednesday','Thurday','Friday',
'Saturday','Sunday','Monday',
'Tuesday'][day%7] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s326302604 | p00027 | Runtime Error |
nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:
m,d = map(int,raw_input().split(" "))
if m == 0:
break
nd = 0
for i in range(m):
nd += nm[i]
nd += d
n = nd%7
if n == 1:
print "Thursday"
elif n == 2:
print "Tryday"
elif n == 3:
print "Saturday"
elif n == 4:
print "Sunday"
elif n == 5:
print "Monday"
elif n == 6:
print "Tuesday"
elif n == 7:
print "Wednesday"
~ | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s608566709 | p00027 | Runtime Error | nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:
m,d = map(int,raw_input().split(" "))
if m == 0:
break
nd = 0
for i in range(m):
nd += nm[i]
nd += d
n = nd%7
if n == 1:
print "Thursday"
elif n == 2:
print "Tryday"
elif n == 3:
print "Saturday"
elif n == 4:
print "Sunday"
elif n == 5:
print "Monday"
elif n == 6:
print "Tuesday"
else:
print "Wednesday"
~
~
~
~ | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s655013966 | p00027 | Runtime Error | nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:
m,d = map(int,raw_input().split(" "))
if m == 0:
break
nd = 0
for i in range(m):
nd += nm[i]
nd += d
n = nd%7
if n == 1:
print "Thursday"
elif n == 2:
print "Friday"
elif n == 3:
print "Saturday"
elif n == 4:
print "Sunday"
elif n == 5:
print "Monday"
elif n == 6:
print "Tuesday"
else:
print "Wednesday"
~
~
~ | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s527616498 | p00027 | Runtime Error | nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:
m,d = map(int,raw_input().split(" "))
if m == 0:
break
else:
nd = 0
for i in range(m):
nd += nm[i]
nd += d
n = nd%7
if n == 1:
print "Thursday"
elif n == 2:
print "Friday"
elif n == 3:
print "Saturday"
elif n == 4:
print "Sunday"
elif n == 5:
print "Monday"
elif n == 6:
print "Tuesday"
else:
print "Wednesday"
~
~ | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s442086726 | p00027 | Runtime Error | while True:
m, d = map(int, raw_inpud().split())
if m == 0 and d == 0:
break | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s922785544 | p00027 | Runtime Error | y = [31,29,31,30,31,30,31,31,30,31,30,31]
dow = [0:"Monday", 1:"Thuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"]
while True:
m, d = map(int, raw_inpud().split())
if m == 0 and d == 0:
break
n = 0
for i in range(m):
n += y[i]
n -= (n[m]-d+1)
print dow[(n+3)%7] | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s222793806 | p00027 | Runtime Error | wd=["Mon","Tues","Wednes","Thurs","Fri","Satur","Sun"]
md=[0,31,29,31,30,31,30,31,31,30,31,30,31]
while 1:
m,d = map(int, raw_input().split())
if m==0: break
s = sum([md[i] for i in range(month)]) + day + 2
s = wd[s % 7]+"day"
print s | 1 1
2 29
0 0
| Thursday
Sunday
|
<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>
|
s188348978 | p00028 | Wrong Answer | dic={}
while True:
try:
n = int(raw_input())
if n not in dic:
dic[n] = 1
else:
dic[n] += 1
except:
break
mode = []
m = 0
for k,v in sorted(dic.items(),key = lambda x:x[1],reverse=True):
if m==0:
mode.append(k)
m +=1
if v == dic[mode[-1]] and k!=mode[-1]:
mode.append(k)
else:
break
for i in range(len(mode)):
print mode[i] | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s558836494 | p00028 | Wrong Answer | A=[]
while True:
try:
x=int(input())
A.append(x)
except EOFError:
break
num=[]
for i in range(10):
num.append((A.count(i),i))
num.sort(reverse=True)
mode_value=num[0][0]
B=[]
for i in num:
if i[0]==mode_value:
B.append(i[1])
B.reverse()
for i in B:
print(i) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s685964042 | p00028 | Wrong Answer | A=[]
while True:
try:
x=int(input())
A.append(x)
except EOFError:
break
num=[]
for i in range(10):
num.append((A.count(i),i))
num.sort(reverse=True)
mode_value=num[0][0]
B=[]
for i in num:
if i[0]==mode_value:
B.append(i[1])
B.sort()
for i in B:
print(i) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s359065847 | p00028 | Wrong Answer | a, md = [], []
c, mx = 1, 1
while True:
try:
a.append(int(input()))
except EOFError:
break
a = sorted(a)
print(a)
for i in range(0, len(a) - 1):
if a[i] == a[i + 1]:
c += 1
else:
c = 1
if mx < c:
mx = c
md = [a[i]]
elif mx == c:
md.append(a[i])
print('\n'.join(map(str, md))) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s805447382 | p00028 | Wrong Answer | a, md = [], []
c, mx = 1, 1
while True:
try:
a.append(int(input()))
except EOFError:
break
a = sorted(a)
print(a)
for i in range(0, len(a) - 1):
if a[i] == a[i + 1]:
c += 1
else:
c = 1
if mx < c:
mx = c
md = [a[i]]
elif mx == c:
md.append(a[i])
print('\n'.join(map(str, sorted(md)))) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s847627932 | p00028 | Wrong Answer | # -*- coding: utf-8 -*-
DICT = {k: 0 for k in range(0, 10)}
while True:
try:
n = int(input())
DICT[n] += 1
except:
break
tmp = None
for k, v in DICT.items():
if v != tmp:
break
print(k) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s444634735 | p00028 | Wrong Answer | # -*- coding: utf-8 -*-
DICT = {k: 0 for k in range(0, 10)}
def solve(d):
_max = max(d.values())
for k, v in d.items():
if _max == v:
print(k)
if __name__ == '__main__':
while True:
try:
n = int(input())
DICT[n] += 1
except:
break
solve(DICT) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s489414809 | p00028 | Wrong Answer | # -*- coding: utf-8 -*-
DICT = {k: 0 for k in range(0, 10)}
def solve(d):
l = []
_max = max(d.values())
for k, v in d.items():
if _max == v:
l.append(k)
print('\n'.join(str(e) for e in l), end='')
if __name__ == '__main__':
while True:
try:
n = int(input())
DICT[n] += 1
except:
break
solve(DICT) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s260607270 | p00028 | Wrong Answer | # -*- coding: utf-8 -*-
DICT = {k: 0 for k in range(1, 10)}
def solve(d):
l = []
_max = max(d.values())
for k, v in sorted(d.items()):
if _max == v:
l.append(k)
print('\n'.join(str(e) for e in l), end='')
if __name__ == '__main__':
while True:
try:
n = int(input())
DICT[n] += 1
except:
break
solve(DICT) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s361131119 | p00028 | Wrong Answer | numdict = dict()
while True:
try:
num = input()
if num not in numdict:
numdict[num] = 0
else:
numdict[num] += 1
except EOFError:
break
most = max(numdict.values())
for key in numdict:
if most == numdict[key]:
print(key) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s831635583 | p00028 | Wrong Answer | numdict = dict()
while True:
try:
num = input()
if num not in numdict:
numdict[num] = 0
else:
numdict[num] += 1
except EOFError:
break
most = max(numdict.values())
mostlist = list()
for key in numdict:
if most == numdict[key]:
mostlist.append(key)
mostlist.sort()
for item in mostlist:
print(item) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s310365486 | p00028 | Wrong Answer | import sys
from collections import Counter
if __name__ == '__main__':
# ??????????????\???
# data = [5, 6, 3, 5, 8, 7, 5, 3, 9, 7, 3, 4]
data = []
for line in sys.stdin:
data.append(int(line.strip()))
print(data)
# ?????????????¢????
c = Counter(data)
max_freq = c.most_common(1)[0][1] # ???????????????????????°????¨???¶
modes = []
for val, freq in c.most_common():
if freq != max_freq:
break
modes.append(val)
# ???????????¨???
modes.sort()
for i in modes:
print(i) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s202084603 | p00028 | Wrong Answer | import sys
from itertools import dropwhile
a = []
try:
for v in sys.stdin:
a.append(int(v))
except:
m = max([a.count(v) for v in set(a)])
next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m))) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s520491101 | p00028 | Wrong Answer | import sys
array = []
array2 = []
num = 0
for i in sys.stdin.readlines():
array.append(int(i))
for i in range(len(array)):
if i == 0:
a = 0
elif array.count(array[i]) > a:
num = array.count(array[i])
a = array.count(array[i])
for i in range(len(array)):
if array.count(array[i]) == num:
array2.append(array[i])
array2 = list(set(array2))
for i in range(len(array2)):
print(array2[i]) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s058063352 | p00028 | Wrong Answer | import sys
from collections import defaultdict
d = defaultdict(int)
for i in sys.stdin:
d[i] +=1
l = sorted([(k, v) for k, v in d.items()], key=lambda x:x[1], reverse=True)
print(l[0][0])
print(l[1][0]) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s721631912 | p00028 | Wrong Answer | import sys
from collections import defaultdict
d = defaultdict(int)
for i in sys.stdin:
d[i] +=1
m = max(v for v in d.values())
for _ in sorted([k for k, v in d.items() if v == m]):
print(_) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s119062356 | p00028 | Wrong Answer | memo, max_value = {}, 0
while True :
try :
temp = input()
if temp in memo : memo[temp] = memo[temp] + 1
else : memo[temp] = 1
if max_value < memo[temp] : max_value = memo[temp]
except : break
for result, value in memo.items() :
if max_value == value : print(result) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s382199903 | p00028 | Wrong Answer | memo, max_value = {}, 0
while True :
try :
temp = input()
if temp in memo : memo[temp] = memo[temp] + 1
else : memo[temp] = 1
if max_value < memo[temp] : max_value = memo[temp]
except : break
temp = []
for result, value in memo.items() :
if max_value == value : temp.append(result)
temp.sort()
for _ in temp : print(_) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s575971519 | p00028 | Wrong Answer | import sys
a = {}
ma = 0
m = []
for u in sys.stdin:
i = int(u)
if not (i in a):
a[i] = 1
else:
a[i] += 1
if ma <= a[i]:
if ma < i:
ma = a[i]
m.clear()
m.append(i)
m = sorted(m)
for k in m:
print(k) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s514135406 | p00028 | Wrong Answer | import sys
def ModeValue():
mode=[0 for i in range(0,101)]
try:
for n in sys.stdin:
mode[int(n)]+=1
except EOFError:
a=1
maxN=max(mode)
for i in mode:
if mode[i]>maxN:
print(i)
ModeValue() | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s316217887 | p00028 | Wrong Answer | import sys
def ModeValue():
mode=[0 for i in range(0,101)]
for n in sys.stdin:
mode[int(n)]+=1
maxN=max(mode)
for i in mode:
if mode[i]>maxN:
print(i)
ModeValue() | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s869944607 | p00028 | Wrong Answer | import sys
def ModeValue():
mode=[0 for i in range(0,101)]
for n in sys.stdin:
mode[int(n)]+=1
maxN=max(mode)
for i in mode:
if mode[i]==maxN:
print(i)
ModeValue() | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s610939819 | p00028 | Wrong Answer | # 0028
import collections
array = []
i = 0
while True:
try:
array.append(int(input()))
i += 1
except EOFError:
break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s779598811 | p00028 | Wrong Answer | # 0028
import collections
array = []
i = 0
while True:
try:
a = input()
array.append(int(a))
i += 1
except EOFError:
break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s451074816 | p00028 | Wrong Answer | # 0028
import collections
array = []
while True:
try:
a = input()
array.append(int(a))
except EOFError:
break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s925689619 | p00028 | Wrong Answer | # 0028
import collections
array = []
while True:
try:
a = input()
if a == '': break
array.append(int(a))
except EOFError:
break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s335373401 | p00028 | Wrong Answer | # 0028
array = []
while True:
try:
a = input()
if a == '': break
array.append(int(a))
except EOFError:
break
count = list(map(lambda a: array.count(a), set(array)))
modes = [array[i] for i, x in enumerate(count) if x == max(count)]
print(*sorted(modes), sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s810441606 | p00028 | Wrong Answer | # 0028
array = []
while True:
try:
a = input()
array.append(int(a))
except EOFError:
break
count = list(map(lambda a: array.count(a), set(array)))
modes = [array[i] for i, x in enumerate(count) if x == max(count)]
print(*sorted(modes), sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s569565248 | p00028 | Wrong Answer | # 0028
array = []
while True:
try:
a = input()
if a == '': break
array.append(int(a))
except EOFError:
break
count = list(map(lambda a: array.count(a), set(array)))
modes = list(array[i] for i, x in enumerate(count) if x == max(count))
print(*sorted(modes), sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s344728265 | p00028 | Wrong Answer | # 0028
array = []
while True:
try:
a = input()
array.append(int(a))
except EOFError:
break
s = set(array)
count= list(map(lambda a: array.count(a), s))
mx = max(count)
modes = list(array[i] for i, x in enumerate(count) if x == mx)
print(*sorted(modes), sep = '\n') | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s734074171 | p00028 | Wrong Answer | array = [0 for x in range(100)]
while True:
try:
n = input()
array[n-1] +=1
for i in range(len(array)):
if array[i] == max(array):
print i+1
except EOFError:break | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s423338480 | p00028 | Wrong Answer | import sys
l = []
c = list([0] * 100)
for i in sys.stdin.readlines():
c[int(i) - 1] += 1
m = max(c)
for i in xrange(c.count(m)):
i = c.index(m)
print i + 1
c.pop(i) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s901365666 | p00028 | Wrong Answer | import sys
m={}
for line in sys.stdin.readlines():
p=int(line.rstrip())
m.setdefault(p,0)
m[p]+=1
x=sorted(m.items(),key=lambda x:x[1],reverse=True)
print x[0][0]
n=0
for i in range(len(x)-1):
n=i
now=x[i][1]
next=x[i+1][1]
if now!=next: break
print x[n][0] | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s290003639 | p00028 | Wrong Answer | import sys
m={}
for line in sys.stdin.readlines():
p=int(line.rstrip())
m.setdefault(p,0)
m[p]+=1
x=sorted(m.items(),key=lambda x:x[1],reverse=True)
tmp=x[0][0]
x=[v for v,k in x if tmp == k]
x.sort()
for l in x:
print l | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s561616795 | p00028 | Accepted | lis=[0 for i in range(100)]
while True:
try:
N=int(input())
lis[N-1] +=1
except:
for j in range(100):
if lis[j]==max(lis):
print(j+1)
break
| 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s200129812 | p00028 | Accepted |
hist = [0 for i in range(100)]
l = []
while True:
try:
hist[input() - 1] += 1
except:
break;
for k in filter(lambda x: max(hist) == x[1], enumerate(hist)):
print k[0] + 1 | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s351632530 | p00028 | Accepted | count = [0] * 101
while(True):
try:
s = input()
count[s] += 1
except Exception:
break
maxCount = 0
for i in range(len(count)):
if(maxCount < count[i]):
maxCount = count[i]
for i in range(len(count)):
if(maxCount == count[i]):
print(i) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
s553942085 | p00028 | Accepted | count = [0] * 101
maxCount = 0
while(True):
try:
s = input()
count[s] += 1
if(maxCount < count[s]):
maxCount = count[s]
except Exception:
break
for i in range(len(count)):
if(maxCount == count[i]):
print(i) | 5
6
3
5
8
7
5
3
9
7
3
4
| 3
5
|
<h1>Mode Value</h1>
<p>
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently.
</p>
<H2>Input</H2>
<p>
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
</p>
<H2>Output</H2>
<p>
Print the mode values. If there are several mode values, print them in ascending order.
</p>
<H2>Sample Input</H2>
<pre>
5
6
3
5
8
7
5
3
9
7
3
4
</pre>
<H2>Output for the Sample Input</H2>
<pre>
3
5
</pre>
<p>
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.