message stringlengths 2 20.1k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 1.95k 109k | cluster float64 17 17 | __index_level_0__ int64 3.91k 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out.
The tournament takes place in the followin... | instruction | 0 | 37,288 | 17 | 74,576 |
No | output | 1 | 37,288 | 17 | 74,577 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out.
The tournament takes place in the followin... | instruction | 0 | 37,289 | 17 | 74,578 |
No | output | 1 | 37,289 | 17 | 74,579 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out.
The tournament takes place in the followin... | instruction | 0 | 37,290 | 17 | 74,580 |
No | output | 1 | 37,290 | 17 | 74,581 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A and B are preparing themselves for programming contests.
The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1 corridors so that you can get from any room to an... | instruction | 0 | 38,081 | 17 | 76,162 |
Tags: binary search, data structures, dfs and similar, dp, trees
Correct Solution:
```
from collections import defaultdict as df
from collections import deque
import os
import sys
from io import BytesIO, IOBase
_str = str
str = lambda x=b"": x if type(x) is bytes else _str(x).encode()
BUFSIZE = 8192
from types import... | output | 1 | 38,081 | 17 | 76,163 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,320 | 17 | 76,640 |
Yes | output | 1 | 38,320 | 17 | 76,641 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,321 | 17 | 76,642 |
Yes | output | 1 | 38,321 | 17 | 76,643 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,322 | 17 | 76,644 |
Yes | output | 1 | 38,322 | 17 | 76,645 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,323 | 17 | 76,646 |
Yes | output | 1 | 38,323 | 17 | 76,647 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,324 | 17 | 76,648 |
No | output | 1 | 38,324 | 17 | 76,649 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,325 | 17 | 76,650 |
No | output | 1 | 38,325 | 17 | 76,651 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,326 | 17 | 76,652 |
No | output | 1 | 38,326 | 17 | 76,653 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same... | instruction | 0 | 38,327 | 17 | 76,654 |
No | output | 1 | 38,327 | 17 | 76,655 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,586 | 17 | 77,172 |
"Correct Solution:
```
p=print
while 1:
m,f,r=map(int,input().split())
x=m+f
if m==f==r==-1:break
elif m==-1 or f==-1 or x<30:p('F')
elif x>=80:p('A')
elif 65<=x<80:p('B')
elif 50<=x<65 or r>=50:p('C')
else:p('D')
``` | output | 1 | 38,586 | 17 | 77,173 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,587 | 17 | 77,174 |
"Correct Solution:
```
m, f, r = map(int, input().split())
while m != -1 or f != -1 or r != -1:
if m == -1 or f == -1:
print("F")
elif m + f >= 80:
print("A")
elif m + f >= 65:
print("B")
elif m + f >= 50:
print("C")
elif m + f >= 30:
if r >= 50:
print("C")
else:
print("D")
else:
print("F")
m... | output | 1 | 38,587 | 17 | 77,175 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,588 | 17 | 77,176 |
"Correct Solution:
```
while True:
m, f, r = map(int, input().split())
if m == -1 and f == -1 and r == -1: break
sec = m + f
if m < 0 or f < 0: print("F")
elif sec >= 80: print("A")
elif sec >= 65: print("B")
elif sec >= 50: print("C")
elif sec >= 30:
if r >= 50:
prin... | output | 1 | 38,588 | 17 | 77,177 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,589 | 17 | 77,178 |
"Correct Solution:
```
for i in range(50):
m,f,r = map(int,input().split())
if m == f == r == -1:
break
if m == -1 or f == -1 or m+f < 30:
print("F")
elif m+f >= 80:
print("A")
elif m+f >= 65:
print("B")
elif m+f >= 50 or r >= 50:
print("C")
else:
... | output | 1 | 38,589 | 17 | 77,179 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,590 | 17 | 77,180 |
"Correct Solution:
```
def result(_m, _f, _r):
if _m==-1 or _f==-1: return "F"
elif _m+_f>=80: return "A"
elif _m+_f>=65: return "B"
elif _m+_f>=50: return "C"
elif _m+_f>=30 and _r>=50: return "C"
elif _m+_f>=30: return "D"
else: return "F"
while True:
m,f,r = map(int, input().split())... | output | 1 | 38,590 | 17 | 77,181 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,591 | 17 | 77,182 |
"Correct Solution:
```
while True:
m,f,r=map(int,input().split())
if m==f and f==r and m==-1:
break
if m==-1 or f==-1:
print("F")
elif m+f>=80:
print("A")
elif m+f>=65:
print("B")
elif m+f>=50:
print("C")
elif m+f>=30:
if r>=50:
pri... | output | 1 | 38,591 | 17 | 77,183 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,592 | 17 | 77,184 |
"Correct Solution:
```
while True:
arr = list(map(int, input().split()))
m = arr[0]
f = arr[1]
r = arr[2]
if m == -1 and f == -1 and r == -1:
break
total = m + f
if m == -1 or f == -1: print('F')
elif total >= 80: print('A')
elif total >= 65: print('B')
elif total >= 50: print('C')
elif total >= 30 an... | output | 1 | 38,592 | 17 | 77,185 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads a list of student test scores and evaluates the performance for each student.
The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup exami... | instruction | 0 | 38,593 | 17 | 77,186 |
"Correct Solution:
```
while 1:
m,f,r = map(int,input().split())
if m == -1 and f == -1 and r == -1:
break
if m == -1 or f == -1:
print('F')
elif m+f>=80:
print('A')
elif m+f>=65 and m+f<80:
print('B')
elif m+f>=50 and m+f<65:
print('C')
elif m+f>=30 and m+f<50:
if r>=50:
print('C')
else:
pri... | output | 1 | 38,593 | 17 | 77,187 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,981 | 17 | 77,962 |
Tags: geometry
Correct Solution:
```
__author__ = 'Eddie'
import sys
def get_filehandler(is_file):
if is_file:
return open(file="data")
else:
import sys
return sys.stdin
# custom starts
def get_weighted_distance(vertices, pfree):
return [((p[0] - pfree[0]) ** 2 + (p[1] - pfree[... | output | 1 | 38,981 | 17 | 77,963 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,982 | 17 | 77,964 |
Tags: geometry
Correct Solution:
```
import math
pt = dict()
def dis(a, b):
return math.sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)
def cost(p, x, y):
ang = list()
for i in range(3): ang.append(dis(p[i], [x, y]) / p[i][2])
diff = list()
for i in range(3): diff.append(ang[i] - ang[(i+1)%3])
ret =... | output | 1 | 38,982 | 17 | 77,965 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,983 | 17 | 77,966 |
Tags: geometry
Correct Solution:
```
from math import sqrt
def locus(s1, s2):
x1, y1, r1 = s1
x2, y2, r2 = s2
if r1 == r2:
k = False
m = x2 - x1
n = y2 - y1
e = m, n, -0.5 * (m * (x1 + x2) + n * (y1 + y2))
else:
k = True
m = r1 * r1
n = r2 * ... | output | 1 | 38,983 | 17 | 77,967 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,984 | 17 | 77,968 |
Tags: geometry
Correct Solution:
```
V=[list(map(int,input().split())) for _ in range(3)]
a=[]
for i in range(3):
da=V[i][0]-V[(i+1)%3][0]
db=V[i][1]-V[(i+1)%3][1]
drs=V[i][2]**2-V[(i+1)%3][2]**2 #Let drs=0
das=(V[i][0]+V[(i+1)%3][0])*da
dbs=(V[i][1]+V[(i+1)%3][1])*db
a.append([2*da,2*db,drs,da... | output | 1 | 38,984 | 17 | 77,969 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,985 | 17 | 77,970 |
Tags: geometry
Correct Solution:
```
__author__ = 'Eddie'
import sys
def get_filehandler(is_file):
if is_file:
return open(file="data")
else:
import sys
return sys.stdin
# custom starts
def get_weighted_distance(vertices, pfree):
return [((p[0] - pfree[0]) ** 2 + (p[1] - pfree[... | output | 1 | 38,985 | 17 | 77,971 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,986 | 17 | 77,972 |
Tags: geometry
Correct Solution:
```
import math
# compute distance between coordinates
def dis(a, b):
return math.sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)
def cost(p, x, y):
ang = list()
for i in range(3):
ang.append(dis(p[i], [x, y]) / p[i][2])
diff = list()
for i in range(3):
d... | output | 1 | 38,986 | 17 | 77,973 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,987 | 17 | 77,974 |
Tags: geometry
Correct Solution:
```
import math
x1, y1, r1 = [int(_) for _ in input().split()]
x2, y2, r2 = [int(_) for _ in input().split()]
x3, y3, r3 = [int(_) for _ in input().split()]
def get_line(p1, p2):
x1, y1 = p1
x2, y2 = p2
if x1 * y2 == x2 * y1:
c = 0
a = 1
if y1 != 0... | output | 1 | 38,987 | 17 | 77,975 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport event... | instruction | 0 | 38,988 | 17 | 77,976 |
Tags: geometry
Correct Solution:
```
# @auther: guoyc
# @date: 2018/7/18
import math
x1, y1, r1 = [int(_) for _ in input().split()]
x2, y2, r2 = [int(_) for _ in input().split()]
x3, y3, r3 = [int(_) for _ in input().split()]
def get_line(p1, p2):
x1, y1 = p1
x2, y2 = p2
if x1 * y2 == x2 * y1:
c... | output | 1 | 38,988 | 17 | 77,977 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,989 | 17 | 77,978 |
Yes | output | 1 | 38,989 | 17 | 77,979 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,990 | 17 | 77,980 |
Yes | output | 1 | 38,990 | 17 | 77,981 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,991 | 17 | 77,982 |
Yes | output | 1 | 38,991 | 17 | 77,983 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,992 | 17 | 77,984 |
Yes | output | 1 | 38,992 | 17 | 77,985 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,993 | 17 | 77,986 |
No | output | 1 | 38,993 | 17 | 77,987 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,994 | 17 | 77,988 |
No | output | 1 | 38,994 | 17 | 77,989 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,995 | 17 | 77,990 |
No | output | 1 | 38,995 | 17 | 77,991 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a... | instruction | 0 | 38,996 | 17 | 77,992 |
No | output | 1 | 38,996 | 17 | 77,993 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,922 | 17 | 79,844 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import thr... | output | 1 | 39,922 | 17 | 79,845 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,923 | 17 | 79,846 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
def main():
n, k, l, r, sall, sk = map(int, input().split())
x, y = divmod(sk, k)
res = [x + 1] * y + [x] * (k - y)
n -= k
if n:
sall -= sk
x, y = divmod(sall, n)
res.extend([x + 1] * y)
res.ext... | output | 1 | 39,923 | 17 | 79,847 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,924 | 17 | 79,848 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n,k,l,r,sa,sk = map(int, input().split())
a = [sk//k]*k
s = sk%k
for i in range(1,s+1):
a[i-1] += 1
if n!=k:
a += [(sa-sk)//(n-k)]*(n-k)
s = (sa-sk)%(n-k)
for i in range(1,s+1):
a[i+k-1] += 1
print(*a)
``` | output | 1 | 39,924 | 17 | 79,849 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,925 | 17 | 79,850 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
import math
n,k,l,r,sall,sk = map(int,input().split())
osk,ok = sk,k
lst = []
while k:
x = math.ceil(sk/k)
lst.append(x)
k -= 1
sk -= x
v = n-ok
sall -= osk
while v:
x = math.ceil(sall/v)
lst.append(x)
v -= 1
sall ... | output | 1 | 39,925 | 17 | 79,851 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,926 | 17 | 79,852 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n, k, l, r, sA, sK = map(int, input().split())
m = []
for x in range(k):
m.append(sK // k)
ind = 0
sK %= k
while sK:
m[ind] += 1
ind += 1
if ind == k:
ind = 0
sK -= 1
sA -= sum(m)
for q in range(n - k):
m.append(sA... | output | 1 | 39,926 | 17 | 79,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,927 | 17 | 79,854 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
R = lambda: map(int, input().split())
n, k, l, r, s_all, s_k = R()
points = [l] * n
add_1 = s_k - l * k
for i in range(k):
points[i] += add_1 // k
for i in range(add_1 % k):
points[i] += 1
if k < n:
add_2 = s_all - s_k - l * (n - k)
for... | output | 1 | 39,927 | 17 | 79,855 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,928 | 17 | 79,856 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
n,k,l,r,s1,s2=map(int,input().split())
a=[]
sumi=s1-s2
sumi1=n-k
ans1=s2//k
a=[ans1]*k
maxi=r-ans1
p=s2%k
i=0
z=0
while(p>0):
i=i%len(a)
a[i]+=1
p-=1
i+=1
ans=[]
for i in range(sumi1):
ans.append(sumi//sumi1)
if sumi>0:
z=... | output | 1 | 39,928 | 17 | 79,857 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Valera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual competition, so each student... | instruction | 0 | 39,929 | 17 | 79,858 |
Tags: constructive algorithms, implementation, math
Correct Solution:
```
import math,sys,bisect,heapq
from collections import defaultdict,Counter,deque
from itertools import groupby,accumulate
#sys.setrecursionlimit(200000000)
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__ne... | output | 1 | 39,929 | 17 | 79,859 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem consists of three subproblems: for solving subproblem C1 you will receive 4 points, for solving subproblem C2 you will receive 4 points, and for solving subproblem C3 you will receive 8 points.
Manao decided to pursue a fighter... | instruction | 0 | 39,938 | 17 | 79,876 |
Tags: brute force
Correct Solution:
```
m = 301000
ns = [0] * m
es = [0] * m
c = [0] * m
b = [0] * m
t = [0] * m
P = 0
def add(b, k):
k = t[k]
while k:
e = es[k]
if b[-1] > e: b[-1] = e
b[e] += 1
k = ns[k]
def delete(b):
for i in range(b[m - 1], m + 1):
if b[i]:
... | output | 1 | 39,938 | 17 | 79,877 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,363 | 17 | 80,726 |
"Correct Solution:
```
def main():
while True:
n, m = map(int,input().split())
if not n:
break
lst = [0] * m
for i in range(n):
lst = [i + j for i, j in zip(lst, map(int,input().split()))]
lst = list(zip(lst,[i for i in range(1,m + 1)]))
lst = sorted(lst,key=lambda t:-t[... | output | 1 | 40,363 | 17 | 80,727 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,364 | 17 | 80,728 |
"Correct Solution:
```
while 1:
n,m=map(int,input().split())
if n==m==0:break
ans=[[0,i+1] for i in range(m)]
for i in range(n):
a=list(map(int,input().split()))
for j in range(m):
if a[j]==1:
ans[j][0]-=1
ans.sort()
ans2=[]
for i in ans:
a... | output | 1 | 40,364 | 17 | 80,729 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,365 | 17 | 80,730 |
"Correct Solution:
```
def f():
N, M = map(int, input().split())
if N == 0:
return -1
A = [0] * M
for i in range(N):
T = [int(i) for i in map(int, input().split())]
for j in range(M):
if T[j] == 1:
A[j] += 1
B = sorted([(v, i + 1) for i, v in enum... | output | 1 | 40,365 | 17 | 80,731 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,366 | 17 | 80,732 |
"Correct Solution:
```
while True:
n, m = map(int, input().split())
if n == 0:
break
questionnaire = [0] * m
for _ in range(n):
questionnaire = map(lambda x, y: x+y, questionnaire, map(int, input().split()))
d = {m-k: v for k, v in enumerate(questionnaire)}
result = sorted(d.item... | output | 1 | 40,366 | 17 | 80,733 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,367 | 17 | 80,734 |
"Correct Solution:
```
while True:
n,m = [int(x) for x in input().split()]
if n == 0 and m == 0:
break
L = [0] * m
for _ in range(n):
l = [int(x) for x in input().split()]
for i in range(m):
L[i] += l[i]
M=[]
for i, j in enumerate(L,1):
M.append((i,j)... | output | 1 | 40,367 | 17 | 80,735 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.