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 |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class flag", I decided to play the following game using a lar... | instruction | 0 | 8,975 | 17 | 17,950 |
"Correct Solution:
```
while True:
try:
n = int(input())
except:
break
if n % 39 == 0:
ans = 39
else:
ans = n % 39
print("3C" + str(ans).zfill(2))
``` | output | 1 | 8,975 | 17 | 17,951 |
Provide a correct Python 3 solution for this coding contest problem.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class flag", I decided to play the following game using a lar... | instruction | 0 | 8,976 | 17 | 17,952 |
"Correct Solution:
```
while True:
try:
n = int(input().strip())
m = n % 39
if m==0:
s = "39"
else:
s = "%02d" % m
print("3C" + s)
except EOFError:
break
``` | output | 1 | 8,976 | 17 | 17,953 |
Provide a correct Python 3 solution for this coding contest problem.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class flag", I decided to play the following game using a lar... | instruction | 0 | 8,977 | 17 | 17,954 |
"Correct Solution:
```
while True:
try:
n = int(input())
except:
break
ans = n % 39
if ans == 0:
ans = "39"
else:
ans = "{0:02d}".format(ans)
print("3C"+ans)
``` | output | 1 | 8,977 | 17 | 17,955 |
Provide a correct Python 3 solution for this coding contest problem.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class flag", I decided to play the following game using a lar... | instruction | 0 | 8,978 | 17 | 17,956 |
"Correct Solution:
```
# AOJ 0148 Candy and Class Flag
# Python3 2018.6.18 bal4u
while True:
try: a = (int(input())-1) % 39 + 1
except: break
print("3C", format(a, "02d"), sep='')
``` | output | 1 | 8,978 | 17 | 17,957 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class... | instruction | 0 | 8,979 | 17 | 17,958 |
Yes | output | 1 | 8,979 | 17 | 17,959 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class... | instruction | 0 | 8,980 | 17 | 17,960 |
Yes | output | 1 | 8,980 | 17 | 17,961 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class... | instruction | 0 | 8,981 | 17 | 17,962 |
Yes | output | 1 | 8,981 | 17 | 17,963 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class... | instruction | 0 | 8,982 | 17 | 17,964 |
Yes | output | 1 | 8,982 | 17 | 17,965 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In Group C of the 3rd year, we decided to use the "class flag" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the "class... | instruction | 0 | 8,983 | 17 | 17,966 |
No | output | 1 | 8,983 | 17 | 17,967 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbered from 1 to 2N. The tournament lasts N rounds... | instruction | 0 | 9,610 | 17 | 19,220 |
Tags: dp, probabilities, trees
Correct Solution:
```
import functools
n = int(input())
props = []
def preproc(a):
return float(a)/100.
for i in range(pow(2,n)):
props.append(list(map(preproc, input().split())))
wining_props = [] # list of lists. First index -- number of round, second -- num of team, value -... | output | 1 | 9,610 | 17 | 19,221 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbered from 1 to 2N. The tournament lasts N rounds... | instruction | 0 | 9,611 | 17 | 19,222 |
Tags: dp, probabilities, trees
Correct Solution:
```
n = int(input())
# Using the same index I would for a tree
m = 2**n
points = [0]*(2*m)
points[1] = 2**(n-1)
for i in range(1,m):
x = points[i]//2
points[2*i] = x
points[2*i+1] = x
P = [[int(x)/100.0 for x in input().split()] for _ in range(m)]
state =... | output | 1 | 9,611 | 17 | 19,223 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbered from 1 to 2N. The tournament lasts N rounds... | instruction | 0 | 9,612 | 17 | 19,224 |
Tags: dp, probabilities, trees
Correct Solution:
```
n = int(input())
m = 1 << n
p = [list(map(int, input().split())) for i in range(m)]
u, x = [1] * m, [0] * m
v, y = u[:], x[:]
for i in range(n):
d = 1 << i
for j in range(m):
s = d * (j // d ^ 1)
v[j] = u[j] * sum(u[k] * p[j][k] for k in range... | output | 1 | 9,612 | 17 | 19,225 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbe... | instruction | 0 | 9,613 | 17 | 19,226 |
No | output | 1 | 9,613 | 17 | 19,227 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbe... | instruction | 0 | 9,614 | 17 | 19,228 |
No | output | 1 | 9,614 | 17 | 19,229 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbe... | instruction | 0 | 9,615 | 17 | 19,230 |
No | output | 1 | 9,615 | 17 | 19,231 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice is a big fan of volleyball and especially of the very strong "Team A".
Volleyball match consists of up to five sets. During each set teams score one point for winning a ball. The first fo... | instruction | 0 | 9,950 | 17 | 19,900 |
No | output | 1 | 9,950 | 17 | 19,901 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice is a big fan of volleyball and especially of the very strong "Team A".
Volleyball match consists of up to five sets. During each set teams score one point for winning a ball. The first fo... | instruction | 0 | 9,951 | 17 | 19,902 |
No | output | 1 | 9,951 | 17 | 19,903 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice is a big fan of volleyball and especially of the very strong "Team A".
Volleyball match consists of up to five sets. During each set teams score one point for winning a ball. The first fo... | instruction | 0 | 9,952 | 17 | 19,904 |
No | output | 1 | 9,952 | 17 | 19,905 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice is a big fan of volleyball and especially of the very strong "Team A".
Volleyball match consists of up to five sets. During each set teams score one point for winning a ball. The first fo... | instruction | 0 | 9,953 | 17 | 19,906 |
No | output | 1 | 9,953 | 17 | 19,907 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Smart Beaver decided to be not only smart, but also a healthy beaver! And so he began to attend physical education classes at school X. In this school, physical education has a very creative teacher. One of his favorite warm-up exercises is ... | instruction | 0 | 10,292 | 17 | 20,584 |
Tags: brute force, dp
Correct Solution:
```
m = 1000000007
n = int(input())
a = map(int, input().split())
t1, t2 = 0, 0
for i in a:
if i == 1:
t1 += 1
else:
t2 += 1
a = [1, 2]
for i in range(3, t1+1):
a = a[::-1]
a[1] = (a[0]+(i-1)*a[1])%m
if not t1 or t1 == 1:
a[1] = 1
for i in range(t1+1, n+1):
a[1] = a[1]*... | output | 1 | 10,292 | 17 | 20,585 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Smart Beaver decided to be not only smart, but also a healthy beaver! And so he began to attend physical education classes at school X. In this school, physical education has a very creative tea... | instruction | 0 | 10,293 | 17 | 20,586 |
No | output | 1 | 10,293 | 17 | 20,587 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,648 | 17 | 21,296 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(500000)
N=int(input())
depth=[-1]*N
parent=[-1]*N
childs=[[] for i in range(N)]
depth[0]=0
def calc_depth(n):
for child in childs[n]:
depth[child]=depth[n]+1
calc_depth(child)
def calc_height(n):
if childs[n]==[]:
return 0
... | output | 1 | 10,648 | 17 | 21,297 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,649 | 17 | 21,298 |
"Correct Solution:
```
#12:36
n = int(input())
peer = [[] for _ in range(n)]
for i in range(1,n):
j = int(input())-1
peer[i].append(j)
peer[j].append(i)
pre = [0 for _ in range(n)]
pre[0] = 10**6
seen = [0 for _ in range(n)]
seen[0] = 1
rank = []
now = [0]
while now:
rank.append(now)
last = now
now = []
f... | output | 1 | 10,649 | 17 | 21,299 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,650 | 17 | 21,300 |
"Correct Solution:
```
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5 + 5) # 再帰回数の上限!!
n = int(input())
A = [-1] + [int(input()) - 1 for i in range(n-1)]
M = [[] for i in range(n)]
for i in range(1, n):
M[A[i]].append(i)
# 0-indexedの場合
V = [0] * n
# print(M)
def des(x):
D = []
V[x]... | output | 1 | 10,650 | 17 | 21,301 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,651 | 17 | 21,302 |
"Correct Solution:
```
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
f... | output | 1 | 10,651 | 17 | 21,303 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,652 | 17 | 21,304 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10 ** 6)
def main():
N, *A = map(int, open(0))
E = [[] for _ in range(N + 1)]
for i, v in enumerate(A, 1):
E[v - 1].append(i)
def dfs(v):
D = sorted(map(dfs, E[v]))
return max([0] + [len(D) - i + d for i, d in enumerate(D... | output | 1 | 10,652 | 17 | 21,305 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,653 | 17 | 21,306 |
"Correct Solution:
```
from collections import deque
import sys
input = sys.stdin.buffer.readline
N = int(input())
child = [[] for _ in range(N+1)]
for i in range(2, N+1):
par = int(input())
child[par].append(i)
que = deque()
que.append(1)
seq = []
while que:
v = que.popleft()
seq.append(v)
for u ... | output | 1 | 10,653 | 17 | 21,307 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,654 | 17 | 21,308 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10**6)
n = int(input())
tree = [list() for _ in range(n+1)]
for i in range(2,n+1):
a = int(input())
tree[a].append(i)
win = [0]*(n+1)
def dfs(v,win):
if tree[v] == []:
win[v] = 0
return win[v]
l = list()
for x in tree[v]:
dfs(x,win)
... | output | 1 | 10,654 | 17 | 21,309 |
Provide a correct Python 3 solution for this coding contest problem.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to... | instruction | 0 | 10,655 | 17 | 21,310 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
from sys import setrecursionlimit
setrecursionlimit(10000000)
N = int(input())
C = [[] for _ in range(N)]
for i in range(1, N):
C[int(input())-1].append(i)
def cal(x):
if len(C[x]) == 0:
return 0
else:
D = sorted([cal(a) for a in C[x]], rever... | output | 1 | 10,655 | 17 | 21,311 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, t... | instruction | 0 | 10,658 | 17 | 21,316 |
Yes | output | 1 | 10,658 | 17 | 21,317 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, t... | instruction | 0 | 10,660 | 17 | 21,320 |
No | output | 1 | 10,660 | 17 | 21,321 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, t... | instruction | 0 | 10,661 | 17 | 21,322 |
No | output | 1 | 10,661 | 17 | 21,323 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, t... | instruction | 0 | 10,662 | 17 | 21,324 |
No | output | 1 | 10,662 | 17 | 21,325 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, t... | instruction | 0 | 10,663 | 17 | 21,326 |
No | output | 1 | 10,663 | 17 | 21,327 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,784 | 17 | 21,568 |
"Correct Solution:
```
import sys
n = int(input())
goods = [None] * n
for i, line in enumerate(sys.stdin.readlines()):
value, weight, serial, date, name = line.split()
goods[i] = (int(value), int(weight), serial, int(date), name)
goods.sort() #key=lambda x: (x[0], x[1], x[2], x[3], x[4]))
print('\n'.join(map(l... | output | 1 | 10,784 | 17 | 21,569 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,785 | 17 | 21,570 |
"Correct Solution:
```
n = int(input())
a = [input().split() for i in range(n)]
for i in range(4, -1, -1):
if i==4 or i==2:
a.sort(key=lambda x:x[i])
else:
a.sort(key=lambda x:int(x[i]))
for ele in a:
print(" ".join(map(str, ele)))
``` | output | 1 | 10,785 | 17 | 21,571 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,786 | 17 | 21,572 |
"Correct Solution:
```
n = int(input())
list_items = []
for _ in range(n):
v, w, t, d, s = input().split()
list_items.append([int(v), int(w), t, int(d), s])
for item in sorted(list_items):
print(*item)
``` | output | 1 | 10,786 | 17 | 21,573 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,787 | 17 | 21,574 |
"Correct Solution:
```
n = int(input())
tbl = []
for i in range(n):
a = input().split()
tbl.append((int(a[0]), int(a[1]), a[2], int(a[3]), a[4]))
tbl.sort()
for i in tbl:
print(*i)
``` | output | 1 | 10,787 | 17 | 21,575 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,788 | 17 | 21,576 |
"Correct Solution:
```
#組み込み関数頼み
#整数に直さないと2>10
n = int(input())
P = []
for _ in range(n):
p = list(map(str, input().split( )))
P.append(p)
for _ in range(n):
for i in range(2):
P[_][i] = int(P[_][i])
P[_][3] = int(P[_][3])
P.sort()
P.sort()
for _ in range(n):
print(*P[_])
``` | output | 1 | 10,788 | 17 | 21,577 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,789 | 17 | 21,578 |
"Correct Solution:
```
n=int(input())
tuples=[]
for _ in range(n):
obj=input().split(" ")
obj[0]=int(obj[0])
obj[1]=int(obj[1])
obj[3]=int(obj[3])
tuples.append(obj)
tuples=sorted(tuples)
for t in tuples:
print(t[0],t[1],t[2],t[3],t[4])
``` | output | 1 | 10,789 | 17 | 21,579 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,790 | 17 | 21,580 |
"Correct Solution:
```
class Tuple():
def __init__(self, v, w, t, d, s):
self.v = v
self.w = w
self.t = t
self.d = d
self.s = s
def main():
n = int(input())
Tuples = list()
for _ in range(n):
v, w, t, d, s = input().split()
p = Tuple(int(v), int(... | output | 1 | 10,790 | 17 | 21,581 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, integer, string $\\}$ respectively. Sort the items based on ... | instruction | 0 | 10,791 | 17 | 21,582 |
"Correct Solution:
```
n = int(input())
l = []
for i in range(n):
a = input().split()
l.append((int(a[0]), int(a[1]), a[2], int(a[3]), a[4]))
l.sort()
for i in l:
print(*i)
``` | output | 1 | 10,791 | 17 | 21,583 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, inte... | instruction | 0 | 10,792 | 17 | 21,584 |
Yes | output | 1 | 10,792 | 17 | 21,585 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, inte... | instruction | 0 | 10,793 | 17 | 21,586 |
Yes | output | 1 | 10,793 | 17 | 21,587 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, inte... | instruction | 0 | 10,794 | 17 | 21,588 |
Yes | output | 1 | 10,794 | 17 | 21,589 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, inte... | instruction | 0 | 10,795 | 17 | 21,590 |
Yes | output | 1 | 10,795 | 17 | 21,591 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which reads $n$ items and sorts them. Each item has attributes $\\{value, weight, type, date, name\\}$ and they are represented by $\\{$ integer, integer, upper-case letter, inte... | instruction | 0 | 10,796 | 17 | 21,592 |
No | output | 1 | 10,796 | 17 | 21,593 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In a small but very proud high school it was decided to win ACM ICPC. This goal requires to compose as many teams of three as possible, but since there were only 6 students who wished to participate, the decision was to build exactly two tea... | instruction | 0 | 11,333 | 17 | 22,666 |
Tags: brute force
Correct Solution:
```
import itertools
a = [int(x) for x in input().split()]
index = list(range(6))
b = list(itertools.combinations(index, 3))
c = len(b)
for z in range(c):
for x in range(z+1, c):
if not any([y in b[x] for y in b[z]]):
if sum(a[y] for y in b[z]) == sum(a[y] ... | output | 1 | 11,333 | 17 | 22,667 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In a small but very proud high school it was decided to win ACM ICPC. This goal requires to compose as many teams of three as possible, but since there were only 6 students who wished to participate, the decision was to build exactly two tea... | instruction | 0 | 11,334 | 17 | 22,668 |
Tags: brute force
Correct Solution:
```
n = list(map(int,input().split()))
#n = int(input())
x = len(n)
checked = [False,False,False,False,False,False]
def check(cur1,cur2):
if sum(checked)==6:
if cur1==cur2:
print("YES")
exit()
for i in range(x):
if checked[i] == False:... | output | 1 | 11,334 | 17 | 22,669 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In a small but very proud high school it was decided to win ACM ICPC. This goal requires to compose as many teams of three as possible, but since there were only 6 students who wished to participate, the decision was to build exactly two tea... | instruction | 0 | 11,335 | 17 | 22,670 |
Tags: brute force
Correct Solution:
```
from itertools import combinations
l=list(map(int,input().split()))
s=sum(l);f=0
if s%2!=0:
print("NO")
f=1
else:
for i in combinations(l, 3):
if sum(i)==s//2:
print("YES")
f=1
break
if f==0:print("NO")
``` | output | 1 | 11,335 | 17 | 22,671 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.