message
stringlengths
2
43.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
853
107k
cluster
float64
24
24
__index_level_0__
int64
1.71k
214k
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from the trip around the world and brought n coins. H...
instruction
0
64,106
24
128,212
Tags: math Correct Solution: ``` t = int(input()) while(t): a, b, c, n = map(int, input().strip().split()) final_coins = (a + b + c + n) / 3 if (a + b + c + n) % 3 == 0: if a > final_coins or b > final_coins or c > final_coins: print("NO") else: print("YES") else: print("NO") t -= 1 ```
output
1
64,106
24
128,213
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from the trip around the world and brought n coins. H...
instruction
0
64,107
24
128,214
Tags: math Correct Solution: ``` def main(): for _ in range(int(input())): a = list(map(int,input().split())) s = list(reversed(sorted(a[:3]))) n = a[3] need = 0 need += s[0] - s[1] need += s[0] - s[2] if need > n: print('NO') ...
output
1
64,107
24
128,215
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,108
24
128,216
Yes
output
1
64,108
24
128,217
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,109
24
128,218
Yes
output
1
64,109
24
128,219
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,110
24
128,220
Yes
output
1
64,110
24
128,221
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,111
24
128,222
Yes
output
1
64,111
24
128,223
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,112
24
128,224
No
output
1
64,112
24
128,225
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,113
24
128,226
No
output
1
64,113
24
128,227
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,114
24
128,228
No
output
1
64,114
24
128,229
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from th...
instruction
0
64,115
24
128,230
No
output
1
64,115
24
128,231
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,116
24
128,232
Tags: implementation Correct Solution: ``` t = int(input()) while t>0: t = t-1 # a,b,c = list(map(int,input().split())) # n = int(input()) a,b,x,y = map(int,input().split()) one = (y)*(a) two = (x)*(b) three = ((a-1)-(x+1) +1)*(b) four = ((b-1)-(y+1) +1)*(a) # print(one) # print(...
output
1
64,116
24
128,233
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,117
24
128,234
Tags: implementation Correct Solution: ``` t = int(input()) for _ in range(t): n,m,a,b = map(int,input().split()) print(max(max(a,n-a-1)*m,max(b,m-b-1)*n)) ```
output
1
64,117
24
128,235
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,118
24
128,236
Tags: implementation Correct Solution: ``` t = int(input()) for i in range(t): # a = int(input()) # b = int(input()) # x = int(input()) # y = int(input()) a, b, x, y = map(int, input().split()) x += 1 y += 1 row = max(a - x, x - 1) col = max(b - y, y - 1) result = max(row*b, a*c...
output
1
64,118
24
128,237
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,119
24
128,238
Tags: implementation Correct Solution: ``` import sys import math from collections import defaultdict from collections import deque from itertools import combinations from itertools import permutations input = lambda : sys.stdin.readline().rstrip() read = lambda : list(map(int, input().split())) go = lambda : 1/0 def w...
output
1
64,119
24
128,239
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,120
24
128,240
Tags: implementation Correct Solution: ``` import math t=int(input()) for g in range(0,t): abxy=list(map(int,input().split())) a=abxy[0] b=abxy[1] x=abxy[2] y=abxy[3] arr=[] arr.append(a*y) arr.append(a*(b-y-1)) arr.append(b*x) arr.append(b*(a-x-1)) print(max(arr)) ...
output
1
64,120
24
128,241
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,121
24
128,242
Tags: implementation Correct Solution: ``` for _ in range(int(input())): a,b,x,y=map(int,input().split()) print(max(b*max(x,a-x-1),a*max(y,b-y-1))) ```
output
1
64,121
24
128,243
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,122
24
128,244
Tags: implementation Correct Solution: ``` t=int(input()) for _ in range(t): a,b,x,y=[int(s) for s in input().split()] r1=b*x r2=a*y r3=(a-x-1)*b r4=(b-y-1)*a print(max(r1,r2,r3,r4)) ```
output
1
64,122
24
128,245
Provide tags and a correct Python 3 solution for this coding contest problem. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixels to be numbered from 0 to a-1, and rows β€” from...
instruction
0
64,123
24
128,246
Tags: implementation Correct Solution: ``` from collections import defaultdict, Counter def getlist(): return list(map(int, input().split())) def maplist(): return map(int, input().split()) def main(): t = int(input()) for num in range(t): a,b,x,y = map(int, input().split()) if x>=...
output
1
64,123
24
128,247
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,124
24
128,248
Yes
output
1
64,124
24
128,249
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,125
24
128,250
Yes
output
1
64,125
24
128,251
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,126
24
128,252
Yes
output
1
64,126
24
128,253
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,127
24
128,254
Yes
output
1
64,127
24
128,255
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,128
24
128,256
No
output
1
64,128
24
128,257
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,129
24
128,258
No
output
1
64,129
24
128,259
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,130
24
128,260
No
output
1
64,130
24
128,261
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Screen resolution of Polycarp's monitor is a Γ— b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y) (0 ≀ x < a, 0 ≀ y < b). You can consider columns of pixel...
instruction
0
64,131
24
128,262
No
output
1
64,131
24
128,263
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,297
24
130,594
Tags: constructive algorithms, implementation Correct Solution: ``` # _ ##################################################################################################################### def fileNamePattern(nNamesToDelete, name_sLength, namesToDelete, namesWithSimilarLength): nNamesToTest = len(namesWithSimilar...
output
1
65,297
24
130,595
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,298
24
130,596
Tags: constructive algorithms, implementation Correct Solution: ``` n, m = map(int,input().split()) w = [input() for _ in range(n)] todel = [w[i-1] for i in map(int, input().split())] if len(set(map(len,todel))) != 1: print('No') else: pat = ''.join(['?' if len(set([todel[j][p] for j in range(m)])) != 1 else to...
output
1
65,298
24
130,597
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,299
24
130,598
Tags: constructive algorithms, implementation Correct Solution: ``` import sys n, m = map(int, input().split()) file_name_list = [] for _ in range(n): file_name_list.append(input()) file_pos_to_delete = list(map(int, input().split())) file_to_delete_list = [file_name_list[pos - 1] for pos in file_pos_to_delete] ...
output
1
65,299
24
130,599
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,300
24
130,600
Tags: constructive algorithms, implementation Correct Solution: ``` m,n=list(map(int,input().split())) s=[input().strip() for i in range(m)] a=list(map(lambda x:int(x)-1,input().split())) stmpl=s[a[0]] f=1 def peres(s1,s2): return ''.join([i if i==j else '?' for i,j in zip(s1,s2)]) for i in a: if len(stmpl)!=len(s[i]...
output
1
65,300
24
130,601
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,301
24
130,602
Tags: constructive algorithms, implementation Correct Solution: ``` n = int(input().split()[0]) all_files = [str(input()) for i in range(n)] index_to_del = [int(i) - 1 for i in (input().split())] def find_pattern(all_files, index_to_del): for i in index_to_del[1:]: if len(all_files[i]) != len(all_files[i...
output
1
65,301
24
130,603
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,302
24
130,604
Tags: constructive algorithms, implementation Correct Solution: ``` """ Oh, Grantors of Dark Disgrace, Do Not Wake Me Again. """ import sys ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) si = lambda: input() n, m = mi() f = [] for i in range(n): f.append(si()) lm = li...
output
1
65,302
24
130,605
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,303
24
130,606
Tags: constructive algorithms, implementation Correct Solution: ``` n, m = map(int, input().split()) f = [input() for _ in range(n)] d = set(map(int, input().split())) c = {} l = 0 for x in d: l = len(f[x - 1]) c[l] = 1 if len(c) > 1: print('No') else: t = ['?'] * l for i in range(l): c = {} ch = '' ...
output
1
65,303
24
130,607
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with file...
instruction
0
65,304
24
130,608
Tags: constructive algorithms, implementation Correct Solution: ``` import sys import re [words, selected] = input().split(" ") [words, selected] = [int(words), int(selected)] wordBuffer = [] selectedWords = [] for i in range(words): wordBuffer.append(input()) buffer = input().split(" ") for i in buffer: sele...
output
1
65,304
24
130,609
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,305
24
130,610
Yes
output
1
65,305
24
130,611
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,306
24
130,612
Yes
output
1
65,306
24
130,613
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,307
24
130,614
Yes
output
1
65,307
24
130,615
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,308
24
130,616
Yes
output
1
65,308
24
130,617
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,309
24
130,618
No
output
1
65,309
24
130,619
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,310
24
130,620
No
output
1
65,310
24
130,621
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,311
24
130,622
No
output
1
65,311
24
130,623
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp is a beginner programmer. He is studying how to use a command line. Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp...
instruction
0
65,312
24
130,624
No
output
1
65,312
24
130,625
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,329
24
130,658
Tags: *special, binary search Correct Solution: ``` n, k = map(int, input().split()) s = input() l, r = int(-1), int(n) while r - l > 1: m = (l+r)//2 c, p = 1, 0 cond = True while p < n and c < k: i = p + m + 1 while i >= p and (i >= n or s[i] == '1'): i = i - 1; if ...
output
1
65,329
24
130,659
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,330
24
130,660
Tags: *special, binary search Correct Solution: ``` import sys from math import * from fractions import gcd from random import * # randint(inclusive,inclusive) readints=lambda:map(int, input().strip('\n').split()) from itertools import permutations, combinations s = "abcdefghijklmnopqrstuvwxyz" # print('', end=" ") # f...
output
1
65,330
24
130,661
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,331
24
130,662
Tags: *special, binary search Correct Solution: ``` def check(p): cur = k - 2 p+=1 lastfree = 0 lasteat = 0 for i in range(1, n-1): if tm[i] == '0': lastfree = i if i - lasteat >= p: if lasteat == lastfree or cur <= 0: return False ...
output
1
65,331
24
130,663
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,332
24
130,664
Tags: *special, binary search Correct Solution: ``` from sys import exit n=0 k=0 s="" for i in input().split(): if n==0: n=int(i) else: k=int(i) s=str(input()) node=[] for i in range(len(s)): if s[int(i)]=='0': node.append(i+1) node.append(1000000000) def check(dis): current=0 ...
output
1
65,332
24
130,665
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,333
24
130,666
Tags: *special, binary search Correct Solution: ``` import sys from math import * from fractions import gcd from random import * # randint(inclusive,inclusive) readints=lambda:map(int, input().strip('\n').split()) from itertools import permutations, combinations s = "abcdefghijklmnopqrstuvwxyz" # print('', end=" ") # f...
output
1
65,333
24
130,667
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,334
24
130,668
Tags: *special, binary search Correct Solution: ``` import sys from math import * from fractions import gcd from random import * # randint(inclusive,inclusive) readints=lambda:map(int, input().strip('\n').split()) from itertools import permutations, combinations s = "abcdefghijklmnopqrstuvwxyz" # print('', end=" ") # f...
output
1
65,334
24
130,669
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,335
24
130,670
Tags: *special, binary search Correct Solution: ``` import sys from math import * from fractions import gcd from random import * # randint(inclusive,inclusive) readints=lambda:map(int, input().strip('\n').split()) from itertools import permutations, combinations s = "abcdefghijklmnopqrstuvwxyz" # print('', end=" ") # f...
output
1
65,335
24
130,671
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday. In some minutes of the workday Polycarp has important things to do and in such...
instruction
0
65,336
24
130,672
Tags: *special, binary search Correct Solution: ``` def ok(x, k, s, n): i = 0 k-=1 while i < len(s): if(i + x + 1 >= len(s)): k -= 1 #print(len(s) - 1) break j = n[i + x + 1] if(j == i): return 0 i = j #print(i)...
output
1
65,336
24
130,673