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 tags and a correct Python 3 solution for this coding contest problem.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corre... | instruction | 0 | 21,743 | 17 | 43,486 |
Tags: implementation, strings
Correct Solution:
```
a=list(input())
a=[int(i) for i in a]
if len(a)>7:
F=False
for i in range (len(a)-6):
if a[i]==a[i+1]==a[i+2]==a[i+3]==a[i+4]==a[i+5]==a[i+6]==1 or a[i]==a[i+1]==a[i+2]==a[i+3]==a[i+4]==a[i+5]==a[i+6]==0:
F=True
else:
co... | output | 1 | 21,743 | 17 | 43,487 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corre... | instruction | 0 | 21,745 | 17 | 43,490 |
Tags: implementation, strings
Correct Solution:
```
line = input()
counter = 0
curr = line[0]
for i in line:
if i == curr:
counter+=1
if counter >=7:
print("YES")
exit()
else:
counter = 1
curr = i
print("NO")
``` | output | 1 | 21,745 | 17 | 43,491 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,748 | 17 | 43,496 |
Yes | output | 1 | 21,748 | 17 | 43,497 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,749 | 17 | 43,498 |
Yes | output | 1 | 21,749 | 17 | 43,499 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,750 | 17 | 43,500 |
Yes | output | 1 | 21,750 | 17 | 43,501 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,751 | 17 | 43,502 |
Yes | output | 1 | 21,751 | 17 | 43,503 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,752 | 17 | 43,504 |
No | output | 1 | 21,752 | 17 | 43,505 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,753 | 17 | 43,506 |
No | output | 1 | 21,753 | 17 | 43,507 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,754 | 17 | 43,508 |
No | output | 1 | 21,754 | 17 | 43,509 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str... | instruction | 0 | 21,755 | 17 | 43,510 |
No | output | 1 | 21,755 | 17 | 43,511 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,301 | 17 | 44,602 |
Yes | output | 1 | 22,301 | 17 | 44,603 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,302 | 17 | 44,604 |
Yes | output | 1 | 22,302 | 17 | 44,605 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,303 | 17 | 44,606 |
Yes | output | 1 | 22,303 | 17 | 44,607 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,304 | 17 | 44,608 |
Yes | output | 1 | 22,304 | 17 | 44,609 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,305 | 17 | 44,610 |
No | output | 1 | 22,305 | 17 | 44,611 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,306 | 17 | 44,612 |
No | output | 1 | 22,306 | 17 | 44,613 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,307 | 17 | 44,614 |
No | output | 1 | 22,307 | 17 | 44,615 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students numerated from 1 to n. The level of the i-th student is a_i. You need to split the students into stable groups. A group of students is called stable, if in the sorted array ... | instruction | 0 | 22,308 | 17 | 44,616 |
No | output | 1 | 22,308 | 17 | 44,617 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,424 | 17 | 44,848 |
Tags: implementation
Correct Solution:
```
a = sum(list(map(int, input().split())))
b = sum(list(map(int, input().split())))
n = int(input())
print('YES' if (a // 5 + (a % 5 != 0) + b // 10 + (b % 10 != 0)) <= n else 'NO')
``` | output | 1 | 22,424 | 17 | 44,849 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,425 | 17 | 44,850 |
Tags: implementation
Correct Solution:
```
a=list(map(int,input().split()))
b=list(map(int,input().split()))
n=int(input())
s1=sum(a)
s2=sum(b)
if s1%5==0:
c1=int(s1/5)
else:
c1=int(s1/5)+1
if s2%10==0:
c2=int(s2/10)
else:
c2=int(s2/10)+1
if (c1+c2)<=n:
print("YES")
else:
print("NO")
``` | output | 1 | 22,425 | 17 | 44,851 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,426 | 17 | 44,852 |
Tags: implementation
Correct Solution:
```
import math
print((lambda a,b,n: 'YES' if math.ceil(sum(a)/5) + math.ceil(sum(b)/10) <= n else 'NO')(list(map(int,input().split())),list(map(int,input().split())),int(input())))
``` | output | 1 | 22,426 | 17 | 44,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,427 | 17 | 44,854 |
Tags: implementation
Correct Solution:
```
a = list(map(int , input().rstrip().split()))
b = list(map(int , input().rstrip().split()))
c= int(input())
if sum(a)%5 == 0:
a1 = sum(a)/5
else:
a1 = sum(a)//5 + 1
if sum(b)%10 ==0:
b1 = sum(b)/10
else:
b1 = sum(b)//10 + 1
if c>=a1 + b1:
print('YES')
else... | output | 1 | 22,427 | 17 | 44,855 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,428 | 17 | 44,856 |
Tags: implementation
Correct Solution:
```
import math
a = list(map(int,input().split()))
b = list(map(int,input().split()))
n = int(input())
if (((n * 5) >= sum(a)) and (((n - math.ceil(sum(a) / 5)) * 10) >= sum(b))):
print('YES')
else:
print('NO')
``` | output | 1 | 22,428 | 17 | 44,857 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,429 | 17 | 44,858 |
Tags: implementation
Correct Solution:
```
from math import ceil as gh;a=lambda:sum(map(int,input().split()));print("YES" if gh(a()/5)+gh(a()/10)<=int(input()) else "NO")
``` | output | 1 | 22,429 | 17 | 44,859 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,430 | 17 | 44,860 |
Tags: implementation
Correct Solution:
```
a = b = 0
for i in list(int(z) for z in input().split()):
a += i
for i in list(int(z) for z in input().split()):
b += i
print(["YES", "NO"][(a//5+1 if a%5 else a//5)+(b//10+1 if b%10 else b//10)>int(input())])
``` | output | 1 | 22,430 | 17 | 44,861 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medal... | instruction | 0 | 22,431 | 17 | 44,862 |
Tags: implementation
Correct Solution:
```
import math
a1,a2,a3=map(int,input().split())
b1,b2,b3=map(int,input().split())
n=int(input())
a=(a1+a2+a3)/5
b=(b1+b2+b3)/10
c=math.ceil(a)
d=math.ceil(b)
if(c+d<=n):
print("YES")
else:
print("NO")
``` | output | 1 | 22,431 | 17 | 44,863 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,432 | 17 | 44,864 |
Yes | output | 1 | 22,432 | 17 | 44,865 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,433 | 17 | 44,866 |
Yes | output | 1 | 22,433 | 17 | 44,867 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,434 | 17 | 44,868 |
Yes | output | 1 | 22,434 | 17 | 44,869 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,435 | 17 | 44,870 |
Yes | output | 1 | 22,435 | 17 | 44,871 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,436 | 17 | 44,872 |
No | output | 1 | 22,436 | 17 | 44,873 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,437 | 17 | 44,874 |
No | output | 1 | 22,437 | 17 | 44,875 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,438 | 17 | 44,876 |
No | output | 1 | 22,438 | 17 | 44,877 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All th... | instruction | 0 | 22,439 | 17 | 44,878 |
No | output | 1 | 22,439 | 17 | 44,879 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,440 | 17 | 44,880 |
Tags: implementation
Correct Solution:
```
###############################################################
# Getting Problem-Data from Codeforces.
shirtCounts = list(map(int,input().split(' ')))
# Specifying preferences based on size demanded.
preferences = {
'S' :['S','M','L','XL','XXL'],
'M' :['M','L','S','XL','X... | output | 1 | 22,440 | 17 | 44,881 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,441 | 17 | 44,882 |
Tags: implementation
Correct Solution:
```
i=input
g=range
l=list(map(int,i().split()))
d={'S':0,'M':1,'L':2,'XL':3,'XXL':4}
r={0:'S',1:'M',2:'L',3:'XL',4:'XXL'}
n=int(i())
for x in g(n):
s=i()
if(l[d[s]]):
l[d[s]]-=1
res=s
else:
f=0
for _ in g(5):
if(d[s]+_<5 and l[d[s]+_]):
f=_
b... | output | 1 | 22,441 | 17 | 44,883 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,442 | 17 | 44,884 |
Tags: implementation
Correct Solution:
```
def nex(p):
if(p == 'L'):
return ['L','XL','M','XXL','S']
elif(p == 'XL'):
return ['XL','XXL','L','M','S']
elif(p == 'S'):
return ['S','M','L','XL','XXL']
elif(p == 'M'):
return ['M','L','S','XL','XXL']
elif(p == 'XXL'):
... | output | 1 | 22,442 | 17 | 44,885 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,443 | 17 | 44,886 |
Tags: implementation
Correct Solution:
```
import sys
import math
#to read string
get_string = lambda: sys.stdin.readline().strip()
#to read list of integers
get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) )
#to read integers
get_int = lambda: int(sys.stdin.readline())
#to print fast
pt = la... | output | 1 | 22,443 | 17 | 44,887 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,444 | 17 | 44,888 |
Tags: implementation
Correct Solution:
```
import sys
preferences = {
'S': ['S', 'M', 'L', 'XL', 'XXL'],
'M': ['M', 'L', 'S', 'XL', 'XXL'],
'L': ['L', 'XL', 'M', 'XXL', 'S'],
'XL': ['XL', 'XXL', 'L', 'M', 'S'],
'XXL': ['XXL', 'XL', 'L', 'M', 'S'],
}
remeras = dict(zip(['S', 'M', 'L', 'XL', 'XXL'], map(int, input... | output | 1 | 22,444 | 17 | 44,889 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,445 | 17 | 44,890 |
Tags: implementation
Correct Solution:
```
lst = [int(i) for i in input().split()]
n_sizes = ["S", "M", "L", "XL", "XXL"]
s_sizes = {
"S": 0,
"M": 1,
"L": 2,
"XL": 3,
"XXL": 4,
}
n = int(input())
result = ""
for i in range(n):
k = 10
size = s_sizes[input()]
for j in [4, 3, 2, 1, 0]:
... | output | 1 | 22,445 | 17 | 44,891 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,446 | 17 | 44,892 |
Tags: implementation
Correct Solution:
```
#################
# July 18th 2019.
#################
###############################################################
# Getting Problem-Data from Codeforces.
shirtCounts = list(map(int,input().split(' ')))
# Specifying preferences based on size demanded.
preferences = {
'S' ... | output | 1 | 22,446 | 17 | 44,893 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and... | instruction | 0 | 22,447 | 17 | 44,894 |
Tags: implementation
Correct Solution:
```
l = input().split()
for i in range(len(l)):
l[i]= int(l[i])
n_sizes = ["S","M","L","XL","XXL"]
s_sizes = {
"S" : 0,
"M" : 1,
"L": 2,
"XL": 3,
"XXL":4,
}
n = int(input())
ans = ""
for i in range(n):
k = 10
size = s_sizes[input()]
for j... | output | 1 | 22,447 | 17 | 44,895 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,456 | 17 | 44,912 |
Tags: greedy, sortings
Correct Solution:
```
def main():
(n, r, avg) = map(int, input().split(' '))
x = []
points = 0
essays = 0
for i in range(n):
a, b = map(int, input().split(' '))
if a < r:
x.append([a, b])
points += a
x = sorted(x, key=lambda i: i[1])
... | output | 1 | 22,456 | 17 | 44,913 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,457 | 17 | 44,914 |
Tags: greedy, sortings
Correct Solution:
```
inp = [int(x) for x in input().split()]
n = inp[0]
r = inp[1]
avg = inp[2]
exams = [[int(x) for x in input().split()] for x in range(n)]
exams.sort(key = lambda x: x[1])
examsSum = 0
for x in exams:
examsSum += x[0]
missingPoints = (avg * n) - examsSum
assigments = 0
i =... | output | 1 | 22,457 | 17 | 44,915 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,458 | 17 | 44,916 |
Tags: greedy, sortings
Correct Solution:
```
def main():
n, r, avg = map(int, input().split())
need = avg * n
d = sorted([list(map(int, input().split())) for _ in range(n)], key = lambda x: x[1])
cur = sum(x[0] for x in d)
#print(d, cur)
ret = 0
left = need - cur
if left <= 0:
... | output | 1 | 22,458 | 17 | 44,917 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,459 | 17 | 44,918 |
Tags: greedy, sortings
Correct Solution:
```
''' Codeforces Round #280 (Div. 2) | C - Vanya and Exams '''
def mergesort(arr, sup):
if len(arr) > 1:
mid = len(arr) // 2
left = arr[:mid]
right = arr[mid:]
leftsup = sup[:mid]
rightsup = sup[mid:]
mergesort(left, lefts... | output | 1 | 22,459 | 17 | 44,919 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,460 | 17 | 44,920 |
Tags: greedy, sortings
Correct Solution:
```
n, r, avg = map(int, input().split())
exams, need, ans = [], avg * n, 0
for x in range(n):
a, b = map(int, input().split())
exams.append([b, a])
need -= a
exams.sort()
i = 0
while need > 0 and i < n:
ans += exams[i][0] * min(r - exams[i][1], need)
need -=... | output | 1 | 22,460 | 17 | 44,921 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,461 | 17 | 44,922 |
Tags: greedy, sortings
Correct Solution:
```
import math
n, min_g, min_avg = [int(i) for i in input().split()]
a = []
for i in range(n):
a1, b1 = [int(i) for i in input().split()]
a.append((b1, a1))
a.sort()
s = 0
for i in range(n):
s += a[i][1]
avg = s/n
diff = min_avg - avg
if diff <= 0:
print(0)
el... | output | 1 | 22,461 | 17 | 44,923 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,462 | 17 | 44,924 |
Tags: greedy, sortings
Correct Solution:
```
#!/usr/bin/pypy3
n, r, avg = map(int, input().split())
rs = avg * n
s = 0
al = []
for _ in range(n):
x, y = map(int, input().split())
s += x
if x != r:
al.append([x, y])
al.sort(key=lambda x: x[1])
re = rs - s
ans = 0
i = 0
while re > 0:
if (r - al[i]... | output | 1 | 22,462 | 17 | 44,925 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and got grade ai for the i-th e... | instruction | 0 | 22,463 | 17 | 44,926 |
Tags: greedy, sortings
Correct Solution:
```
n,r,avg = map(int, input().split())
score = []
total = 0
for i in range(n):
a, b = map(int, input().split())
score.append((b, a))
total += a
need_point = max(0, avg * n - total)
score.sort()
ans = 0
for b, a in score:
if need_point == 0:
break
if ... | output | 1 | 22,463 | 17 | 44,927 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.