message stringlengths 2 44.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 42 109k | cluster float64 5 5 | __index_level_0__ int64 84 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,518 | 5 | 175,036 |
Yes | output | 1 | 87,518 | 5 | 175,037 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,519 | 5 | 175,038 |
Yes | output | 1 | 87,519 | 5 | 175,039 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,520 | 5 | 175,040 |
Yes | output | 1 | 87,520 | 5 | 175,041 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,521 | 5 | 175,042 |
No | output | 1 | 87,521 | 5 | 175,043 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,522 | 5 | 175,044 |
No | output | 1 | 87,522 | 5 | 175,045 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,523 | 5 | 175,046 |
No | output | 1 | 87,523 | 5 | 175,047 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the least common multiple (LCM) of given n integers.
Constraints
* 2 ≤ n ≤ 10
* 1 ≤ ai ≤ 1000
* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1
Input
n
a1 a2 ... an... | instruction | 0 | 87,524 | 5 | 175,048 |
No | output | 1 | 87,524 | 5 | 175,049 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,645 | 5 | 175,290 |
Yes | output | 1 | 87,645 | 5 | 175,291 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,646 | 5 | 175,292 |
Yes | output | 1 | 87,646 | 5 | 175,293 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,647 | 5 | 175,294 |
Yes | output | 1 | 87,647 | 5 | 175,295 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,648 | 5 | 175,296 |
Yes | output | 1 | 87,648 | 5 | 175,297 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,649 | 5 | 175,298 |
No | output | 1 | 87,649 | 5 | 175,299 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,650 | 5 | 175,300 |
No | output | 1 | 87,650 | 5 | 175,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,651 | 5 | 175,302 |
No | output | 1 | 87,651 | 5 | 175,303 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0.
You may perform some operations with... | instruction | 0 | 87,652 | 5 | 175,304 |
No | output | 1 | 87,652 | 5 | 175,305 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,891 | 5 | 175,782 |
Yes | output | 1 | 87,891 | 5 | 175,783 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,892 | 5 | 175,784 |
Yes | output | 1 | 87,892 | 5 | 175,785 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,893 | 5 | 175,786 |
Yes | output | 1 | 87,893 | 5 | 175,787 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,894 | 5 | 175,788 |
Yes | output | 1 | 87,894 | 5 | 175,789 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,895 | 5 | 175,790 |
No | output | 1 | 87,895 | 5 | 175,791 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,896 | 5 | 175,792 |
No | output | 1 | 87,896 | 5 | 175,793 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,897 | 5 | 175,794 |
No | output | 1 | 87,897 | 5 | 175,795 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non-decreasing order.
Ivan wrote out integers 2a1, 2a2, ..., 2an on a piece of pape... | instruction | 0 | 87,898 | 5 | 175,796 |
No | output | 1 | 87,898 | 5 | 175,797 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,091 | 5 | 176,182 |
Yes | output | 1 | 88,091 | 5 | 176,183 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,093 | 5 | 176,186 |
Yes | output | 1 | 88,093 | 5 | 176,187 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,094 | 5 | 176,188 |
Yes | output | 1 | 88,094 | 5 | 176,189 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,095 | 5 | 176,190 |
No | output | 1 | 88,095 | 5 | 176,191 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,096 | 5 | 176,192 |
No | output | 1 | 88,096 | 5 | 176,193 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,097 | 5 | 176,194 |
No | output | 1 | 88,097 | 5 | 176,195 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that... | instruction | 0 | 88,098 | 5 | 176,196 |
No | output | 1 | 88,098 | 5 | 176,197 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,159 | 5 | 176,318 |
"Correct Solution:
```
n=int(input())
arr=list(input())
arr=[int(arr[i]) for i in range(n)]
if n==1:
print(arr[0])
if n==2:
print(abs(arr[0]-arr[1]))
else:
tmp=[]
for i in range(n-2):
tmp.append(abs(abs(arr[i]-arr[i+1])-abs(arr[i+1]-arr[i+2])))
arr=tmp
while len(arr)>3:
tmp=[]
if len(arr)%2==0:
... | output | 1 | 88,159 | 5 | 176,319 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,160 | 5 | 176,320 |
"Correct Solution:
```
import sys
N = int(input()) - 1
two = False
S = 0
for i in range(N+1):
a = int(sys.stdin.read(1))
if not two:
two = a == 2
if i & N == i:
S ^= a-1
if two:
S &= ~2
print(S)
``` | output | 1 | 88,160 | 5 | 176,321 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,161 | 5 | 176,322 |
"Correct Solution:
```
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().spl... | output | 1 | 88,161 | 5 | 176,323 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,162 | 5 | 176,324 |
"Correct Solution:
```
N = int(input())
a = input()
def myc(n):
ret = 0
while n % 2 == 0:
ret += 1
n //= 2
return ret
def func(c):
odd = 0
count = 0
if a[0] == c:
count += 1
if a[-1] == c:
count += 1
for i in range(1, N // 2):
odd += myc(N-i) - m... | output | 1 | 88,162 | 5 | 176,325 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,163 | 5 | 176,326 |
"Correct Solution:
```
n = int(input())
s = input()
a = []
for i in range(n - 1):
a.append(abs(int(s[i]) - int(s[i + 1])))
ans = []
for r in range(n - 1):
if (n - 2)^ r ^ (n - 2 - r) == 0:
ans.append(int(a[r]))
res = 0
for i in ans:
res = abs(res - i)
if 1 in a:
print(res % 2)
else:
print... | output | 1 | 88,163 | 5 | 176,327 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,164 | 5 | 176,328 |
"Correct Solution:
```
import sys
N = int(input()) - 1
two = False
S = 0
for i in range(N+1):
a = int(sys.stdin.read(1))
two |= (a == 2)
if i & N == i:
S ^= a-1
if two:
S &= ~2
print(S)
``` | output | 1 | 88,164 | 5 | 176,329 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,165 | 5 | 176,330 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 13:54:24 2020
@author: naoki
"""
import sys
#f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
N = int(input())
a = list(map(lambda x:int(x)-1,list(input())))
all_odd = 0
kai = [0] * N
if (0 not in a) and (1 not in a):
print(0)
sy... | output | 1 | 88,165 | 5 | 176,331 |
Provide a correct Python 3 solution for this coding contest problem.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+1} | \quad (2 \leq i \leq N and 1 \leq j \leq N+1-i)
... | instruction | 0 | 88,166 | 5 | 176,332 |
"Correct Solution:
```
import sys
n=int(input())
s=input()
frac=[0]*(n+1)
for i in range(1,n+1):
k=i
frac[i]=frac[i-1]
while k%2==0:
k//=2
frac[i]+=1
ans=0
for i in range(n):
if int(s[i])==2 and frac[n-1]-frac[i]-frac[n-1-i]==0:
ans^=1
if ans==1: print(1)
elif "2" in s: print(0... | output | 1 | 88,166 | 5 | 176,333 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,167 | 5 | 176,334 |
Yes | output | 1 | 88,167 | 5 | 176,335 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,168 | 5 | 176,336 |
Yes | output | 1 | 88,168 | 5 | 176,337 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,169 | 5 | 176,338 |
Yes | output | 1 | 88,169 | 5 | 176,339 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,170 | 5 | 176,340 |
Yes | output | 1 | 88,170 | 5 | 176,341 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,171 | 5 | 176,342 |
No | output | 1 | 88,171 | 5 | 176,343 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,172 | 5 | 176,344 |
No | output | 1 | 88,172 | 5 | 176,345 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,173 | 5 | 176,346 |
No | output | 1 | 88,173 | 5 | 176,347 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a sequence of N digits a_1a_2\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:
* x_{1,j} := a_j \quad (1 \leq j \leq N)
* x_{i,j} := | x_{i-1,j} - x_{i-1,j+... | instruction | 0 | 88,174 | 5 | 176,348 |
No | output | 1 | 88,174 | 5 | 176,349 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is distributing N balls to K persons.
If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?
Co... | instruction | 0 | 88,177 | 5 | 176,354 |
"Correct Solution:
```
n, k = map(int, input().split())
print((n - k) if k > 1 else 0)
``` | output | 1 | 88,177 | 5 | 176,355 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is distributing N balls to K persons.
If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?
Co... | instruction | 0 | 88,178 | 5 | 176,356 |
"Correct Solution:
```
W = list(map(int,input().split()))
print(W[0]%W[1])
``` | output | 1 | 88,178 | 5 | 176,357 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is distributing N balls to K persons.
If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?
Co... | instruction | 0 | 88,179 | 5 | 176,358 |
"Correct Solution:
```
(lambda n,k: print(0 if k==1 else n-k))(*list(map(int,input().split())))
``` | output | 1 | 88,179 | 5 | 176,359 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is distributing N balls to K persons.
If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?
Co... | instruction | 0 | 88,180 | 5 | 176,360 |
"Correct Solution:
```
n,k = map(int,input().split())
print(max((n % k - n // k + 1),0))
``` | output | 1 | 88,180 | 5 | 176,361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.