message stringlengths 2 30.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 237 109k | cluster float64 10 10 | __index_level_0__ int64 474 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly n flowers.
Vladimir went to a flower shop, and he was amazed to see that there are... | instruction | 0 | 64,159 | 10 | 128,318 |
Yes | output | 1 | 64,159 | 10 | 128,319 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly n flowers.
Vladimir went to a flower shop, and he was amazed to see that there are... | instruction | 0 | 64,160 | 10 | 128,320 |
Yes | output | 1 | 64,160 | 10 | 128,321 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly n flowers.
Vladimir went to a flower shop, and he was amazed to see that there are... | instruction | 0 | 64,161 | 10 | 128,322 |
No | output | 1 | 64,161 | 10 | 128,323 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly n flowers.
Vladimir went to a flower shop, and he was amazed to see that there are... | instruction | 0 | 64,162 | 10 | 128,324 |
No | output | 1 | 64,162 | 10 | 128,325 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly n flowers.
Vladimir went to a flower shop, and he was amazed to see that there are... | instruction | 0 | 64,163 | 10 | 128,326 |
No | output | 1 | 64,163 | 10 | 128,327 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly n flowers.
Vladimir went to a flower shop, and he was amazed to see that there are... | instruction | 0 | 64,164 | 10 | 128,328 |
No | output | 1 | 64,164 | 10 | 128,329 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,658 | 10 | 129,316 |
"Correct Solution:
```
n,y=map(int,input().split());r=range
for i in r(n+1):
for j in r(n-i+1):
if i*9+j*4+n==y/1000and i+j<=n:print(i,j,n-i-j);exit()
print(-1,-1,-1)
``` | output | 1 | 64,658 | 10 | 129,317 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,659 | 10 | 129,318 |
"Correct Solution:
```
N, Y = map(int, input().split())
for i in range(N+1):
for j in range(N-i+1):
if 10000*i+5000*j+1000*(N-i-j) == Y:
print(i,j,N-i-j)
exit()
print('-1 -1 -1')
``` | output | 1 | 64,659 | 10 | 129,319 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,660 | 10 | 129,320 |
"Correct Solution:
```
n,y=map(int,input().split())
for i in range(n+1):
for j in range(n+1):
k=n-i-j
if k>=0 and i*10000+j*5000+k*1000==y:
print(i,j,k)
exit()
print(-1,-1,-1)
``` | output | 1 | 64,660 | 10 | 129,321 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,661 | 10 | 129,322 |
"Correct Solution:
```
n, y = map(int,input().split())
for a in range(n+1):
for b in range(n+1-a):
c = n-a-b
if 10000*a + 5000*b + 1000*c == y:
print(a,b,c)
exit()
print(-1,-1,-1)
``` | output | 1 | 64,661 | 10 | 129,323 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,662 | 10 | 129,324 |
"Correct Solution:
```
import sys
n,y =map(int,input().split())
for a in range(n+1):
for b in range(n+1-a):
if 10000*a+5000*b+1000*(n-a-b) == y:
print(a,b,n-a-b)
sys.exit()
print(-1,-1,-1)
``` | output | 1 | 64,662 | 10 | 129,325 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,663 | 10 | 129,326 |
"Correct Solution:
```
n,y=map(int,input().split())
for i in range(n+1):
for j in range(n-i+1):
b=10000*i+5000*j+1000*(n-i-j)
if y==b:
print(i,j,n-i-j)
exit()
print(-1,-1,-1)
``` | output | 1 | 64,663 | 10 | 129,327 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,664 | 10 | 129,328 |
"Correct Solution:
```
N,Y=map(int,input().split())
L=[-1,-1,-1]
for i in range(0,min(Y//10000,N)+1):
for j in range(0,N-i+1):
if i*10000+j*5000+(N-i-j)*1000==Y:
L=[i,j,N-i-j]
break
print(*L)
``` | output | 1 | 64,664 | 10 | 129,329 |
Provide a correct Python 3 solution for this coding contest problem.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for ... | instruction | 0 | 64,665 | 10 | 129,330 |
"Correct Solution:
```
N, Y = map(int,input().split())
ans = [-1,-1,-1]
for x in range(N+1) :
for y in range(N+1-x) :
if 9000*x + 4000*y + 1000*N == Y :
ans = [x,y,N-x-y]
print(*ans)
``` | output | 1 | 64,665 | 10 | 129,331 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,666 | 10 | 129,332 |
Yes | output | 1 | 64,666 | 10 | 129,333 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,667 | 10 | 129,334 |
Yes | output | 1 | 64,667 | 10 | 129,335 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,668 | 10 | 129,336 |
Yes | output | 1 | 64,668 | 10 | 129,337 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,669 | 10 | 129,338 |
Yes | output | 1 | 64,669 | 10 | 129,339 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,670 | 10 | 129,340 |
No | output | 1 | 64,670 | 10 | 129,341 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,671 | 10 | 129,342 |
No | output | 1 | 64,671 | 10 | 129,343 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,672 | 10 | 129,344 |
No | output | 1 | 64,672 | 10 | 129,345 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.
According to Aohashi, he received an otoshidama (New Year money gift) e... | instruction | 0 | 64,673 | 10 | 129,346 |
No | output | 1 | 64,673 | 10 | 129,347 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,991 | 10 | 129,982 |
Tags: greedy, sortings
Correct Solution:
```
import heapq as hp
import collections
import bisect
import math
import re
def unpack(func=int):
return map(func, input().split())
def l_unpack(func=int):
"""list unpack"""
return list(map(func, input().split()))
def s_unpack(func=int):
"""sorted list un... | output | 1 | 64,991 | 10 | 129,983 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,992 | 10 | 129,984 |
Tags: greedy, sortings
Correct Solution:
```
import sys
from math import log2, ceil
input = sys.stdin.readline
def swaparr(arr, a,b):
temp = arr[a];
arr[a] = arr[b];
arr[b] = temp
def gcd(a,b):
if a > 0:
return gcd(b%a, a)
return b
def primefs(n):
## if n == 1
if n == 1:
ret... | output | 1 | 64,992 | 10 | 129,985 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,993 | 10 | 129,986 |
Tags: greedy, sortings
Correct Solution:
```
# Middle Class
def middle(arr, x):
if sum(arr) / len(arr) >= x:
return len(arr)
ans = 0
suma = 0
arr.sort()
for i in arr[::-1]:
suma += i
ans += 1
if suma / ans < x:
return ans - 1
return len(ans)
t = int(... | output | 1 | 64,993 | 10 | 129,987 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,994 | 10 | 129,988 |
Tags: greedy, sortings
Correct Solution:
```
for _ in range(int(input())):
n,x=map(int,input().split())
list1=[int(x) for x in input().split()]
list1.sort()
list1.reverse()
wealthyCount=0
sumBurles=0
for i in range(len(list1)):
sumBurles+=list1[i]
if sumBurles/(i+1)>=x:
... | output | 1 | 64,994 | 10 | 129,989 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,995 | 10 | 129,990 |
Tags: greedy, sortings
Correct Solution:
```
def abse(s,r):
pre1=[0]
pre2=[0]
for i in range(len(s)):
pre1.append(pre1[-1]+s[i])
for i in range(len(l)):
pre2.append(pre2[-1]+l[i])
e=0
t=1
if(len(pre2)==1):
return 0;
while(e<len(pre1)-1 and t<len(pre2)):
... | output | 1 | 64,995 | 10 | 129,991 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,996 | 10 | 129,992 |
Tags: greedy, sortings
Correct Solution:
```
rint = lambda: int(input())
rounds = rint()
for _ in range(rounds):
p, dst = [int(c) for c in input().split()]
ss = [int(c) for c in input().split()]
ss.sort()
total = sum(ss)
#ans = 0
while len(ss) > 0:
avg = total / len(ss)
if avg >=... | output | 1 | 64,996 | 10 | 129,993 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,997 | 10 | 129,994 |
Tags: greedy, sortings
Correct Solution:
```
from math import *
for zz in range(int(input())):
n, x = map(int, input().split())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
ans = 0
cs = 0
for i in range(n):
if (a[i] < x):
break
ans += 1
cs += a[... | output | 1 | 64,997 | 10 | 129,995 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least x burles. To increase the number of wealthy pe... | instruction | 0 | 64,998 | 10 | 129,996 |
Tags: greedy, sortings
Correct Solution:
```
t = int(input())
for i in range(t):
n, x = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
arr.sort(reverse=True)
cnt = 0
sm = 0
while cnt < n and sm + arr[cnt] >= (cnt+1)*x:
sm += arr[cnt]
cnt += 1
print... | output | 1 | 64,998 | 10 | 129,997 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 64,999 | 10 | 129,998 |
Yes | output | 1 | 64,999 | 10 | 129,999 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,000 | 10 | 130,000 |
Yes | output | 1 | 65,000 | 10 | 130,001 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,001 | 10 | 130,002 |
Yes | output | 1 | 65,001 | 10 | 130,003 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,002 | 10 | 130,004 |
Yes | output | 1 | 65,002 | 10 | 130,005 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,003 | 10 | 130,006 |
No | output | 1 | 65,003 | 10 | 130,007 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,004 | 10 | 130,008 |
No | output | 1 | 65,004 | 10 | 130,009 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,005 | 10 | 130,010 |
No | output | 1 | 65,005 | 10 | 130,011 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.
The government considered a person as wealthy if he had at least... | instruction | 0 | 65,006 | 10 | 130,012 |
No | output | 1 | 65,006 | 10 | 130,013 |
Provide a correct Python 3 solution for this coding contest problem.
The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King is overjoyed. Subsidiary coins with 1/101 prime as one su... | instruction | 0 | 65,539 | 10 | 131,078 |
"Correct Solution:
```
# AOJ 0165 Lottery
# Python3 2018.6.23 bal4u
#define MAX 1000000
#define SQRT 1000 // sqrt(MAX)
MAX = 1000000
SQRT = 1000 # sqrt(MAX)
comp = [0]*(MAX+2)
def sieve():
for i in range(3, SQRT, 2):
if comp[i] == 0:
for j in range(i*i, MAX, i): comp[j] = 1
sieve()
tbl = [0]*(MAX+2)... | output | 1 | 65,539 | 10 | 131,079 |
Provide a correct Python 3 solution for this coding contest problem.
The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King is overjoyed. Subsidiary coins with 1/101 prime as one su... | instruction | 0 | 65,540 | 10 | 131,080 |
"Correct Solution:
```
import bisect
n=1000000
p=[1]*(n+1)
p[0],p[1]=0,0
for i in range(2,int(n**0.5)+1):
if p[i]:
for j in range(i*i,n+1,i):
p[j]=0
p=[i for i in range(n+1) if p[i]==1]
while 1:
n=int(input())
ans=-n
if n==0:break
while n:
n-=1
a,m=map(int... | output | 1 | 65,540 | 10 | 131,081 |
Provide a correct Python 3 solution for this coding contest problem.
The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King is overjoyed. Subsidiary coins with 1/101 prime as one su... | instruction | 0 | 65,541 | 10 | 131,082 |
"Correct Solution:
```
from itertools import accumulate
MAX = 1000000
is_prime = [1] * MAX
is_prime[0] = is_prime[1] = 0
for i in range(2, int(MAX ** (1 / 2)) + 1):
if is_prime[i]:
for j in range(i * i, MAX, i):
is_prime[j] = 0
acc_prime = list(accumulate(is_prime))
while True:
n = int(input())
if n ==... | output | 1 | 65,541 | 10 | 131,083 |
Provide a correct Python 3 solution for this coding contest problem.
The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King is overjoyed. Subsidiary coins with 1/101 prime as one su... | instruction | 0 | 65,542 | 10 | 131,084 |
"Correct Solution:
```
import bisect
LENGTH = 1000000
def eratosthenes(length):
from math import sqrt
def is_prime_number(num):
limit = int(sqrt(num)) + 1
for lp in range(3, limit, 2):
if num % lp == 0:
return False
return True
is_prime_number_list ... | output | 1 | 65,542 | 10 | 131,085 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King i... | instruction | 0 | 65,543 | 10 | 131,086 |
No | output | 1 | 65,543 | 10 | 131,087 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King i... | instruction | 0 | 65,544 | 10 | 131,088 |
No | output | 1 | 65,544 | 10 | 131,089 |
Provide a correct Python 3 solution for this coding contest problem.
On the Internet shopping site, on the same page as the product that the user is currently viewing, some other products that other users have bought in the past along with the product that they are currently viewing are displayed. It is believed that ... | instruction | 0 | 65,545 | 10 | 131,090 |
"Correct Solution:
```
n, f = map(int, input().split())
a = {}
for _ in range(n):
m, *c = input().split()
m = int(m)
for i in range(m - 1):
for j in range(i + 1, m):
p = (min(c[i], c[j]), max(c[i], c[j]))
if p in a:a[p] += 1
else:a[p] = 1
b = []
for k in a:
if... | output | 1 | 65,545 | 10 | 131,091 |
Provide a correct Python 3 solution for this coding contest problem.
On the Internet shopping site, on the same page as the product that the user is currently viewing, some other products that other users have bought in the past along with the product that they are currently viewing are displayed. It is believed that ... | instruction | 0 | 65,546 | 10 | 131,092 |
"Correct Solution:
```
from itertools import combinations
N, F= map(int, input().split())
goods= [sorted(g) for _ in range(N) for g in list(combinations(list(map(str, input().split()))[1:], 2))]
sets=set((g[0], g[1]) for g in goods)
s= [(s[0], s[1]) for s in sets if goods.count([s[0], s[1]])>=F]
n= [sum(1 for s in sets... | output | 1 | 65,546 | 10 | 131,093 |
Provide a correct Python 3 solution for this coding contest problem.
On the Internet shopping site, on the same page as the product that the user is currently viewing, some other products that other users have bought in the past along with the product that they are currently viewing are displayed. It is believed that ... | instruction | 0 | 65,547 | 10 | 131,094 |
"Correct Solution:
```
N,F = [int(i) for i in input().split()]
itemsets = []
for l in range(N):
items = input().split()
M = int(items.pop(0))
items.sort()
for i in range(len(items)):
for j in range(i+1, len(items)):
itemsets.append(items[i] + " " + items[j])
itemsets.sort()... | output | 1 | 65,547 | 10 | 131,095 |
Provide a correct Python 3 solution for this coding contest problem.
On the Internet shopping site, on the same page as the product that the user is currently viewing, some other products that other users have bought in the past along with the product that they are currently viewing are displayed. It is believed that ... | instruction | 0 | 65,548 | 10 | 131,096 |
"Correct Solution:
```
def combinations(l):
sl = sorted(l)
r = range(len(sl)-1)
for i in r:
for j in range(i+1, len(sl)):
yield (sl[i], sl[j])
m,n = [ int(s) for s in input().split() ]
d = {}
for i in range(m):
l = input().split()[1:]
for e in combinations(l):
if e in... | output | 1 | 65,548 | 10 | 131,097 |
Provide a correct Python 3 solution for this coding contest problem.
On the Internet shopping site, on the same page as the product that the user is currently viewing, some other products that other users have bought in the past along with the product that they are currently viewing are displayed. It is believed that ... | instruction | 0 | 65,549 | 10 | 131,098 |
"Correct Solution:
```
from collections import Counter
counter = Counter()
n, f = map(int, input().split())
for _ in range(n):
items = input().split()
m = int(items[0])
items = items[1:]
items.sort()
for i in range(m):
for j in range(i + 1, m):
counter[(items[i], items[j])] += 1
lst = [(k, v) for k... | output | 1 | 65,549 | 10 | 131,099 |
Provide a correct Python 3 solution for this coding contest problem.
On the Internet shopping site, on the same page as the product that the user is currently viewing, some other products that other users have bought in the past along with the product that they are currently viewing are displayed. It is believed that ... | instruction | 0 | 65,550 | 10 | 131,100 |
"Correct Solution:
```
N, F = map(int, input().split())
data = []
tmp = {}
for i in range(N) :
data.append(list(input().split()))
for x in range(1, len(data[i]) - 1) :
for y in range(x+1, len(data[i])) :
a = data[i][x]
b = data[i][y]
a, b = min(a, b), max(a, b)
... | output | 1 | 65,550 | 10 | 131,101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.