message stringlengths 2 59.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 37 108k | cluster float64 20 20 | __index_level_0__ int64 74 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,825 | 20 | 3,650 |
Yes | output | 1 | 1,825 | 20 | 3,651 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,826 | 20 | 3,652 |
Yes | output | 1 | 1,826 | 20 | 3,653 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,827 | 20 | 3,654 |
Yes | output | 1 | 1,827 | 20 | 3,655 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,828 | 20 | 3,656 |
Yes | output | 1 | 1,828 | 20 | 3,657 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,829 | 20 | 3,658 |
No | output | 1 | 1,829 | 20 | 3,659 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,830 | 20 | 3,660 |
No | output | 1 | 1,830 | 20 | 3,661 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,831 | 20 | 3,662 |
No | output | 1 | 1,831 | 20 | 3,663 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let f(x) be the sum of digits of a decimal number x.
Find the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.
Input
The first line contains one integer t (1 β€ ... | instruction | 0 | 1,832 | 20 | 3,664 |
No | output | 1 | 1,832 | 20 | 3,665 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera has array a, consisting of n integers a0, a1, ..., an - 1, and function f(x), taking an integer from 0 to 2n - 1 as its single argument. Value f(x) is calculated by formula <image>, where value bit(i) equals one if the binary represen... | instruction | 0 | 1,945 | 20 | 3,890 |
Tags: implementation, math, number theory
Correct Solution:
```
import sys
class DFSHelper:
mxNum = 0
d = DFSHelper()
def backTrack(maxval, curval, binPos, maxBinPos, arr, total):
if binPos > maxBinPos:
if maxval >= curval:
d.mxNum = max(d.mxNum, total)
return
# Try 1
... | output | 1 | 1,945 | 20 | 3,891 |
Provide tags and a correct Python 3 solution for this coding contest problem.
C*++ language is quite similar to C++. The similarity manifests itself in the fact that the programs written in C*++ sometimes behave unpredictably and lead to absolutely unexpected effects. For example, let's imagine an arithmetic expressio... | instruction | 0 | 1,959 | 20 | 3,918 |
Tags: expression parsing, greedy
Correct Solution:
```
import re
class Term:
def __init__(self, factor, type):
self.factor = factor
self.type = type
def __str__(self):
return '(%d * %s)' % (self.factor, self.type)
a = int(input())
s = '+' + input().strip()
terms = []
pos = 0
while pos != len(s):
sig... | output | 1 | 1,959 | 20 | 3,919 |
Provide tags and a correct Python 3 solution for this coding contest problem.
C*++ language is quite similar to C++. The similarity manifests itself in the fact that the programs written in C*++ sometimes behave unpredictably and lead to absolutely unexpected effects. For example, let's imagine an arithmetic expressio... | instruction | 0 | 1,960 | 20 | 3,920 |
Tags: expression parsing, greedy
Correct Solution:
```
import re
u = int
G = input
X = sorted
y = print
A = re.findall
a = u(G())
b = X([[u((i[0]or '+')+(i[1]or '1')), i[3]]
for i in A('(\+|-)?(\d{0,4})(\*)?(a\+\+|\+\+a)', G())])
z = 0
for i in b:
if i[1] == 'a++':
z += i[0]*a
else:
z +=... | output | 1 | 1,960 | 20 | 3,921 |
Provide tags and a correct Python 3 solution for this coding contest problem.
C*++ language is quite similar to C++. The similarity manifests itself in the fact that the programs written in C*++ sometimes behave unpredictably and lead to absolutely unexpected effects. For example, let's imagine an arithmetic expressio... | instruction | 0 | 1,961 | 20 | 3,922 |
Tags: expression parsing, greedy
Correct Solution:
```
import re
n = int(input())
v = input()
f1, f2 = v.count('a++'), v.count('++a')
s = []
i = 0
while i < len(v) - 2:
if v[i] + v[i + 1] + v[i + 2] == '++a':
s.append('b')
i += 3
elif v[i] + v[i + 1] + v[i + 2] == 'a++':
s.append('a')
i += 3
else:
if i ==... | output | 1 | 1,961 | 20 | 3,923 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,507 | 20 | 5,014 |
Tags: games, greedy, implementation
Correct Solution:
```
n = int(input())
l = list(map(int,list(input())))
diff = n-11
if(l[0:diff+1].count(8)>diff//2):
print("YES")
else:
print("NO")
``` | output | 1 | 2,507 | 20 | 5,015 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,508 | 20 | 5,016 |
Tags: games, greedy, implementation
Correct Solution:
```
n = int(input().strip())
s = input().strip()
n = len(s)
eights = s[:-10].count('8')
if eights == 0:
print('NO')
else:
extras = n-10-eights
if extras > eights:
print('NO')
else:
print('YES')
``` | output | 1 | 2,508 | 20 | 5,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,509 | 20 | 5,018 |
Tags: games, greedy, implementation
Correct Solution:
```
n = int(input())
s = input()
r = n - 11
if s[:r+1].count('8') > (r+1)//2:
print('YES')
else:
print('NO')
``` | output | 1 | 2,509 | 20 | 5,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,510 | 20 | 5,020 |
Tags: games, greedy, implementation
Correct Solution:
```
n = int(input())
s = input()
x = (n-11)//2
a = s.count('8')
if a<=x:
print('NO')
else:
res=[]
for i,y in enumerate(s):
if y=='8':
res.append(i)
e=0
for i in range(x+1):
if res[i]-e>x:
print('NO')
... | output | 1 | 2,510 | 20 | 5,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,511 | 20 | 5,022 |
Tags: games, greedy, implementation
Correct Solution:
```
n=int(input())
num=input()
if num[0:-10].count('8')<=(n-11)//2:
print('NO')
else:
print('YES')
``` | output | 1 | 2,511 | 20 | 5,023 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,512 | 20 | 5,024 |
Tags: games, greedy, implementation
Correct Solution:
```
n = int(input())
string = str(input())
count = 0
first = 0
for i in range(n-10):
if string[i] == '8':
count += 1
if count > (n-11)/2:
print("YES")
else:
print("NO")
``` | output | 1 | 2,512 | 20 | 5,025 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,513 | 20 | 5,026 |
Tags: games, greedy, implementation
Correct Solution:
```
n=int(input())
s=input()
a=0
for i in range(len(s)-10) :
if s[i]=="8" :
a+=1
if a>(n-10-a) :
print("YES")
else :
print("NO")
``` | output | 1 | 2,513 | 20 | 5,027 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of digits. Vasya makes the first move, then players a... | instruction | 0 | 2,514 | 20 | 5,028 |
Tags: games, greedy, implementation
Correct Solution:
```
import sys
from math import ceil
input = sys.stdin.readline
n = int(input())
s = list(input().strip())
deleteEights = (n-11)//2
deleteOthers = (n-11)//2
for i in range(n):
if deleteEights > 0:
if s[i] == '8':
s[i] = -1
del... | output | 1 | 2,514 | 20 | 5,029 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,515 | 20 | 5,030 |
Yes | output | 1 | 2,515 | 20 | 5,031 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,516 | 20 | 5,032 |
Yes | output | 1 | 2,516 | 20 | 5,033 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,517 | 20 | 5,034 |
Yes | output | 1 | 2,517 | 20 | 5,035 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,518 | 20 | 5,036 |
Yes | output | 1 | 2,518 | 20 | 5,037 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,520 | 20 | 5,040 |
No | output | 1 | 2,520 | 20 | 5,041 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,521 | 20 | 5,042 |
No | output | 1 | 2,521 | 20 | 5,043 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A telephone number is a sequence of exactly 11 digits such that its first digit is 8.
Vasya and Petya are playing a game. Initially they have a string s of length n (n is odd) consisting of dig... | instruction | 0 | 2,522 | 20 | 5,044 |
No | output | 1 | 2,522 | 20 | 5,045 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,523 | 20 | 5,046 |
Tags: implementation
Correct Solution:
```
st=''
for i in range(1,10000):
st+=str(i)
n=int(input())
print(st[n-1])
``` | output | 1 | 2,523 | 20 | 5,047 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,524 | 20 | 5,048 |
Tags: implementation
Correct Solution:
```
import sys,math
def read_int():
return int(sys.stdin.readline().strip())
def read_int_list():
return list(map(int,sys.stdin.readline().strip().split()))
def read_string():
return sys.stdin.readline().strip()
def read_string_list(delim=" "):
return sys.stdin.readline().... | output | 1 | 2,524 | 20 | 5,049 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,525 | 20 | 5,050 |
Tags: implementation
Correct Solution:
```
st="0"
n=int(input(''))
i=0
j=1
while i<n :
st += str(j)
i+=1
j+=1
print(st[n]);
#print(st)
``` | output | 1 | 2,525 | 20 | 5,051 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,526 | 20 | 5,052 |
Tags: implementation
Correct Solution:
```
l=int(input())
k=''
for i in range(1,10001):
k=k+str(i)
m=str(k)
print(m[l-1])
``` | output | 1 | 2,526 | 20 | 5,053 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,527 | 20 | 5,054 |
Tags: implementation
Correct Solution:
```
st=""
for i in range(1,pow(10,4)+1):
st=st+str(i)
#print(st)
k=int(input())
print(st[k-1])
``` | output | 1 | 2,527 | 20 | 5,055 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,528 | 20 | 5,056 |
Tags: implementation
Correct Solution:
```
n = ''
for i in range(1, 100001, 1):
n += str(i)
k = int(input())
print(n[k-1])
``` | output | 1 | 2,528 | 20 | 5,057 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,529 | 20 | 5,058 |
Tags: implementation
Correct Solution:
```
def main():
k = int(input())
digit = 1; low=1; high=9; totalDigit=9; lastTotalDigit=0
while (totalDigit < k) :
low *= 10
high = 10*low-1
digit += 1
lastTotalDigit = totalDigit
totalDigit += (high+1-low)*digit
k -= lastTotalDigit
cur = str(low+(k-1) // digit)
p... | output | 1 | 2,529 | 20 | 5,059 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your t... | instruction | 0 | 2,530 | 20 | 5,060 |
Tags: implementation
Correct Solution:
```
n=int(input())
ar=map(str,range(1,10001))
s=''
d=s.join(ar)
print(d[n-1])
``` | output | 1 | 2,530 | 20 | 5,061 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,531 | 20 | 5,062 |
Yes | output | 1 | 2,531 | 20 | 5,063 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,532 | 20 | 5,064 |
Yes | output | 1 | 2,532 | 20 | 5,065 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,533 | 20 | 5,066 |
Yes | output | 1 | 2,533 | 20 | 5,067 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,534 | 20 | 5,068 |
Yes | output | 1 | 2,534 | 20 | 5,069 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,535 | 20 | 5,070 |
No | output | 1 | 2,535 | 20 | 5,071 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,536 | 20 | 5,072 |
No | output | 1 | 2,536 | 20 | 5,073 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718... | instruction | 0 | 2,537 | 20 | 5,074 |
No | output | 1 | 2,537 | 20 | 5,075 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays Robot Bicorn Attack.
The game consists of three rounds. For each one a non-negative integer amount of points is given. The result of the game is the sum of obtained points. Vasya has already played three rounds and wrote obtaine... | instruction | 0 | 2,702 | 20 | 5,404 |
Tags: brute force, implementation
Correct Solution:
```
def main():
mode="filee"
if mode=="file":f=open("test.txt","r")
get = lambda :[str(x) for x in (f.readline() if mode=="file" else input()).split()]
[g]=get()
#print(g)
n = len(g)
maxx = -1
for i in range( 1, n-1 ):
for j in ... | output | 1 | 2,702 | 20 | 5,405 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays Robot Bicorn Attack.
The game consists of three rounds. For each one a non-negative integer amount of points is given. The result of the game is the sum of obtained points. Vasya has already played three rounds and wrote obtaine... | instruction | 0 | 2,706 | 20 | 5,412 |
Tags: brute force, implementation
Correct Solution:
```
s = input()
n = len(s)
ans = -1
def f(x):
if x[0] == '0' and len(x) > 1:
return -1000000000000000000000000000000000000000000000000
ret = int(x)
if ret > 1000000:
return -1000000000000000000000000000000000000000000000000
return ret
for i in range(1, n):
... | output | 1 | 2,706 | 20 | 5,413 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays Robot Bicorn Attack.
The game consists of three rounds. For each one a non-negative integer amount of points is given. The result of the game is the sum of obtained points. Vasya has already played three rounds and wrote obtaine... | instruction | 0 | 2,707 | 20 | 5,414 |
Tags: brute force, implementation
Correct Solution:
```
import sys
[s] = sys.stdin.read().split()
def isvalid (s):
if s == "0" or s=="1000000":
return True
if s[0] == '0' or len(s)>6:
return False
return True
mx = -1
for i in range(1, len(s)):
for j in range(i+1, len(s)):
s1 ... | output | 1 | 2,707 | 20 | 5,415 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays Robot Bicorn Attack.
The game consists of three rounds. For each one a non-negative integer amount of points is given. The result of the game is the sum of obtained points. Vasya has already played three rounds and wrote obtaine... | instruction | 0 | 2,708 | 20 | 5,416 |
Tags: brute force, implementation
Correct Solution:
```
s=input()
n=len(s)
maxi=-1
for i in range(n-2):
for j in range(i+1,n-1):
a,b,c= s[:i+1],s[i+1:j+1],s[j+1:]
if len(a)==len(str(int(a))) and len(b)==len(str(int(b))) and len(c)==len(str(int(c))):
if int(a)<=1e6 and int(b)<=1e6 and in... | output | 1 | 2,708 | 20 | 5,417 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays Robot Bicorn Attack.
The game consists of three rounds. For each one a non-negative integer amount of points is given. The result of the game is the sum of obtained points. Vasya has already played three rounds and wrote obtaine... | instruction | 0 | 2,709 | 20 | 5,418 |
Tags: brute force, implementation
Correct Solution:
```
def isint(strx):
if strx == '0':
return True
if strx[0] == '0':
return False
return int(strx) <= 1000000
maxx = -1
x = input()
for i in range(1, len(x)):
for j in range(i+1, len(x)):
a, b, c = x[:i], x[i:j], x[j:]
... | output | 1 | 2,709 | 20 | 5,419 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from each block and concatenate all of those digits together to form one large integer. For ... | instruction | 0 | 2,920 | 20 | 5,840 |
Tags: dp, matrices
Correct Solution:
```
f = lambda: map(int, input().split())
m = 1000000007
n, b, k, x = f()
s = [0] * x
for q in f(): s[q % x] += 1
def g(t, d):
if not t: return s
p = [0] * x
for i, a in enumerate(t):
for j, b in enumerate(s):
p[(i + d * j) % x] += a * b
return [... | output | 1 | 2,920 | 20 | 5,841 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from each block and concatenate all of those digits together to form one large integer. For ... | instruction | 0 | 2,921 | 20 | 5,842 |
Tags: dp, matrices
Correct Solution:
```
f = lambda: map(int, input().split())
m = 1000000007
n, b, k, x = f()
s = [0] * x
for q in f(): s[q % x] += 1
def g(t, d):
p = [0] * x
for i, a in enumerate(t):
for j, b in enumerate(s):
p[(i + d * j) % x] += a * b
return [q % m for q in p]
t = ... | output | 1 | 2,921 | 20 | 5,843 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from each block and concatenate all of those digits together to form one large integer. For ... | instruction | 0 | 2,922 | 20 | 5,844 |
Tags: dp, matrices
Correct Solution:
```
n,b,k,x=map(int,input().split())
arr=list(map(int,input().split()))
flg=[0]*x
mod = 10**9+7
for i in arr:
flg[i%x]+=1
def mul(dp,flg,rank):
global x
res=[0]*x
for i in range(x):
for j in range(x):
res[ ( (i*rank)%x+j)%x ] += dp[i]*flg[j]%m... | output | 1 | 2,922 | 20 | 5,845 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.