message stringlengths 2 30.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 237 109k | cluster float64 10 10 | __index_level_0__ int64 474 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,398 | 10 | 154,796 |
Yes | output | 1 | 77,398 | 10 | 154,797 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,399 | 10 | 154,798 |
Yes | output | 1 | 77,399 | 10 | 154,799 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,400 | 10 | 154,800 |
Yes | output | 1 | 77,400 | 10 | 154,801 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,401 | 10 | 154,802 |
No | output | 1 | 77,401 | 10 | 154,803 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,402 | 10 | 154,804 |
No | output | 1 | 77,402 | 10 | 154,805 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,403 | 10 | 154,806 |
No | output | 1 | 77,403 | 10 | 154,807 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N of us are going on a trip, by train or taxi.
The train will cost each of us A yen (the currency of Japan).
The taxi will cost us a total of B yen.
How much is our minimum total travel expen... | instruction | 0 | 77,404 | 10 | 154,808 |
No | output | 1 | 77,404 | 10 | 154,809 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Polycarpus stopped by a supermarket on his way home. It turns out that the supermarket is having a special offer for stools. The offer is as follows: if a customer's shopping cart contai... | instruction | 0 | 77,758 | 10 | 155,516 |
No | output | 1 | 77,758 | 10 | 155,517 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Polycarpus stopped by a supermarket on his way home. It turns out that the supermarket is having a special offer for stools. The offer is as follows: if a customer's shopping cart contai... | instruction | 0 | 77,759 | 10 | 155,518 |
No | output | 1 | 77,759 | 10 | 155,519 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Polycarpus stopped by a supermarket on his way home. It turns out that the supermarket is having a special offer for stools. The offer is as follows: if a customer's shopping cart contai... | instruction | 0 | 77,760 | 10 | 155,520 |
No | output | 1 | 77,760 | 10 | 155,521 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Polycarpus stopped by a supermarket on his way home. It turns out that the supermarket is having a special offer for stools. The offer is as follows: if a customer's shopping cart contai... | instruction | 0 | 77,761 | 10 | 155,522 |
No | output | 1 | 77,761 | 10 | 155,523 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,095 | 10 | 156,190 |
"Correct Solution:
```
a, b, c = map(int, input().split())
print(['No', 'Yes'][a+b>=c])
``` | output | 1 | 78,095 | 10 | 156,191 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,096 | 10 | 156,192 |
"Correct Solution:
```
A,B,C= map(int,input().split())
print(['No','Yes'][A+B>=C])
``` | output | 1 | 78,096 | 10 | 156,193 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,097 | 10 | 156,194 |
"Correct Solution:
```
a, b, c = (int(x) for x in input().split())
print('Yes' if a+b >= c else 'No')
``` | output | 1 | 78,097 | 10 | 156,195 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,098 | 10 | 156,196 |
"Correct Solution:
```
A,B,C=[int(x) for x in input().split()]
print(["No","Yes"][A+B>=C])
``` | output | 1 | 78,098 | 10 | 156,197 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,099 | 10 | 156,198 |
"Correct Solution:
```
a,b,c = (int(i) for i in input().split())
if a+b<c: print("No")
else: print("Yes")
``` | output | 1 | 78,099 | 10 | 156,199 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,100 | 10 | 156,200 |
"Correct Solution:
```
a,b,c=input().split()
print('Yes' if int(a)+int(b)>=int(c) else 'No')
``` | output | 1 | 78,100 | 10 | 156,201 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,101 | 10 | 156,202 |
"Correct Solution:
```
a,b,c=map(int,input().split());print('No'if a+b<c else'Yes')
``` | output | 1 | 78,101 | 10 | 156,203 |
Provide a correct Python 3 solution for this coding contest problem.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?
Note that he lives in Takahashi Kingdom, and may hav... | instruction | 0 | 78,102 | 10 | 156,204 |
"Correct Solution:
```
a,b,c=[int(s) for s in input().split()]
if a+b<c:
print("No")
else:
print("Yes")
``` | output | 1 | 78,102 | 10 | 156,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,103 | 10 | 156,206 |
Yes | output | 1 | 78,103 | 10 | 156,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,104 | 10 | 156,208 |
Yes | output | 1 | 78,104 | 10 | 156,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,105 | 10 | 156,210 |
Yes | output | 1 | 78,105 | 10 | 156,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,106 | 10 | 156,212 |
Yes | output | 1 | 78,106 | 10 | 156,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,107 | 10 | 156,214 |
No | output | 1 | 78,107 | 10 | 156,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,108 | 10 | 156,216 |
No | output | 1 | 78,108 | 10 | 156,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,109 | 10 | 156,218 |
No | output | 1 | 78,109 | 10 | 156,219 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
An elementary school student Takahashi has come to a variety store.
He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy i... | instruction | 0 | 78,110 | 10 | 156,220 |
No | output | 1 | 78,110 | 10 | 156,221 |
Provide a correct Python 3 solution for this coding contest problem.
Hint
In solving this problem, the following may be referred to. Shows how to convert an integer value to a string. Assign value as a string to str.
For C
include <stdio.h>
int main () {
int value = 123; // Convert this value to a string
char str... | instruction | 0 | 79,076 | 10 | 158,152 |
"Correct Solution:
```
from itertools import combinations_with_replacement as cwr
n, m = map(int, input().split())
c_lst = list(map(int, input().split()))
for t in cwr((0, 1, 2, 3, 4, 5, 6, 7, 8, 9), n):
out = ""
cost = 0
for n in t:
cost += c_lst[n]
out += str(n)
if cost <= m:
... | output | 1 | 79,076 | 10 | 158,153 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,110 | 10 | 158,220 |
Tags: implementation
Correct Solution:
```
n, m = map(int, input().split(' '))
prices = list(map(int, input().split(' ')))
money = list(map(int, input().split(' ')))
i = 0
j = 0
ans = 0
while i < n and j < m:
if money[j] >= prices[i]:
ans += 1
i += 1
j += 1
else:
... | output | 1 | 79,110 | 10 | 158,221 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,111 | 10 | 158,222 |
Tags: implementation
Correct Solution:
```
n,m=map(int,input().split())
c=list(map(int,input().split()))
a=list(map(int,input().split()))
buy=0
i=0
j=0
while i<m and j<n:
if a[i]>=c[j]:
buy+=1
i+=1
j+=1
else:
j+=1
print(buy)
``` | output | 1 | 79,111 | 10 | 158,223 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,112 | 10 | 158,224 |
Tags: implementation
Correct Solution:
```
n,m=map(int,input().split())
ci=list(map(int,input().split()))
ai=list(map(int,input().split()))
toys=0
j=0
for i in range(n):
if j>m-1:
break
if ci[i]<=ai[j]:
toys+=1
j+=1
print(toys)
``` | output | 1 | 79,112 | 10 | 158,225 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,113 | 10 | 158,226 |
Tags: implementation
Correct Solution:
```
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
j = 0
k = 0
for i in range(n):
if j < m and b[j] >= a[i]:
k+=1
j+=1
print(k)
``` | output | 1 | 79,113 | 10 | 158,227 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,114 | 10 | 158,228 |
Tags: implementation
Correct Solution:
```
n, m = map(int, input().split())
c = list(map(int, input().split()))
a = list(map(int, input().split()))
i = k = j = 0
while j < n and i <m:
if a[i] >= c[j]:
k += 1
i += 1
j += 1
else:
j += 1
print(k)
``` | output | 1 | 79,114 | 10 | 158,229 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,115 | 10 | 158,230 |
Tags: implementation
Correct Solution:
```
totalGames, totalBills = list(map(int, input().split(" ")))
games = list(map(int, input().split(" ")))
bills = list(map(int, input().split(" ")))
bought, game, bill = 0, 0, 0
while bill < totalBills and game < totalGames:
if games[game] <= bills[bill]:
bought += 1
... | output | 1 | 79,115 | 10 | 158,231 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,116 | 10 | 158,232 |
Tags: implementation
Correct Solution:
```
res, _ = 0, input()
n = [int(x) for x in input().split()]
m = [int(x) for x in input().split()]+[0]
for row in n: res += row<=m[res]
print(res)
``` | output | 1 | 79,116 | 10 | 158,233 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value a_j.
Ga... | instruction | 0 | 79,117 | 10 | 158,234 |
Tags: implementation
Correct Solution:
```
c, a = (int(i) for i in input().split())
C = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
k = 0
for i in range(c):
if A != [] and C[i] <= A[0]:
k += 1
A.pop(0)
print(k)
``` | output | 1 | 79,117 | 10 | 158,235 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,118 | 10 | 158,236 |
Yes | output | 1 | 79,118 | 10 | 158,237 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,119 | 10 | 158,238 |
Yes | output | 1 | 79,119 | 10 | 158,239 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,120 | 10 | 158,240 |
Yes | output | 1 | 79,120 | 10 | 158,241 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,121 | 10 | 158,242 |
Yes | output | 1 | 79,121 | 10 | 158,243 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,122 | 10 | 158,244 |
No | output | 1 | 79,122 | 10 | 158,245 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,123 | 10 | 158,246 |
No | output | 1 | 79,123 | 10 | 158,247 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,124 | 10 | 158,248 |
No | output | 1 | 79,124 | 10 | 158,249 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs c_i.
Maxim has a wallet which can be represented as an array of integers. His wallet con... | instruction | 0 | 79,125 | 10 | 158,250 |
No | output | 1 | 79,125 | 10 | 158,251 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The only difference between easy and hard versions is constraints.
Ivan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wants to use some of the... | instruction | 0 | 79,216 | 10 | 158,432 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import collections
def main():
from sys import stdin, stdout
def read():
return stdin.readline().rstrip('\n')
def read_array(sep=None, maxsplit=-1):
return read().split(sep, maxsplit)
def read_int():
return in... | output | 1 | 79,216 | 10 | 158,433 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The only difference between easy and hard versions is constraints.
Ivan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wants to use some of the... | instruction | 0 | 79,217 | 10 | 158,434 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import sys
import bisect
import copy
input = sys.stdin.readline
n,m=map(int,input().split())
K=[0]+list(map(int,input().split()))
SP=[list(map(int,input().split())) for i in range(m)]
SP2=[[] for i in range(n+1)]
for d,t in SP:
SP2[t].append(d)
f... | output | 1 | 79,217 | 10 | 158,435 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The only difference between easy and hard versions is constraints.
Ivan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wants to use some of the... | instruction | 0 | 79,218 | 10 | 158,436 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import sys
from array import array # noqa: F401
from typing import List, Tuple, TypeVar, Generic, Sequence, Union # noqa: F401
def input():
return sys.stdin.buffer.readline().decode('utf-8')
def main():
n, m = map(int, input().split())
... | output | 1 | 79,218 | 10 | 158,437 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The only difference between easy and hard versions is constraints.
Ivan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wants to use some of the... | instruction | 0 | 79,219 | 10 | 158,438 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import sys
import copy
DEBUG = False
if DEBUG:
inf = open("input.txt")
else:
inf = sys.stdin
N, M = list(map(int, inf.readline().split(' ')))
n_items = list(map(int, inf.readline().split(' ')))
sales = []
for _ in range(M):
sale = list(map... | output | 1 | 79,219 | 10 | 158,439 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The only difference between easy and hard versions is constraints.
Ivan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wants to use some of the... | instruction | 0 | 79,220 | 10 | 158,440 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import sys
import os
from io import BytesIO
DEBUG = False
if DEBUG:
inf = open("input.txt")
else:
# inf = sys.stdin
inf = BytesIO(os.read(0, os.fstat(0).st_size))
N, M = list(map(int, inf.readline().split()))
n_items = list(map(int, inf.re... | output | 1 | 79,220 | 10 | 158,441 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The only difference between easy and hard versions is constraints.
Ivan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wants to use some of the... | instruction | 0 | 79,221 | 10 | 158,442 |
Tags: binary search, greedy, implementation
Correct Solution:
```
def check(mid):
l = [0 for i in range(n)]
for i in b:
if(i[0] > mid): break
l[i[1]-1] = i[0]
v = [0 for i in range(mid+1)]
for i in range(n):
v[l[i]] += a[i]
ct = 0
for i in range(1,mid+1):
ct += 1
if(ct >= v[i]):
ct -= v[i]
v[i] = ... | output | 1 | 79,221 | 10 | 158,443 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.