message stringlengths 2 20.2k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 757 108k | cluster float64 4 4 | __index_level_0__ int64 1.51k 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In order to pass the entrance examination tomorrow, Taro has to study for T more hours.
Fortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).
... | instruction | 0 | 32,314 | 4 | 64,628 |
Yes | output | 1 | 32,314 | 4 | 64,629 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In order to pass the entrance examination tomorrow, Taro has to study for T more hours.
Fortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).
... | instruction | 0 | 32,315 | 4 | 64,630 |
No | output | 1 | 32,315 | 4 | 64,631 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In order to pass the entrance examination tomorrow, Taro has to study for T more hours.
Fortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).
... | instruction | 0 | 32,316 | 4 | 64,632 |
No | output | 1 | 32,316 | 4 | 64,633 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In order to pass the entrance examination tomorrow, Taro has to study for T more hours.
Fortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).
... | instruction | 0 | 32,317 | 4 | 64,634 |
No | output | 1 | 32,317 | 4 | 64,635 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,093 | 4 | 66,186 |
Tags: greedy
Correct Solution:
```
import configparser
import math
import sys
input = sys.stdin.readline
def main():
s = input().strip()
one = []
zero = []
adj = [[] for i in range(len(s))]
for i in range(len(s)):
if s[i] == '0':
if len(one) == 0:
zero.appen... | output | 1 | 33,093 | 4 | 66,187 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,094 | 4 | 66,188 |
Tags: greedy
Correct Solution:
```
life_log = input()
result = list()
def possible():
ones = 0
zeros = 0
for k in life_log:
if k == '0':
if ones > 0:
ones -= 1
zeros += 1
else:
zeros -= 1
ones += 1
if zeros < 0:
... | output | 1 | 33,094 | 4 | 66,189 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,095 | 4 | 66,190 |
Tags: greedy
Correct Solution:
```
import io,os
# input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
s = input()
n = len(s)
err = 0
f = []
l = [set(), set()]
cnt = 0
par = 0
for i in range(n):
if(s[i] == "0"):
if(len(l[0]) == 0):
l[1].add(cnt)
cnt+=1
f.append([])... | output | 1 | 33,095 | 4 | 66,191 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,096 | 4 | 66,192 |
Tags: greedy
Correct Solution:
```
#Code by Sounak, IIESTS
#------------------------------warmup----------------------------
import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
BUFSIZE... | output | 1 | 33,096 | 4 | 66,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,097 | 4 | 66,194 |
Tags: greedy
Correct Solution:
```
def solve(s):
lists = [[] for _ in range(len(s))]
cid = 0
waitSet = set()
doneSet = set()
zeros = set()
for i, c in enumerate(s):
i += 1
if c == '1':
if not doneSet and not zeros:
print(-1)
return
... | output | 1 | 33,097 | 4 | 66,195 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,098 | 4 | 66,196 |
Tags: greedy
Correct Solution:
```
s = input()
arr, zero, one = [], [], []
for i in range(len(s)):
if s[i] == '0':
if one:
idx = one.pop()
arr[idx].append(i + 1)
zero.append(idx)
else:
zero.append(len(arr))
arr.append([i + 1])
else:
... | output | 1 | 33,098 | 4 | 66,197 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,099 | 4 | 66,198 |
Tags: greedy
Correct Solution:
```
s = input()
zero = set() # 前面的一个以0结尾的串的索引
one = set() # 前面的一个以1结尾的串的索引
ans = [] # 结果的串
for i in range(0,len(s)):
if(s[i] == '0'):
if one:
k = one.pop()
zero.add(k)
ans[k].append(i+1)
else:
zero.add(len(ans))
... | output | 1 | 33,099 | 4 | 66,199 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it.... | instruction | 0 | 33,100 | 4 | 66,200 |
Tags: greedy
Correct Solution:
```
from collections import deque
l=input()
az=deque([])
z=deque([])
f=0
for i in range(len(l)):
if l[i]=='0':
if len(az)==0:
z.append([i+1])
else:
az[0].append(i+1)
z.append(az[0])
az.popleft()
else:
#print(... | output | 1 | 33,100 | 4 | 66,201 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,101 | 4 | 66,202 |
Yes | output | 1 | 33,101 | 4 | 66,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,102 | 4 | 66,204 |
Yes | output | 1 | 33,102 | 4 | 66,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,103 | 4 | 66,206 |
Yes | output | 1 | 33,103 | 4 | 66,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,104 | 4 | 66,208 |
Yes | output | 1 | 33,104 | 4 | 66,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,105 | 4 | 66,210 |
No | output | 1 | 33,105 | 4 | 66,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,106 | 4 | 66,212 |
No | output | 1 | 33,106 | 4 | 66,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,107 | 4 | 66,214 |
No | output | 1 | 33,107 | 4 | 66,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da... | instruction | 0 | 33,108 | 4 | 66,216 |
No | output | 1 | 33,108 | 4 | 66,217 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,162 | 4 | 68,324 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
import sys
import os
import math
from datetime import date
for s in sys.stdin:
y1, m1, d1, y2, m2, d2 = map(int, s.split())
if y1 == m1 == d1 == y2 == m2 == d2 == -1:
break
day1 = date(y1, m1, d1)
day2 = date(y2, m2, d2)
delta = day2 - day1... | output | 1 | 34,162 | 4 | 68,325 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,163 | 4 | 68,326 |
"Correct Solution:
```
# AOJ 0125 Day Count
# Python3 2018.6.18 bal4u
def ut2jd(year, month, day):
if month <= 2:
year -= 1
month += 12
s = 3 + year//4 - year//100 + year//400
s += 1720994 + year*365 + (month+1)*30 + (month+1)*3//5 + day;
return s
while True:
y1, m1, d1, y2, m2, d2 = list(map(int, input().sp... | output | 1 | 34,163 | 4 | 68,327 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,164 | 4 | 68,328 |
"Correct Solution:
```
import datetime
while True:
y1,m1,d1,y2,m2,d2=[int(i) for i in input().split(" ")]
if y1==-1:
break
d1=datetime.datetime(y1,m1,d1)
d2=datetime.datetime(y2,m2,d2)
print((d2-d1).days)
``` | output | 1 | 34,164 | 4 | 68,329 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,165 | 4 | 68,330 |
"Correct Solution:
```
import datetime
while 1:
y1,m1,d1,y2,m2,d2=map(int,input().split())
if y1==-1:break
d1 = datetime.date(y1, m1, d1)
d2 = datetime.date(y2, m2, d2)
print((d2-d1).days)
``` | output | 1 | 34,165 | 4 | 68,331 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,166 | 4 | 68,332 |
"Correct Solution:
```
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
while 1:
y1, m1, d1, y2, m2, d2 = map(int, input().split())
if y1 == -1:
break
print(convert(y2, m2, d2) - convert(y... | output | 1 | 34,166 | 4 | 68,333 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,167 | 4 | 68,334 |
"Correct Solution:
```
import datetime
while 1:
y1,m1,d1,y2,m2,d2 = (int(x) for x in input().split())
if y1 < 0:break
start = datetime.date(y1,m1,d1)
end = datetime.date(y2,m2,d2)
print((end - start).days)
``` | output | 1 | 34,167 | 4 | 68,335 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,168 | 4 | 68,336 |
"Correct Solution:
```
# Aizu Problem 00125: Day Count
#
import sys, math, os, datetime
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
for line in sys.stdin:
y1, m1, d1, y2, m2, d2 = [int(_) for _ in line.split()]
if y1 == m1 == d1 == y2 == m2 =... | output | 1 | 34,168 | 4 | 68,337 |
Provide a correct Python 3 solution for this coding contest problem.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included in the number of days, not date 2. Also, take the leap ye... | instruction | 0 | 34,169 | 4 | 68,338 |
"Correct Solution:
```
ans_list = []
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
while True:
y1, m1, d1, y2, m2, d2 = map(int, input().split())
if y1+y2+m1+m2+d1+d2 == -6:
break
else:
ans = 0
dis_m = m2 - m1
dis_y = y2 - y1
leap = 0
if dis_y == 0:
... | output | 1 | 34,169 | 4 | 68,339 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,170 | 4 | 68,340 |
Yes | output | 1 | 34,170 | 4 | 68,341 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,171 | 4 | 68,342 |
Yes | output | 1 | 34,171 | 4 | 68,343 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,172 | 4 | 68,344 |
Yes | output | 1 | 34,172 | 4 | 68,345 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,173 | 4 | 68,346 |
Yes | output | 1 | 34,173 | 4 | 68,347 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,174 | 4 | 68,348 |
No | output | 1 | 34,174 | 4 | 68,349 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,175 | 4 | 68,350 |
No | output | 1 | 34,175 | 4 | 68,351 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,176 | 4 | 68,352 |
No | output | 1 | 34,176 | 4 | 68,353 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the same as or earlier than date 2 (y2, m2, d2). Date 1 is included i... | instruction | 0 | 34,177 | 4 | 68,354 |
No | output | 1 | 34,177 | 4 | 68,355 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,724 | 4 | 69,448 |
Yes | output | 1 | 34,724 | 4 | 69,449 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,725 | 4 | 69,450 |
Yes | output | 1 | 34,725 | 4 | 69,451 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,726 | 4 | 69,452 |
Yes | output | 1 | 34,726 | 4 | 69,453 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,727 | 4 | 69,454 |
Yes | output | 1 | 34,727 | 4 | 69,455 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,728 | 4 | 69,456 |
No | output | 1 | 34,728 | 4 | 69,457 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,729 | 4 | 69,458 |
No | output | 1 | 34,729 | 4 | 69,459 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,730 | 4 | 69,460 |
No | output | 1 | 34,730 | 4 | 69,461 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alena has successfully passed the entrance exams to the university and is now looking forward to start studying.
One two-hour lesson at the Russian university is traditionally called a pair, it... | instruction | 0 | 34,731 | 4 | 69,462 |
No | output | 1 | 34,731 | 4 | 69,463 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was... | instruction | 0 | 34,766 | 4 | 69,532 |
Tags: implementation
Correct Solution:
```
cal = {i:j for i, j in zip('monday tuesday wednesday thursday friday saturday sunday'.split(), range(7))}
fst = cal[input()]
snd = cal[input()]
gre = {0, 2, 3}
print('YES' if (snd - fst) % 7 in gre else 'NO')
``` | output | 1 | 34,766 | 4 | 69,533 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was... | instruction | 0 | 34,767 | 4 | 69,534 |
Tags: implementation
Correct Solution:
```
d1=input()
d2=input()
if d1=='monday':
if d2=='monday' or d2=='wednesday' or d2=='thursday':
print('YES')
else:
print('NO')
if d1=='tuesday':
if d2=='tuesday' or d2=='thursday' or d2=='friday':
print('YES')
else:
print('NO')
if d1=='wednesday':
if ... | output | 1 | 34,767 | 4 | 69,535 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was... | instruction | 0 | 34,768 | 4 | 69,536 |
Tags: implementation
Correct Solution:
```
a=['su','mo','tu','we','th','fr','sa']
b=a.index(input()[:2])
c=a.index(input()[:2])
print('YES'if (c-b)%7 in[0,2,3]else'NO')
``` | output | 1 | 34,768 | 4 | 69,537 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was... | instruction | 0 | 34,769 | 4 | 69,538 |
Tags: implementation
Correct Solution:
```
week = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]
days = [31, 28, 31, 30, 31]
m1 = week.index(input())
m2 = week.index(input())
b = False
for i in days:
if (m1+i)%7 == m2:
b = True
break
if b:
print("YES")
else:
... | output | 1 | 34,769 | 4 | 69,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was... | instruction | 0 | 34,770 | 4 | 69,540 |
Tags: implementation
Correct Solution:
```
s=['monday','tuesday','wednesday','thursday','friday','saturday','sunday']
I=input
a=I()
print(['NO','YES'][I()in[s[(s.index(a)+i)%7]for i in (28,30,31)]])
``` | output | 1 | 34,770 | 4 | 69,541 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was... | instruction | 0 | 34,771 | 4 | 69,542 |
Tags: implementation
Correct Solution:
```
f = input()
s = input()
day = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
length = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
for i in range(11):
if day[(day.index(... | output | 1 | 34,771 | 4 | 69,543 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.