message stringlengths 2 65.1k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 0 108k | cluster float64 14 14 | __index_level_0__ int64 0 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the following concurrent program. There are N processes and the i-th process has the following pseudocode:
repeat ni times
yi := y
y := yi + 1
end repeat
Here y is a shared varia... | instruction | 0 | 91,234 | 14 | 182,468 |
Tags: constructive algorithms
Correct Solution:
```
import sys
from array import array # noqa: F401
def input():
return sys.stdin.buffer.readline().decode('utf-8')
n, w = map(int, input().split())
a = [0] + list(map(int, input().split()))
total = sum(a)
def ng():
print('No')
exit()
def ok(a):
p... | output | 1 | 91,234 | 14 | 182,469 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Barney was hanging out with Nora for a while and now he thinks he may have feelings for her. Barney wants to send her a cheesy text message and wants to make her as happy as possible.
<image>
... | instruction | 0 | 91,328 | 14 | 182,656 |
No | output | 1 | 91,328 | 14 | 182,657 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Barney was hanging out with Nora for a while and now he thinks he may have feelings for her. Barney wants to send her a cheesy text message and wants to make her as happy as possible.
<image>
... | instruction | 0 | 91,329 | 14 | 182,658 |
No | output | 1 | 91,329 | 14 | 182,659 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Barney was hanging out with Nora for a while and now he thinks he may have feelings for her. Barney wants to send her a cheesy text message and wants to make her as happy as possible.
<image>
... | instruction | 0 | 91,330 | 14 | 182,660 |
No | output | 1 | 91,330 | 14 | 182,661 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Barney was hanging out with Nora for a while and now he thinks he may have feelings for her. Barney wants to send her a cheesy text message and wants to make her as happy as possible.
<image>
... | instruction | 0 | 91,331 | 14 | 182,662 |
No | output | 1 | 91,331 | 14 | 182,663 |
Provide a correct Python 3 solution for this coding contest problem.
Problem statement
AOR Ika-chan is in a bad mood lately. Apparently, I don't like the ratio of the number of followers to the number of followers of "Ikatta". Currently, AOR Ika-chan has $ A $ followers, $ B $ followers, and a ratio of $ A: B $.
The... | instruction | 0 | 91,704 | 14 | 183,408 |
"Correct Solution:
```
a, b, n = map(int, input().split())
score = abs(a - b)
for x in range(1, n + 1):
for y in range(1, n + 1):
if b * x % y == 0:
new_a = b * x // y
score = min(score, abs(a - new_a))
print(score)
``` | output | 1 | 91,704 | 14 | 183,409 |
Provide a correct Python 3 solution for this coding contest problem.
Problem statement
AOR Ika-chan is in a bad mood lately. Apparently, I don't like the ratio of the number of followers to the number of followers of "Ikatta". Currently, AOR Ika-chan has $ A $ followers, $ B $ followers, and a ratio of $ A: B $.
The... | instruction | 0 | 91,705 | 14 | 183,410 |
"Correct Solution:
```
#!/usr/bin/env python3
INF = 2 ** 63 - 1
def solve(a, b, n):
# a + x = k * d, b = l * g
# 1 <= k <= n, 1 <= l <= n
x = INF
for l in range(1, n + 1):
d, m = divmod(b, l)
if not m:
for k in range(1, n + 1):
x = min(x, abs(k * d - a))
... | output | 1 | 91,705 | 14 | 183,411 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Euler is a little, cute squirrel. When the autumn comes, he collects some reserves for winter. The interesting fact is that Euler likes to collect acorns in a specific way. A tree can be describ... | instruction | 0 | 91,738 | 14 | 183,476 |
No | output | 1 | 91,738 | 14 | 183,477 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Euler is a little, cute squirrel. When the autumn comes, he collects some reserves for winter. The interesting fact is that Euler likes to collect acorns in a specific way. A tree can be describ... | instruction | 0 | 91,739 | 14 | 183,478 |
No | output | 1 | 91,739 | 14 | 183,479 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,828 | 14 | 183,656 |
Tags: data structures, probabilities
Correct Solution:
```
MOD = 998244353
def power(x,y):
res=1
while(y>0):
if(y&1):
res = x*res%MOD
y = y >>1
x = x*x%MOD
return res
n = int(input())
prob = input().split()
p = power(100,n)
q = 1
for i in range(0,n-1):
q = ... | output | 1 | 91,828 | 14 | 183,657 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,829 | 14 | 183,658 |
Tags: data structures, probabilities
Correct Solution:
```
#q = int(input())
#x, y = map(int,input().split(' '))
#print (' '.join(list(map(str, s))))
def extended_gcd(aa, bb):
lastremainder, remainder = abs(aa), abs(bb)
x, lastx, y, lasty = 0, 1, 1, 0
while remainder:
lastremainder, (quotient, rem... | output | 1 | 91,829 | 14 | 183,659 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,830 | 14 | 183,660 |
Tags: data structures, probabilities
Correct Solution:
```
def main():
m = 998244353
n = int(input())
pp = map(int,input().split())
probb = 100
num = 0
for i,p in enumerate(pp,1):
probu = ((100-p) * probb) % m
probb = (p * probb) % m
num = (num*100 + i*probu) % m
num ... | output | 1 | 91,830 | 14 | 183,661 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,831 | 14 | 183,662 |
Tags: data structures, probabilities
Correct Solution:
```
input();p,f=998244353,0
for i in map(int,input().split()):f=100*(f+1)*pow(i,p-2,p)%p
print(f)
``` | output | 1 | 91,831 | 14 | 183,663 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,832 | 14 | 183,664 |
Tags: data structures, probabilities
Correct Solution:
```
n=int(input())
x=list(map(int,input().split()))
s,dp,mod=0,1,998244353
for i in range(n):
if i>0:
s=(s*100)%mod
s=(s+(100-x[i])*dp*(i+1))%mod
if i==n-1:
s=(s+x[i]*dp*(i+1))%mod
dp=(dp*x[i])%mod
ans=(s*pow(dp,mod-2,mod))%mod
print... | output | 1 | 91,832 | 14 | 183,665 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,833 | 14 | 183,666 |
Tags: data structures, probabilities
Correct Solution:
```
N = int(input())
P = list(map(int, input().split()))
mod = 998244353
p = 0
q = 1
for i in range(N):
p, q = (100 * (p+q)) % mod, (P[i] * q) % mod
print((p * pow(q, mod-2, mod))%mod)
``` | output | 1 | 91,833 | 14 | 183,667 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,834 | 14 | 183,668 |
Tags: data structures, probabilities
Correct Solution:
```
M = 998244353
def gcd(a, b):
if (a == 0):
return 0, 1
x, y = gcd(b % a, a)
return y - (b // a) * x, x
k = input()
probs = list(map(int, input().split(' ')))
num, denum = 0, 1
for p in probs:
num = (num + denum) * 100 % M
denu... | output | 1 | 91,834 | 14 | 183,669 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for all 1 ≤ i ≤ n.
Some mirrors are called checkp... | instruction | 0 | 91,835 | 14 | 183,670 |
Tags: data structures, probabilities
Correct Solution:
```
import sys
readline = sys.stdin.readline
from itertools import accumulate
from collections import Counter
from bisect import bisect as br, bisect_left as bl
class PMS:
#1-indexed
def __init__(self, A, B, issum = False):
#Aに初期状態の要素をすべて入れる,Bは値域のリス... | output | 1 | 91,835 | 14 | 183,671 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,836 | 14 | 183,672 |
Yes | output | 1 | 91,836 | 14 | 183,673 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,837 | 14 | 183,674 |
Yes | output | 1 | 91,837 | 14 | 183,675 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,838 | 14 | 183,676 |
Yes | output | 1 | 91,838 | 14 | 183,677 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,839 | 14 | 183,678 |
Yes | output | 1 | 91,839 | 14 | 183,679 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,840 | 14 | 183,680 |
No | output | 1 | 91,840 | 14 | 183,681 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,841 | 14 | 183,682 |
No | output | 1 | 91,841 | 14 | 183,683 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,842 | 14 | 183,684 |
No | output | 1 | 91,842 | 14 | 183,685 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Creatnx has n mirrors, numbered from 1 to n. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The i-th mirror will tell Creatnx that he is beautiful with probability (p_i)/(100) for... | instruction | 0 | 91,843 | 14 | 183,686 |
No | output | 1 | 91,843 | 14 | 183,687 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,005 | 14 | 184,010 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n = int(input())
before = list(map(int, input().split()))
after = list(map(int, input().split()))
permutation = n * [ None ]
for i in range(n):
permutation[before[i] - 1] = after[i]
print(' '.join(map(str, permutation)))
``` | output | 1 | 92,005 | 14 | 184,011 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,006 | 14 | 184,012 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
x = int(input())
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]
bestFriends = {}
for i,j in zip(a,b):
bestFriends[i] = j
for i in range(x):
print(bestFriends[i+1],end=" ")
``` | output | 1 | 92,006 | 14 | 184,013 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,007 | 14 | 184,014 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
l=[0]*(n+1)
for i in range(n):
l[a[i]]=b[i]
#print(l)
print(*(l[1:]))
``` | output | 1 | 92,007 | 14 | 184,015 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,008 | 14 | 184,016 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
from sys import stdin, stdout
n = int(stdin.readline())
ans = [0 for i in range(n + 1)]
a, b = list(map(int, stdin.readline().split())), list(map(int, stdin.readline().split()))
for i in range(n):
ans[a[i]] = b[i]
stdout.write(' '.join(lis... | output | 1 | 92,008 | 14 | 184,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,009 | 14 | 184,018 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
import sys
def solve():
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
indexof = [0] * (n + 1)
for i in range(n): indexof[a[i]] = i
res = [0] * n
for i in range(n):
re... | output | 1 | 92,009 | 14 | 184,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,010 | 14 | 184,020 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n, a, b = int(input()), list(map(int, input().split())), list(map(int, input().split()))
p = [0] * (n+1)
for i in range(n):
p[a[i]] = b[i]
print(" ".join(map(str, p[1:])))
``` | output | 1 | 92,010 | 14 | 184,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,011 | 14 | 184,022 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
def main():
n = int(input())
a = [int(e) for e in input().split()]
b = [int(e) for e in input().split()]
p = [i for i in range(0, n + 1)]
for i in range(n):
p[a[i]] = b[i]
print(' '.join(list(map(str, p[1:])... | output | 1 | 92,011 | 14 | 184,023 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of the group from 1 to n. Each student i (1 ≤ i ≤... | instruction | 0 | 92,012 | 14 | 184,024 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
p = [0]*n
for i,a1 in enumerate(a):
p[a1-1] = b[i]
for x in p:
print(x," " ,end='',)
print()
``` | output | 1 | 92,012 | 14 | 184,025 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of... | instruction | 0 | 92,013 | 14 | 184,026 |
Yes | output | 1 | 92,013 | 14 | 184,027 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of... | instruction | 0 | 92,014 | 14 | 184,028 |
Yes | output | 1 | 92,014 | 14 | 184,029 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of... | instruction | 0 | 92,015 | 14 | 184,030 |
Yes | output | 1 | 92,015 | 14 | 184,031 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Students of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approaching and something has to be done asap (that is, quickly). Let's number the students of... | instruction | 0 | 92,016 | 14 | 184,032 |
Yes | output | 1 | 92,016 | 14 | 184,033 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar to his own name. The pseudonym must be a name ... | instruction | 0 | 92,147 | 14 | 184,294 |
Tags: dfs and similar, strings, trees
Correct Solution:
```
import sys
class Node:
def __init__(self, d):
global nodes
self.ch = {}
self.a = [[], []]
self.d = d
nodes += [self]
nodes = []
pairs = []
res = 0
N = int(sys.stdin.readline())
_input = sys.stdin.readlines()
_inpu... | output | 1 | 92,147 | 14 | 184,295 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar to his own name. The pseudonym must be a name ... | instruction | 0 | 92,148 | 14 | 184,296 |
Tags: dfs and similar, strings, trees
Correct Solution:
```
import sys
SIGMA = 26
nodes = []
pairs = []
res = 0
class Node:
def __init__(self):
self.ch = {}
self.a = []
self.b = []
self.d = 0
def add(self, s, i):
t = self
for c in s:
v = ord(c) - o... | output | 1 | 92,148 | 14 | 184,297 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar to his own name. The pseudonym must be a name ... | instruction | 0 | 92,149 | 14 | 184,298 |
Tags: dfs and similar, strings, trees
Correct Solution:
```
import sys
SIGMA = 26
nodes = []
pairs = []
res = 0
class Node:
def __init__(self):
self.ch = {}
self.a = []
self.b = []
self.d = 0
def add(self, s, i):
t = self
for c in s:
v = ord(c) - o... | output | 1 | 92,149 | 14 | 184,299 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar... | instruction | 0 | 92,150 | 14 | 184,300 |
No | output | 1 | 92,150 | 14 | 184,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar... | instruction | 0 | 92,151 | 14 | 184,302 |
No | output | 1 | 92,151 | 14 | 184,303 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar... | instruction | 0 | 92,152 | 14 | 184,304 |
No | output | 1 | 92,152 | 14 | 184,305 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar... | instruction | 0 | 92,153 | 14 | 184,306 |
No | output | 1 | 92,153 | 14 | 184,307 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.
You are given user's friends' opinions about a list of items. You are also gi... | instruction | 0 | 92,187 | 14 | 184,374 |
Tags: *special
Correct Solution:
```
'kitten'
f,l,t=map(int,input().split())
s=[input() for _ in range(f)]
a=0
for j in range(l):
c=0
for i in range(f):
c+=s[i][j]=='Y';
a+=c>=t
print(a)
``` | output | 1 | 92,187 | 14 | 184,375 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.
You are given user's friends' opinions about a list of items. You are also gi... | instruction | 0 | 92,188 | 14 | 184,376 |
Tags: *special
Correct Solution:
```
#kitten
F, I, T = list(map(int, input().split()))
s = [""] * F
for i in range(F):
s[i] = input()
a = 0
for j in range(I):
c = 0
for i in range(F):
c += (s[i][j] == 'Y')
a += (c >= T)
print(a)
``` | output | 1 | 92,188 | 14 | 184,377 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.
You are given user's friends' opinions about a list of items. You are also gi... | instruction | 0 | 92,189 | 14 | 184,378 |
Tags: *special
Correct Solution:
```
import sys
n,m,k=map(int,sys.stdin.readline().split ())
c=[0]*m
for i in range(n):
T=sys.stdin.readline()
for j in range(m) :
if T[j]=='Y' :
c[j]+=1
kitten=0
for i in range(m):
if c[i]>=k:
kitten+=1
print(kitten)
``` | output | 1 | 92,189 | 14 | 184,379 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.
You are given user's friends' opinions about a list of items. You are also gi... | instruction | 0 | 92,190 | 14 | 184,380 |
Tags: *special
Correct Solution:
```
f,i,t = map(int,input().split())
a = [0] * i
for z in range(f):
u = input().strip()
for q in range(i):
if u[q] == 'Y': a[q] += 1
print(len([_ for _ in a if _ >= t]))
# kitten
# meow~~
``` | output | 1 | 92,190 | 14 | 184,381 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.
You are given user's friends' opinions about a list of items. You are also gi... | instruction | 0 | 92,191 | 14 | 184,382 |
Tags: *special
Correct Solution:
```
f,l,t = map(int,input().split())
s = []
for i in range(f):
s.append(input())
ans = 0
for i in range(l):
cnt = 0
for j in range(f):
cnt += (s[j][i]=='Y')
ans += (cnt >= t)
# kitten
print( ans )
``` | output | 1 | 92,191 | 14 | 184,383 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.
You are given user's friends' opinions about a list of items. You are also gi... | instruction | 0 | 92,192 | 14 | 184,384 |
Tags: *special
Correct Solution:
```
c = []
F, I, T = map(int, input().split())
for i in range(F):
s = input()
for j in range(I):
c.append(0)
c[j] += s[j] == 'Y'
r = 0
for i in range(I):
r += c[i] >= T
print(r)
kitten = 0
``` | output | 1 | 92,192 | 14 | 184,385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.