message stringlengths 2 48.6k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 318 108k | cluster float64 8 8 | __index_level_0__ int64 636 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Bes... | instruction | 0 | 4,499 | 8 | 8,998 |
No | output | 1 | 4,499 | 8 | 8,999 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,572 | 8 | 9,144 |
Tags: brute force, math
Correct Solution:
```
n,a,b = map(int, input().split())
if a*b > 6*n:
print(a*b)
print(str(a)+" "+str(b))
exit()
rev = False
if a>b:
rev = True
tmp = a
a = b
b = tmp
size = 6*n
while True:
flag = False
small = 0
i = a
while i*i < size:
if ((... | output | 1 | 4,572 | 8 | 9,145 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,573 | 8 | 9,146 |
Tags: brute force, math
Correct Solution:
```
from math import *
n,a,b = map(int,input().split())
ans = (10000005700000,1000000000064000)
ansp = 10**55
if a*b>=6*n:
ans = (a,b)
ansp = a*b
for x in range(int(sqrt(6*n)*1.33)):
yy = max(0,ceil((6*n-a*b-b*x)/(a+x))-1)
for y in range(yy,yy+3):
if 6*... | output | 1 | 4,573 | 8 | 9,147 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,574 | 8 | 9,148 |
Tags: brute force, math
Correct Solution:
```
n,a,b = [int(x) for x in input().split()]
n *= 6
if a*b >= n:
print(a*b)
print(a,b)
else:
reverse = False
if b < a:
reverse = True
a,b = b,a
low = float('inf')
lowNums = [0,0]
for x in range(a, min(int(n**0.5),n//b)+1):
second = n//x
if n%x !... | output | 1 | 4,574 | 8 | 9,149 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,575 | 8 | 9,150 |
Tags: brute force, math
Correct Solution:
```
import math
line = input().split()
n = int(line[0])
a = int(line[1])
b = int(line[2])
desired = 6 * n
if a * b >= desired:
print(a * b)
print(a, b)
else:
smallest = min(a, b)
largest = max(a,b)
num = desired
found = False
while True:
i ... | output | 1 | 4,575 | 8 | 9,151 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,576 | 8 | 9,152 |
Tags: brute force, math
Correct Solution:
```
import sys
from math import ceil
input=sys.stdin.readline
n,a,b=map(int,input().split())
if 6*n<=a*b:
print(a*b)
print(a,b)
exit()
p=6*n
flag=False
if a>b:
a,b=b,a
flag=True
ans=10**18
ans_a,ans_b=-1,-1
for i in range(1,int(p**0.5)+1):
u=i;v=ceil(p/i... | output | 1 | 4,576 | 8 | 9,153 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,577 | 8 | 9,154 |
Tags: brute force, math
Correct Solution:
```
import sys
def fastio():
from io import StringIO
from atexit import register
global input
sys.stdin = StringIO(sys.stdin.read())
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.stdout = StringIO()
register(lambda : sys.__stdout__.write(s... | output | 1 | 4,577 | 8 | 9,155 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,578 | 8 | 9,156 |
Tags: brute force, math
Correct Solution:
```
import sys
import math
def calc():
global ans, a, b
n, a, b = map(int, input().strip().split(' '))
n *= 6
if a*b >= n:
print("%i %i %i" % (a*b, a, b))
sys.exit(0)
m = int(math.sqrt(n)) + 10
ans = (10**15, 0, 0)
for i in range(m):
k = max(b, n // (a + i))
if ... | output | 1 | 4,578 | 8 | 9,157 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to accommodate exactly n students there. But the law s... | instruction | 0 | 4,579 | 8 | 9,158 |
Tags: brute force, math
Correct Solution:
```
"""
Codeforces Contest 266 Div 2 Problem B
Author : chaotic_iak
Language: Python 3.3.4
"""
def ceildiv(a,b):
return a//b + (1 if a%b else 0)
def main():
n,a,b = read()
s = 6*n
if a*b >= s:
print(a*b)
print(a,b)
return
t = int(... | output | 1 | 4,579 | 8 | 9,159 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,580 | 8 | 9,160 |
Yes | output | 1 | 4,580 | 8 | 9,161 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,581 | 8 | 9,162 |
Yes | output | 1 | 4,581 | 8 | 9,163 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,582 | 8 | 9,164 |
Yes | output | 1 | 4,582 | 8 | 9,165 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,583 | 8 | 9,166 |
Yes | output | 1 | 4,583 | 8 | 9,167 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,584 | 8 | 9,168 |
No | output | 1 | 4,584 | 8 | 9,169 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,585 | 8 | 9,170 |
No | output | 1 | 4,585 | 8 | 9,171 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,586 | 8 | 9,172 |
No | output | 1 | 4,586 | 8 | 9,173 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a Γ b square meter wonder room. The caretaker wants to acco... | instruction | 0 | 4,587 | 8 | 9,174 |
No | output | 1 | 4,587 | 8 | 9,175 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,635 | 8 | 9,270 |
Tags: implementation, math
Correct Solution:
```
s = input()
c = s.split(" ")
n = int(c[0])
r = int(c[1])
s = int(c[2])
print((r-1+s) % n + 1)
``` | output | 1 | 4,635 | 8 | 9,271 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,636 | 8 | 9,272 |
Tags: implementation, math
Correct Solution:
```
# -*- coding: utf-8 -*-
import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
"""
created by shhuan at 2017/11/24 13:57
"""
n, a, b = map(int, input().split())
ans = (a + b - 1 + n * abs(b)) % n + 1
print(ans... | output | 1 | 4,636 | 8 | 9,273 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,637 | 8 | 9,274 |
Tags: implementation, math
Correct Solution:
```
n,a,r=list(map(int,input().split()))
if r>0:
for x in range(5555555):
if r!=0:
if a!=n:
a+=1
r-=1
else:
a=1
r-=1
else:
break
print(a)
else:
for... | output | 1 | 4,637 | 8 | 9,275 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,638 | 8 | 9,276 |
Tags: implementation, math
Correct Solution:
```
n,a,b = map(int,input().split())
print(n if (a+b)%n==0 else (a+b)%n)
``` | output | 1 | 4,638 | 8 | 9,277 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,639 | 8 | 9,278 |
Tags: implementation, math
Correct Solution:
```
n,x,y=map(int,input().split(' '))
if((x+y)%n ==0 ):
print(n)
else:
print ((x+y)%n)
``` | output | 1 | 4,639 | 8 | 9,279 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,640 | 8 | 9,280 |
Tags: implementation, math
Correct Solution:
```
n,a,b=map(int,input().split())
if b>=0:
x=a+b
else:
x=n+(a+b)
print(n if x%n==0 else x%n)
``` | output | 1 | 4,640 | 8 | 9,281 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,641 | 8 | 9,282 |
Tags: implementation, math
Correct Solution:
```
num_entrances, start, movement = map(int, input().split())
end = (start + movement) % num_entrances
if end < 1:
end = num_entrances - end
print(end)
``` | output | 1 | 4,641 | 8 | 9,283 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decid... | instruction | 0 | 4,642 | 8 | 9,284 |
Tags: implementation, math
Correct Solution:
```
# Description of the problem can be found at http://codeforces.com/problemset/problem/659/A
n, a, b = map(int, input().split())
b %= n
print(((a + b) % n) if (a + b) % n != 0 else n)
``` | output | 1 | 4,642 | 8 | 9,285 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,643 | 8 | 9,286 |
Yes | output | 1 | 4,643 | 8 | 9,287 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,644 | 8 | 9,288 |
Yes | output | 1 | 4,644 | 8 | 9,289 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,645 | 8 | 9,290 |
Yes | output | 1 | 4,645 | 8 | 9,291 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,646 | 8 | 9,292 |
Yes | output | 1 | 4,646 | 8 | 9,293 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,647 | 8 | 9,294 |
No | output | 1 | 4,647 | 8 | 9,295 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,648 | 8 | 9,296 |
No | output | 1 | 4,648 | 8 | 9,297 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,649 | 8 | 9,298 |
No | output | 1 | 4,649 | 8 | 9,299 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in t... | instruction | 0 | 4,650 | 8 | 9,300 |
No | output | 1 | 4,650 | 8 | 9,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,675 | 8 | 9,350 |
Yes | output | 1 | 4,675 | 8 | 9,351 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,676 | 8 | 9,352 |
Yes | output | 1 | 4,676 | 8 | 9,353 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,677 | 8 | 9,354 |
Yes | output | 1 | 4,677 | 8 | 9,355 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,678 | 8 | 9,356 |
Yes | output | 1 | 4,678 | 8 | 9,357 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,679 | 8 | 9,358 |
No | output | 1 | 4,679 | 8 | 9,359 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,680 | 8 | 9,360 |
No | output | 1 | 4,680 | 8 | 9,361 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,681 | 8 | 9,362 |
No | output | 1 | 4,681 | 8 | 9,363 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two wo... | instruction | 0 | 4,682 | 8 | 9,364 |
No | output | 1 | 4,682 | 8 | 9,365 |
Provide a correct Python 3 solution for this coding contest problem.
There was a big old mansion in one place, and one cat settled in. As shown in the figure, the mansion has a convex polygonal shape when viewed from above, and is made up of several rooms surrounded by straight walls. One wall is supported by pillars ... | instruction | 0 | 4,963 | 8 | 9,926 |
"Correct Solution:
```
from math import atan2
from collections import defaultdict, deque
def cross(a, b, c):
return (b[0]-a[0])*(c[1]-a[1]) - (b[1]-a[1])*(c[0]-a[0])
def convex_hull(ps):
qs = []
n = len(ps)
for p in ps:
while len(qs)>1 and cross(qs[-1], qs[-2], p) > 0:
qs.pop()
... | output | 1 | 4,963 | 8 | 9,927 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,061 | 8 | 10,122 |
Tags: greedy, implementation
Correct Solution:
```
n,s=input().split()
n=int(n)
s=int(s)
l=input().split()
l=list(map(int,l))
x=sum(l)
m=min(l)
h=len(l)
if x<s:
print(-1)
elif m*h<=(x-s):
print(m)
else:
q=(m*h-(x-s))/h
if int(q)==q:
print(m-int(q))
else:
print(m-(int(q)+1))
``` | output | 1 | 5,061 | 8 | 10,123 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,062 | 8 | 10,124 |
Tags: greedy, implementation
Correct Solution:
```
ss = 0
n, s = map(int, input().split())
v = list(map(int, input().split()))
m,ss = min(v), sum(v)
if ss < s:
print(-1)
else:
print(min(m, (ss-s)//n))
``` | output | 1 | 5,062 | 8 | 10,125 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,063 | 8 | 10,126 |
Tags: greedy, implementation
Correct Solution:
```
n, s = map(int, input().split())
allCups = list(map(int, input().split()))
sumK = sum(allCups)
minK = min(allCups)
if sumK < s:
print(-1)
else:
if sumK - (minK * n) >= s:
print(minK)
else:
s = s - (sumK - (minK * n))
#print(s)
... | output | 1 | 5,063 | 8 | 10,127 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,064 | 8 | 10,128 |
Tags: greedy, implementation
Correct Solution:
```
n, m = map(int, input().strip().split())
kegs = list(map(int, input().strip().split()))
import math
if sum(kegs) < m : print(-1)
else :
import operator
index, value = min(enumerate(kegs), key=operator.itemgetter(1))
res = m
for i, k in enumerate(kegs)... | output | 1 | 5,064 | 8 | 10,129 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,065 | 8 | 10,130 |
Tags: greedy, implementation
Correct Solution:
```
import math
def main():
n,s = map(int,input().split())
volume = list(map(int,input().split()))
if s > sum(volume):
print(-1)
return
min_val = min(volume)
for i in range(n):
diff = volume[i]-min_val
if s >= diff:
... | output | 1 | 5,065 | 8 | 10,131 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,066 | 8 | 10,132 |
Tags: greedy, implementation
Correct Solution:
```
import sys
a, b = input().split()
a, b = int(a), int(b)
k = input().split()
kk = k[:]
k = []
sum = 0
for i in kk:
a = int(i)
sum += a
k.append(a)
if sum < b:
print(-1)
sys.exit()
k.sort()
least = k[0]
summ = sum - least * len(k)
k = [least for ... | output | 1 | 5,066 | 8 | 10,133 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,067 | 8 | 10,134 |
Tags: greedy, implementation
Correct Solution:
```
def main():
n, s = map(int, input().split())
v = list(map(int, input().split()))
minn = min(v)
summ = 0
alll = 0
for el in v:
alll += el
if alll < s:
print(-1)
return
for i in range(n):
summ += v[i] - minn... | output | 1 | 5,067 | 8 | 10,135 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Fair Nut likes kvass very much. On his birthday parents presented him n kegs of kvass. There are v_i liters of kvass in the i-th keg. Each keg has a lever. You can pour your glass by exactly 1 liter pulling this lever. The Fair Nut likes... | instruction | 0 | 5,068 | 8 | 10,136 |
Tags: greedy, implementation
Correct Solution:
```
n,s=map(int,input().split())
a=[int(i) for i in input().split()]
mini=min(a)
t=0
for i in range(n):
t=t+a[i]-mini
if(t>=s):
print(mini)
elif(s>sum(a)):
print("-1")
else:
rem=s-t
if(rem//n==rem/n):
k=rem//n
print(mini-k)
else:
... | output | 1 | 5,068 | 8 | 10,137 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.