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
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,772
4
69,544
Tags: implementation Correct Solution: ``` day=["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] a=day.index(str(input())) b=day.index(str(input())) ans="NO" if (b-a)%7 in [3,0,2]: ans="YES" print(ans) ```
output
1
34,772
4
69,545
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,773
4
69,546
Tags: implementation Correct Solution: ``` s1=input() s2=input() if s1==s2: print("YES") else: d={"monday":1,"tuesday":2,"wednesday":3,"thursday":4,"friday":5,"saturday":6,"sunday":7} if d[s2]>d[s1]: x=d[s2]-d[s1] else: x=7-d[s1]+d[s2] # print(d[s1],d[s2],x) if x==2 or x==3: ...
output
1
34,773
4
69,547
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,774
4
69,548
Yes
output
1
34,774
4
69,549
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,775
4
69,550
Yes
output
1
34,775
4
69,551
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,776
4
69,552
Yes
output
1
34,776
4
69,553
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,777
4
69,554
Yes
output
1
34,777
4
69,555
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,778
4
69,556
No
output
1
34,778
4
69,557
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,779
4
69,558
No
output
1
34,779
4
69,559
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,780
4
69,560
No
output
1
34,780
4
69,561
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 g...
instruction
0
34,781
4
69,562
No
output
1
34,781
4
69,563
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,806
4
73,612
"Correct Solution: ``` n = float(input()) m = n * 2 hour = int(m // 60) minutes = int(m % 60) print(hour, minutes) ```
output
1
36,806
4
73,613
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,807
4
73,614
"Correct Solution: ``` print((lambda x:'{} {}'.format(x//30,(x%30)*2))(int(input()))) ```
output
1
36,807
4
73,615
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,808
4
73,616
"Correct Solution: ``` n = int(input()) print(str(2*n//60) + " " + str((2*n)%60)) ```
output
1
36,808
4
73,617
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,809
4
73,618
"Correct Solution: ``` d=int(input());print(d//30,d%30*2) ```
output
1
36,809
4
73,619
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,810
4
73,620
"Correct Solution: ``` theta = int(input()) print(theta//30, (theta%30)*2) ```
output
1
36,810
4
73,621
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,811
4
73,622
"Correct Solution: ``` num = int(input()) #標準入力 print(str(num // 30) + " " + str(num % 30 * 2)) #時間(入力値を30で割った商)と分(入力値を30で割った余り)を出力する ```
output
1
36,811
4
73,623
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,812
4
73,624
"Correct Solution: ``` # -*- coding: utf-8 -*- from sys import stdin n = int(stdin.readline().rstrip()) h = n * 2 // 60 m = n * 2 % 60 print("{} {}".format(h,m)) ```
output
1
36,812
4
73,625
Provide a correct Python 3 solution for this coding contest problem. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only the short hand. Output the time (hour h, minute m) for ...
instruction
0
36,813
4
73,626
"Correct Solution: ``` s = int(input()) print(s // 30, 2 * (s % 30)) ```
output
1
36,813
4
73,627
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only ...
instruction
0
36,814
4
73,628
Yes
output
1
36,814
4
73,629
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only ...
instruction
0
36,815
4
73,630
Yes
output
1
36,815
4
73,631
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only ...
instruction
0
36,816
4
73,632
Yes
output
1
36,816
4
73,633
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Problem Gaccho has his favorite watch. One day the minute hand of the clock came off and I lost it somewhere. However, Gaccho wants to keep using the watch and wants to read the time with only ...
instruction
0
36,817
4
73,634
Yes
output
1
36,817
4
73,635
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,351
4
74,702
Yes
output
1
37,351
4
74,703
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,352
4
74,704
Yes
output
1
37,352
4
74,705
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,353
4
74,706
Yes
output
1
37,353
4
74,707
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,354
4
74,708
Yes
output
1
37,354
4
74,709
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,355
4
74,710
No
output
1
37,355
4
74,711
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,356
4
74,712
No
output
1
37,356
4
74,713
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,357
4
74,714
No
output
1
37,357
4
74,715
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the pass...
instruction
0
37,358
4
74,716
No
output
1
37,358
4
74,717
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,500
4
77,000
"Correct Solution: ``` l=int(input()) a=int(input()) b=int(input()) c=int(input()) d=int(input()) if a%c==0 or b%d==0: if a/c>=b/d: print(l-(a//c)) else: print(l-(b//d)) else: x=(a//c)+1 y=(b//d)+1 if x>=y: print(l-x) else: print(l-y) ```
output
1
38,500
4
77,001
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,501
4
77,002
"Correct Solution: ``` l = int(input()) a = int(input()) b = int(input()) c = int(input()) d = int(input()) if a % c == 0: kokugo = a // c else: kokugo = a // c + 1 if b % d == 0: sansu = b // d else: sansu = b // d + 1 print(l - max(kokugo, sansu)) ```
output
1
38,501
4
77,003
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,502
4
77,004
"Correct Solution: ``` import math l=int(input()) a=int(input()) b=int(input()) c=int(input()) d=int(input()) print(l-max(math.ceil(a/c),math.ceil(b/d))) ```
output
1
38,502
4
77,005
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,503
4
77,006
"Correct Solution: ``` import math def main(): L = int(input()) A = int(input()) B = int(input()) C = int(input()) D = int(input()) hoge = math.ceil(A / C) fuga = math.ceil(B / D) if hoge >= fuga: print(L - hoge) else: print(L - fuga) if __name__ == "__main__": ...
output
1
38,503
4
77,007
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,504
4
77,008
"Correct Solution: ``` # -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0576 """ import sys from sys import stdin from math import ceil input = stdin.readline def main(args): L = int(input()) A = int(input()) B = int(input()) C = int(input()) D = int(input()) ...
output
1
38,504
4
77,009
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,505
4
77,010
"Correct Solution: ``` # coding: utf-8 # Your code here! L=int(input()) A=int(input()) B=int(input()) C=int(input()) D=int(input()) if A%C==0 and B%D==0: X=A//C Y=B//D X,Y=sorted([X,Y]) print(L-Y) elif A%C==0 and B%D!=0: X=A//C Y=(B//D)+1 X,Y=sorted([X,Y]) print(L-Y) elif A%C!=0 and B%...
output
1
38,505
4
77,011
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,506
4
77,012
"Correct Solution: ``` L = int(input()) A = int(input()) B = int(input()) C = int(input()) D = int(input()) day_k = 0 day_s = 0 if A % C == 0: day_k = A // C else: day_k = A // C + 1 if B % D == 0: day_s = B // D else: day_s = B // D + 1 print(L - max(day_k, day_s)) ```
output
1
38,506
4
77,013
Provide a correct Python 3 solution for this coding contest problem. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a national language drill on page A and a math drill on page ...
instruction
0
38,507
4
77,014
"Correct Solution: ``` L,A,B,C,D = [int(input()) for _ in range(5)] print(L - max((A - 1) // C,(B - 1) // D) - 1) ```
output
1
38,507
4
77,015
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a nat...
instruction
0
38,508
4
77,016
Yes
output
1
38,508
4
77,017
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a nat...
instruction
0
38,509
4
77,018
Yes
output
1
38,509
4
77,019
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a nat...
instruction
0
38,510
4
77,020
Yes
output
1
38,510
4
77,021
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a nat...
instruction
0
38,511
4
77,022
Yes
output
1
38,511
4
77,023
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a nat...
instruction
0
38,512
4
77,024
No
output
1
38,512
4
77,025
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem JOI, who has been suffering from his winter vacation homework every time, decided to do his homework systematically this time. Homework is a national language and math drill, with a nat...
instruction
0
38,513
4
77,026
No
output
1
38,513
4
77,027
Provide a correct Python 3 solution for this coding contest problem. As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan. The other calendar system is era-based calendar, o...
instruction
0
38,540
4
77,080
"Correct Solution: ``` from bisect import bisect_left while True: N, Q = map(int, input().split(' ')) if N == 0: break era = {} # Like {1877: ('Meiji', 10)} years = [] # 西暦 for _ in range(N): name, j, w = input().split(' ') j, w = int(j), int(w) era[w] = (name, j) years.append(w) years.sort() for ...
output
1
38,540
4
77,081
Provide a correct Python 3 solution for this coding contest problem. As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan. The other calendar system is era-based calendar, o...
instruction
0
38,541
4
77,082
"Correct Solution: ``` while 1: n,m=map(int,input().split()) if n==0:break e=['']*n;b=['']*n;w=['']*n for i in range(n):e[i],b[i],w[i]=input().split() b=list(map(int,b));w=list(map(int,w)) for _ in range(m): q=int(input()) for i in range(n): if w[i]-b[i]<q<=w[i]:print...
output
1
38,541
4
77,083
Provide a correct Python 3 solution for this coding contest problem. As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan. The other calendar system is era-based calendar, o...
instruction
0
38,542
4
77,084
"Correct Solution: ``` import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 998244353 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.rea...
output
1
38,542
4
77,085
Provide a correct Python 3 solution for this coding contest problem. As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan. The other calendar system is era-based calendar, o...
instruction
0
38,543
4
77,086
"Correct Solution: ``` import bisect while True: N,Q = map(int,input().split()) if N == 0: break src = [] for i in range(N): n,l,y = input().split() src.append((int(y), int(l), n)) src.sort() for i in range(Q): q = int(input()) a = bisect.bisect(src,(q,-1,-1)) ...
output
1
38,543
4
77,087
Provide a correct Python 3 solution for this coding contest problem. As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan. The other calendar system is era-based calendar, o...
instruction
0
38,544
4
77,088
"Correct Solution: ``` while True: inp,oup=map(int,input().split()) if not inp: break dic={} for i in range(inp): era,num,wes=input().split() dic[era] =[int(wes)-int(num)+1, int(wes)] for j in range(oup): p=int(input()) for i in dic: if dic[i][0]<...
output
1
38,544
4
77,089
Provide a correct Python 3 solution for this coding contest problem. As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan. The other calendar system is era-based calendar, o...
instruction
0
38,545
4
77,090
"Correct Solution: ``` while True: n,m= map(int,input().split()) if n==0 and m==0: break hajime= {} owari= {} for _ in range(n): a,b,c= input().split() hajime[a]= int(c)- int(b) owari[a]= int(c) for _ in range(m): year= int(input()) for a in hajim...
output
1
38,545
4
77,091