message stringlengths 2 22.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 145 109k | cluster float64 9 9 | __index_level_0__ int64 290 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,507 | 9 | 19,014 |
Tags: data structures, dp
Correct Solution:
```
# [https://codeforces.com/contest/629/submission/32426374]
import math
n = int(input())
p = [0] * n
for i in range(n):
(r, h) = map(int, input().split())
p[i] = r**2 * h
k = {v: j for j, v in enumerate(sorted(set(p)))}
d = [0] * (len(k) + 1)
for v in p:
j = ... | output | 1 | 9,507 | 9 | 19,015 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,508 | 9 | 19,016 |
Tags: data structures, dp
Correct Solution:
```
from math import pi
n = int(input())
secuencia = [None] * n
maximo_to = -1
for num in range(n):
r, h = (int(x) for x in input().strip().split())
secuencia[num] = [r * r * h, num + 1]
secuencia.reverse()
secuencia.sort(key=lambda x: x[0])
actual = 0
bit = [0] * (n ... | output | 1 | 9,508 | 9 | 19,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,509 | 9 | 19,018 |
Tags: data structures, dp
Correct Solution:
```
from sys import *
t = list(map(int, stdin.read().split()))
p = [t[i + 1] * t[i] ** 2 for i in range(1, len(t), 2)]
k = {v: j for j, v in enumerate(sorted(set(p)))}
d = [0] * (len(k) + 1)
for v in p:
j = k[v]
i = j + 1
q = 0
while j > 0:
q = max(d[... | output | 1 | 9,509 | 9 | 19,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,510 | 9 | 19,020 |
Tags: data structures, dp
Correct Solution:
```
def add(i, q):
while i < len(d):
d[i] = max(d[i], q)
i += i & -i
def get(i):
q = 0
while i > 0:
q = max(d[i], q)
i -= i & -i
return q
from sys import *
t = list(map(int, stdin.read().split()))
p = [t[i] * t[i] * t[i + 1] for... | output | 1 | 9,510 | 9 | 19,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,511 | 9 | 19,022 |
Tags: data structures, dp
Correct Solution:
```
import math
from functools import reduce
class SegmentTree():
def __init__(self, L, function = lambda x,y: x+y):
self.function = function
N = self.size = len(L)
M = 1 << N.bit_length()
self.margin = 2*M - N
self.L = [None for i ... | output | 1 | 9,511 | 9 | 19,023 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,512 | 9 | 19,024 |
Tags: data structures, dp
Correct Solution:
```
from math import *
from bisect import *
def update(bit, size, idx, amount):
while idx <= size:
if bit[idx] < amount:
bit[idx] = amount
idx += idx & -idx
def read(bit, idx):
rst = 0
while idx >= 1:
if bit[idx] > rst:
... | output | 1 | 9,512 | 9 | 19,025 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresp... | instruction | 0 | 9,513 | 9 | 19,026 |
Tags: data structures, dp
Correct Solution:
```
from math import *
from bisect import *
def update(bit, size, idx, amount):
while idx <= size:
if bit[idx] < amount:
bit[idx] = amount
idx += idx & -idx
def read(bit, idx):
rst = 0
while idx >= 1:
if bit[idx] > rst:
... | output | 1 | 9,513 | 9 | 19,027 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of th... | instruction | 0 | 9,514 | 9 | 19,028 |
No | output | 1 | 9,514 | 9 | 19,029 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of th... | instruction | 0 | 9,515 | 9 | 19,030 |
No | output | 1 | 9,515 | 9 | 19,031 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of th... | instruction | 0 | 9,516 | 9 | 19,032 |
No | output | 1 | 9,516 | 9 | 19,033 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.
Simple cake is a cylinder of some radius and height. The volume of th... | instruction | 0 | 9,517 | 9 | 19,034 |
No | output | 1 | 9,517 | 9 | 19,035 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,594 | 9 | 19,188 |
Tags: implementation
Correct Solution:
```
n,k=map(int,input().split())
a=list(map(int,input().split()))
summ=0
for j in range(n):
summ+=a[j]
if n*8>=k and k<=summ:
carramel=0
for i in range(n):
carramel+=a[i]
if carramel>8:
k-=8
carramel-=8
else:
... | output | 1 | 9,594 | 9 | 19,189 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,595 | 9 | 19,190 |
Tags: implementation
Correct Solution:
```
n, k = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
s += l[i]
k -= min(s, 8)
s -= min(s, 8)
if k <= 0:
print(i + 1)
exit(0)
print(-1)
``` | output | 1 | 9,595 | 9 | 19,191 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,596 | 9 | 19,192 |
Tags: implementation
Correct Solution:
```
n, k = map(int, input().split())
l = list(map(int, input().split()))
have = 0
for i in range(0, n):
have+=l[i]
x= min(8, have)
k -=x
have-=x
if k<=0:
print(i+1)
exit()
print(-1)
``` | output | 1 | 9,596 | 9 | 19,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,597 | 9 | 19,194 |
Tags: implementation
Correct Solution:
```
n,k = list(map(int, input().rstrip().split()))
days = list(map(int, input().rstrip().split()))
r = 0
for i, a in enumerate(days):
if a + r > 8:
r += a - 8
k -= 8
else:
k -= a + r
r = 0;
if k <= 0:
print(i + 1)
break
else:
print(-1)
``` | output | 1 | 9,597 | 9 | 19,195 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,598 | 9 | 19,196 |
Tags: implementation
Correct Solution:
```
import sys
read=lambda:sys.stdin.readline().rstrip()
readi=lambda:int(sys.stdin.readline())
writeln=lambda x:sys.stdout.write(str(x)+"\n")
write=lambda x:sys.stdout.write(x)
N, K = map(int, read().split())
ns = list(map(int, read().split()))
A,B = 0,0
ans = -1
for i in range(... | output | 1 | 9,598 | 9 | 19,197 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,599 | 9 | 19,198 |
Tags: implementation
Correct Solution:
```
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
count=0
ana,f=0,0
ans=0
for val in a:
if ans>=k:
f=1
break
if val+ana<=8:
ans+=val+ana
ana=0
count+=1
else:
ana=(val+ana)-8
count+=1
... | output | 1 | 9,599 | 9 | 19,199 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,600 | 9 | 19,200 |
Tags: implementation
Correct Solution:
```
n, k = map(int, input().split())
a = list(map(int, input().split()))
c = d = 0
for i in range(n):
add = min(8, c + a[i])
if add >= 8: c = c + a[i] - add
else: c = 0
d += add
if d >= k:
print(i + 1)
break
else:
print(-1)
``` | output | 1 | 9,600 | 9 | 19,201 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is... | instruction | 0 | 9,601 | 9 | 19,202 |
Tags: implementation
Correct Solution:
```
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
x = 0
y = 0
z = 0
b = 0
for i in a:
b += 1
x += i
if x >= 8:
y += 8
else:
y += x
x -= 8
if x<0:
x = 0
if y >= k:
z = i
break
... | output | 1 | 9,601 | 9 | 19,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,602 | 9 | 19,204 |
Yes | output | 1 | 9,602 | 9 | 19,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,603 | 9 | 19,206 |
Yes | output | 1 | 9,603 | 9 | 19,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,604 | 9 | 19,208 |
Yes | output | 1 | 9,604 | 9 | 19,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,605 | 9 | 19,210 |
Yes | output | 1 | 9,605 | 9 | 19,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,606 | 9 | 19,212 |
No | output | 1 | 9,606 | 9 | 19,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,607 | 9 | 19,214 |
No | output | 1 | 9,607 | 9 | 19,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,608 | 9 | 19,216 |
No | output | 1 | 9,608 | 9 | 19,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.
At first, Arya and Bran have 0 Candies. There are n days, at the i-... | instruction | 0 | 9,609 | 9 | 19,218 |
No | output | 1 | 9,609 | 9 | 19,219 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,785 | 9 | 19,570 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0120
"""
import sys
from sys import stdin
input = stdin.readline
def calc_width(cakes):
# ??±????????????????????????(?????????)????????????????????????????????????????¨??????????
if len(cakes) == 1:
... | output | 1 | 9,785 | 9 | 19,571 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,786 | 9 | 19,572 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0120
"""
import sys
from sys import stdin
input = stdin.readline
def calc_width(cakes):
# ??±????????????????????????(?????????)????????????????????????????????????????¨??????????
if len(cakes) == 1:
... | output | 1 | 9,786 | 9 | 19,573 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,787 | 9 | 19,574 |
"Correct Solution:
```
INF = 10 ** 20
def get_dist(r1, r2):
return ((r1 + r2) ** 2 - (r1 - r2) ** 2) ** (1 / 2)
def minimum_width(rest, r, dic):
if (rest, r) in dic:
return dic[(rest, r)]
if rest == ():
return r
ret = INF
lenr = len(rest)
for c in rest:
next_rest = list(rest)
next_rest.rem... | output | 1 | 9,787 | 9 | 19,575 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,788 | 9 | 19,576 |
"Correct Solution:
```
#######################################################################################
import sys
from math import sqrt
def rec(state, v):
if state == (1 << N) - 1:
return cakes[v]
if dp[state][v] != -1:
return dp[state][v]
ret = INF
for u in range(N):
... | output | 1 | 9,788 | 9 | 19,577 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,789 | 9 | 19,578 |
"Correct Solution:
```
import sys
from math import sqrt
def rec(state, v):
if state == (1 << N) - 1:
return cakes[v]
if dp[state][v] != -1:
return dp[state][v]
ret = INF
for i in range(N):
if state == 0:
ret = min(ret, rec(1 << i, i) + cakes[i])
elif not (s... | output | 1 | 9,789 | 9 | 19,579 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,790 | 9 | 19,580 |
"Correct Solution:
```
from collections import deque
def calcwidth(cks):
if len(cks) == 1: return cks[0]*2
width = cks[0] + cks[-1]
for ck1,ck2 in zip(cks[:-1],cks[1:]):
width += ((ck1+ck2)**2-(ck1-ck2)**2)**0.5
return width
while True:
try: W, *rs = list(map(float,input().split()))
ex... | output | 1 | 9,790 | 9 | 19,581 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,791 | 9 | 19,582 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0120
"""
import sys
from sys import stdin
input = stdin.readline
def calc_width(cakes):
# ??±????????????????????????(?????????)????????????????????????????????????????¨??????????
if len(cakes) == 1:
... | output | 1 | 9,791 | 9 | 19,583 |
Provide a correct Python 3 solution for this coding contest problem.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. Therefore, as shown in Fig. (A), all roll cakes must be a... | instruction | 0 | 9,792 | 9 | 19,584 |
"Correct Solution:
```
import sys
from math import sqrt
def rec(state, v):
if state == (1 << N) - 1:
return cakes[v]
if dp[state][v] != -1:
return dp[state][v]
ret = INF
for u in range(N):
if state == 0:
ret = min(ret, rec(1 << u, u) + cakes[u])
elif not (s... | output | 1 | 9,792 | 9 | 19,585 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. T... | instruction | 0 | 9,793 | 9 | 19,586 |
Yes | output | 1 | 9,793 | 9 | 19,587 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. T... | instruction | 0 | 9,794 | 9 | 19,588 |
Yes | output | 1 | 9,794 | 9 | 19,589 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. T... | instruction | 0 | 9,795 | 9 | 19,590 |
Yes | output | 1 | 9,795 | 9 | 19,591 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. T... | instruction | 0 | 9,796 | 9 | 19,592 |
No | output | 1 | 9,796 | 9 | 19,593 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. T... | instruction | 0 | 9,798 | 9 | 19,596 |
No | output | 1 | 9,798 | 9 | 19,597 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cake shop made a lot of roll cakes of various sizes. You have been tasked with arranging this cake in a box.
The roll cake is so soft that it will collapse if another roll cake is on top. T... | instruction | 0 | 9,799 | 9 | 19,598 |
No | output | 1 | 9,799 | 9 | 19,599 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,005 | 9 | 20,010 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
n=int(input())
for i in range(n):
a,b,c=[int(x) for x in input().split()]
if abs(a-b)<=c or abs(b-c)<=a or abs(c-a)<=b:
print((a+b+c)//2)
else:
print(min[a+b,b+c,c+a])
``` | output | 1 | 10,005 | 9 | 20,011 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,006 | 9 | 20,012 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
import sys
input = sys.stdin.readline
q=int(input())
for i in range(q):
A=[int(i) for i in input().split()]
print(sum(A)//2)
``` | output | 1 | 10,006 | 9 | 20,013 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,007 | 9 | 20,014 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
t=int(input())
for _ in range(0,t):
a,b,c=map(int,input().split())
print ((a+b+c)//2)
``` | output | 1 | 10,007 | 9 | 20,015 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,008 | 9 | 20,016 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
q = int(input())
for i in range(q):
s = sum(list(map(int, input().split())))
print(s // 2)
``` | output | 1 | 10,008 | 9 | 20,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,009 | 9 | 20,018 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
def main():
t = int(input())
for i in range(t):
a,b,c = tuple(map(int, input().split()))
print((a + b + c)//2)
if __name__=='__main__':
main()
``` | output | 1 | 10,009 | 9 | 20,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,010 | 9 | 20,020 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
for _ in range(int(input())):
a,b,c = list(map(int,input().split()))
if (a+b+c) % 2 == 0:
print((a+b+c)//2)
else:
print((a+b+c-1)//2)
``` | output | 1 | 10,010 | 9 | 20,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,011 | 9 | 20,022 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
a = int(input())
for i in range(a):
z, x, c = map(int, input().split())
s = z + x + c
s = s // 2
print(s)
``` | output | 1 | 10,011 | 9 | 20,023 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split betwe... | instruction | 0 | 10,012 | 9 | 20,024 |
Tags: brute force, constructive algorithms, math
Correct Solution:
```
q = int(input())
for i in range(q):
s = sum([int(x) for x in input().split(" ")])
print(s//2)
``` | output | 1 | 10,012 | 9 | 20,025 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of th... | instruction | 0 | 10,013 | 9 | 20,026 |
Yes | output | 1 | 10,013 | 9 | 20,027 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.