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 this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019. Integers M_1, D_1, M_2, and D_2 will be given as input. It is known that the date 2019-M_2-D_2 foll...
instruction
0
103,474
4
206,948
No
output
1
103,474
4
206,949
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,016
4
208,032
Tags: brute force, implementation, math Correct Solution: ``` row = input() n = int(row.split()[0]) m = int(row.split()[1]) rem = int(n/m) + int(n%m) x = int(n/m) while rem >= m: x = x + int(rem/m) rem = int(rem/m) + int(rem%m) print(n + x) ```
output
1
104,016
4
208,033
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,017
4
208,034
Tags: brute force, implementation, math Correct Solution: ``` n, m = map(int, input().split()) d = 0 i = 1 while n != 0: n -= 1 d += 1 if d == i * m: n += 1 i += 1 print(d) ```
output
1
104,017
4
208,035
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,018
4
208,036
Tags: brute force, implementation, math Correct Solution: ``` n, m = map(int, input().split()) count = 0 i = 1 while i*m <= n: i += 1 n += 1 while n > 0: count += 1 n -= 1 print(count) ```
output
1
104,018
4
208,037
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,019
4
208,038
Tags: brute force, implementation, math Correct Solution: ``` n,m = map(int,input().split(" ")) days=0 if n>=m: while n>=m: days+=(n-n%m) n=int(n/m)+int(n%m) days+=n else: days=n print(days) ```
output
1
104,019
4
208,039
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,020
4
208,040
Tags: brute force, implementation, math Correct Solution: ``` (n,m)=map(int,input().strip().split()) days=1 while n!=0: n-=1 if days%m==0: n+=1 days+=1 print(days-1) ```
output
1
104,020
4
208,041
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,021
4
208,042
Tags: brute force, implementation, math Correct Solution: ``` __author__ = 'Gamoool' import sys n,m = map(int,sys.stdin.readline().split()) u = n+ ((n-1)//(m-1)) print(u) ```
output
1
104,021
4
208,043
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,022
4
208,044
Tags: brute force, implementation, math Correct Solution: ``` n,m = map(int,input().split()) s,q = 0,0 i = 1 for i in range(1,n+1): s+=1 if i % m == 0: q+=1 while q!=0: i+=1 s+=1 q-=1 if s % m == 0: q+=1 print(s) ```
output
1
104,022
4
208,045
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers...
instruction
0
104,023
4
208,046
Tags: brute force, implementation, math Correct Solution: ``` n, m = map(int, input().split()) print(n + ~- n // ~- m) ```
output
1
104,023
4
208,047
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,024
4
208,048
Yes
output
1
104,024
4
208,049
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,025
4
208,050
Yes
output
1
104,025
4
208,051
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,026
4
208,052
Yes
output
1
104,026
4
208,053
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,027
4
208,054
Yes
output
1
104,027
4
208,055
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,028
4
208,056
No
output
1
104,028
4
208,057
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,029
4
208,058
No
output
1
104,029
4
208,059
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,030
4
208,060
No
output
1
104,030
4
208,061
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws ...
instruction
0
104,031
4
208,062
No
output
1
104,031
4
208,063
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Lengths are measures in Baden in inches and feet. To a length from centimeters it is enough to know that an inch equals three centimeters in Baden and one foot contains 12 inches. You are given...
instruction
0
104,531
4
209,062
Yes
output
1
104,531
4
209,063
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,116
4
210,232
"Correct Solution: ``` N=int(input()) from collections import defaultdict data=defaultdict(int) data[0]+=1 for d in map(int,input().split()): data[d]+=1 check=[[]] ans=1 for d in data.keys(): if data[d]>2: ans=0 break checkc=check.copy() if data[d]==2: if d==0 or d==12: ...
output
1
105,116
4
210,233
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,117
4
210,234
"Correct Solution: ``` #設定 import sys input = sys.stdin.buffer.readline from collections import defaultdict def getlist(): return list(map(int, input().split())) #処理内容 def main(): N = int(input()) D = getlist() if N >= 24: print(0) elif N >= 12: d = defaultdict(int) judge = "Yes" for i in D: d[i] += ...
output
1
105,117
4
210,235
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,118
4
210,236
"Correct Solution: ``` import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) import itertools N = int(input()) D = [int(x) for x in input().split()] counter = [1] + [0] * 12 for x in D: counter[x] += 1 bl = counter[0] > 1 or counter[12] > 1 or any(x >= 3 for x in counter) if bl: print(0) ...
output
1
105,118
4
210,237
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,119
4
210,238
"Correct Solution: ``` import itertools def calc(s): ret = 24 for i in range(1, len(s)): ret = min(ret, s[i] - s[i-1]) return ret def main(): N = int(input()) D = list(map(int, input().split())) if D.count(0) >= 1 or D.count(12) >= 2: print(0) return cnt = [0] * 1...
output
1
105,119
4
210,239
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,120
4
210,240
"Correct Solution: ``` import sys input = sys.stdin.readline n = int(input()) D = list(map(int,input().split())) # from random import randint # n = randint(1, 50) # D = [randint(0, 12) for i in range(n)] C = [0] * 13 C[0] = 1 for i in range(n): C[D[i]] += 1 if C[0] >= 2 or C[12] >=2: print(0) sys.exit() ...
output
1
105,120
4
210,241
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,121
4
210,242
"Correct Solution: ``` def solve(N, D): fill = [0] * 24 fill[0] = 1 left = False for i in range(N): if D[i] == 0: print(0) return 0 elif D[i] == 12: if fill[12] == 1: print(0) return 0 else: ...
output
1
105,121
4
210,243
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,122
4
210,244
"Correct Solution: ``` from collections import Counter N = int(input()) ds = list(map(int, input().split())) c = Counter(ds) cs = c.most_common() if N >= 24 or cs[0][1] >= 3 or 0 in c: print("0") exit() l = len(cs) k = 0 s = (1 << 0) + (1 << 24) while k < l and cs[k][1] == 2: s += (1 << cs[k][0]) + (1 << (24 - ...
output
1
105,122
4
210,245
Provide a correct Python 3 solution for this coding contest problem. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city and the i-th person's city was D_i hours. The time gap ...
instruction
0
105,123
4
210,246
"Correct Solution: ``` from collections import Counter, defaultdict import sys sys.setrecursionlimit(10 ** 5 + 10) # input = sys.stdin.readline from math import factorial import heapq, bisect import math import itertools import queue from collections import deque def main(): num = int(input()) data = list(m...
output
1
105,123
4
210,247
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,124
4
210,248
Yes
output
1
105,124
4
210,249
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,125
4
210,250
Yes
output
1
105,125
4
210,251
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,126
4
210,252
Yes
output
1
105,126
4
210,253
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,127
4
210,254
Yes
output
1
105,127
4
210,255
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,128
4
210,256
No
output
1
105,128
4
210,257
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,129
4
210,258
No
output
1
105,129
4
210,259
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,130
4
210,260
No
output
1
105,130
4
210,261
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi. Takahashi checked and found that the time gap (defined below) between the local times in his city...
instruction
0
105,131
4
210,262
No
output
1
105,131
4
210,263
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,648
4
211,296
Tags: constructive algorithms, greedy Correct Solution: ``` import sys d, sumTime = map(int, input().split()) A = [] B = [] sumA = 0 sumB = 0 for i in range(d): m, n = map(int, input().split()) A.append(m) B.append(n) sumA += m sumB += n if sumA > sumTime or sumB < sumTime: print("NO") sys...
output
1
105,648
4
211,297
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,649
4
211,298
Tags: constructive algorithms, greedy Correct Solution: ``` import os import sys debug = True if debug and os.path.exists("input.in"): input = open("input.in", "r").readline else: debug = False input = sys.stdin.readline def inp(): return (int(input())) def inlt(): return (list(map(int, input...
output
1
105,649
4
211,299
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,650
4
211,300
Tags: constructive algorithms, greedy Correct Solution: ``` d,hrs=[int(x) for x in input().split()] hrs1 = hrs a=[] for i in range (d): t=input().split() a.append(t) sum1=0 sum2 =0 for j in range (d): sum1=int(a[j][0])+sum1 sum2=int(a[j][1])+sum2 count=0 if (sum1<= hrs <= sum2): print("YES") ...
output
1
105,650
4
211,301
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,651
4
211,302
Tags: constructive algorithms, greedy Correct Solution: ``` d, t = input().split() d = int(d) t = int(t) minimum = 0 maximum = 0 min_list = [] max_list = [] ans = [] for i in range(d): mi, ma = input().split() mi = int(mi) ma = int(ma) min_list.append(mi) max_list.append(ma) minimum = minimum + ...
output
1
105,651
4
211,303
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,652
4
211,304
Tags: constructive algorithms, greedy Correct Solution: ``` d,sumtime = [int(i) for i in input().split()] time = [0]*d mintime,maxtime = 0,0 for i in range(d): time[i] = [int(i) for i in input().split()] mintime+=time[i][0] maxtime+=time[i][1] if sumtime<mintime or sumtime>maxtime: print('NO') else: ...
output
1
105,652
4
211,305
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,653
4
211,306
Tags: constructive algorithms, greedy Correct Solution: ``` d, sumTime = map(int, input().split()) a = [(tuple(map(int, input().split()))) for _ in range(d)] dp = [[False for _ in range(sumTime + 1)] for _ in range(d + 1)] dp[0][0] = True for day in range(1, d + 1): minTime, maxTime = a[day - 1] for time in ra...
output
1
105,653
4
211,307
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,654
4
211,308
Tags: constructive algorithms, greedy Correct Solution: ``` string = input().split(' ') d = int(string[0]) sumTime = int(string[1]) mins = [] maxs = [] for i in range(d): string = input().split(' ') mins.append(int(string[0])) maxs.append(int(string[1])) if not(sum(mins) <= sumTime <= sum(maxs)): pr...
output
1
105,654
4
211,309
Provide tags and a correct Python 3 solution for this coding contest problem. Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less...
instruction
0
105,655
4
211,310
Tags: constructive algorithms, greedy Correct Solution: ``` import math from collections import defaultdict ml=lambda:map(int,input().split()) ll=lambda:list(map(int,input().split())) ii=lambda:int(input()) ip=lambda:(input()) """========main code===============""" x,y=ml() mn=0 mx=0 lol=[] yo=[] for _ in range(x): ...
output
1
105,655
4
211,311
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,768
4
211,536
Tags: implementation, math Correct Solution: ``` m,n = map(int,input().split()) if m == 2: if n == 1: print(4) else: print(5) elif (m<=7 and m%2) or (m>7 and m%2 == 0): if n<=5: print(5) else: print(6) else: if n<=6: print(5) else: print(6) ```
output
1
105,768
4
211,537
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,769
4
211,538
Tags: implementation, math Correct Solution: ``` a=list(map(int,input().split())) dayinm=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] answ=(dayinm[a[0]-1]-(8-a[1])+6)//7+1 print(answ) ```
output
1
105,769
4
211,539
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,770
4
211,540
Tags: implementation, math Correct Solution: ``` month_day = [0,31,28,31,30,31,30,31,31,30,31,30,31] n,m = map(int,input().split(' ')) a = (m-1+month_day[n])//7 b = (m-1+month_day[n])%7 if b==0: print(a) else: print(a+1) ```
output
1
105,770
4
211,541
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,771
4
211,542
Tags: implementation, math Correct Solution: ``` import math m,d = [int(i) for i in input().split()] mon = [31,28,31,30,31,30,31,31,30,31,30,31] al = mon[m-1] weeks = math.ceil((al-(7-d+1))/7) + 1 print(weeks) ```
output
1
105,771
4
211,543
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,772
4
211,544
Tags: implementation, math Correct Solution: ``` def main() : a = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] n, k = map(int, input().split()) print(1 + (a[n-1] - (8 - k) + 6) // 7) return 0 main() ```
output
1
105,772
4
211,545
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,773
4
211,546
Tags: implementation, math Correct Solution: ``` X = list(map(int , input().split())) if X[0] in [1,3,5,7,8,10,12]: print(5 if X[1]<=5 else 6) exit() if X[0] in [11,9,6,4]: print(5 if X[1]<=6 else 6) exit() print(4 if X[1]==1 else 5) ```
output
1
105,773
4
211,547
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,774
4
211,548
Tags: implementation, math Correct Solution: ``` import sys def main(): m,d = map(int,sys.stdin.readline().split()) x = [31,28,31,30,31,30,31,31,30,31,30,31] y = x[m-1] + d-1 res = y/7 if res > int(res): res = int(res)+1 print(int(res)) main() ```
output
1
105,774
4
211,549
Provide tags and a correct Python 3 solution for this coding contest problem. Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exampl...
instruction
0
105,775
4
211,550
Tags: implementation, math Correct Solution: ``` n=input().split() k=int(n[0]) h=int(n[1]) if (k==1) or (k==3) or (k==5) or (k==7) or (k==8) or (k==10) or (k==12): if (h==6) or (h==7): print(6) else: print(5) if k==2: if h==1: print(4) else: print(5) if (k==4) or (k==6) o...
output
1
105,775
4
211,551