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.
You are visiting a large electronics store to buy a refrigerator and a microwave.
The store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \le i \le A ) is ... | instruction | 0 | 20,958 | 10 | 41,916 |
No | output | 1 | 20,958 | 10 | 41,917 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are visiting a large electronics store to buy a refrigerator and a microwave.
The store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \le i \le A ) is ... | instruction | 0 | 20,959 | 10 | 41,918 |
No | output | 1 | 20,959 | 10 | 41,919 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are visiting a large electronics store to buy a refrigerator and a microwave.
The store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \le i \le A ) is ... | instruction | 0 | 20,960 | 10 | 41,920 |
No | output | 1 | 20,960 | 10 | 41,921 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are visiting a large electronics store to buy a refrigerator and a microwave.
The store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \le i \le A ) is ... | instruction | 0 | 20,961 | 10 | 41,922 |
No | output | 1 | 20,961 | 10 | 41,923 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,197 | 10 | 44,394 |
Tags: greedy, implementation, math
Correct Solution:
```
import math
import sys
input = sys.stdin.readline
for _ in range(int(input())):
a, b, c = map(int, input().split())
ans1 = 0
ans2 = 0
if a < c:
ans1 = 1
if a*b <= c:
ans2 = -1
else:
ans2 = b
el... | output | 1 | 22,197 | 10 | 44,395 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,198 | 10 | 44,396 |
Tags: greedy, implementation, math
Correct Solution:
```
test_case = int(input())
for _ in range(test_case):
a, b, c = map(int, input().split())
if a < c:
print(1, end = ' ')
else:
print(-1, end = ' ')
if a*b > c:
print(b)
else:
print(-1)
``` | output | 1 | 22,198 | 10 | 44,397 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,199 | 10 | 44,398 |
Tags: greedy, implementation, math
Correct Solution:
```
t = int(input())
for i in range(0, t):
entry = input().split(" ")
a = int(entry[0])
b = int(entry[1])
c = int(entry[2])
# 1 box = b donuts = c dollars
shop1 = -1
shop2 = -1
if a < c:
shop1 = 1
if a * b > c:
... | output | 1 | 22,199 | 10 | 44,399 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,200 | 10 | 44,400 |
Tags: greedy, implementation, math
Correct Solution:
```
# key missing ""
t = int(input())
for _ in range(t):
a, b, c = [int(i) for i in input().split()]
if a < c:
x = 1
temp = b * a
if temp <= c:
y = -1
else:
y = b
else:
x = -1
y = b
... | output | 1 | 22,200 | 10 | 44,401 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,201 | 10 | 44,402 |
Tags: greedy, implementation, math
Correct Solution:
```
test =int(input())
for t in range(test):
a,b,c = map(int, input().split())
if a<c:
print(1, end=" ")
else:
print(-1, end=" ")
if a*b>c:
print(b, end=" ")
else:
print(-1, end=" ")
print()
``` | output | 1 | 22,201 | 10 | 44,403 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,202 | 10 | 44,404 |
Tags: greedy, implementation, math
Correct Solution:
```
for s in[*open(0)][1:]:a1,b1,c1=map(int,s.split());print((-1,1)[a1<c1],2*(a1>=c1)or(-1,b1)[a1*b1>c1])
``` | output | 1 | 22,202 | 10 | 44,405 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,203 | 10 | 44,406 |
Tags: greedy, implementation, math
Correct Solution:
```
#!/usr/local/bin/python3
'''
Author: andyli
Time: 2020-06-25 22:36:38
'''
def main():
for _ in range(int(input())):
a, b, c = map(int, input().split())
ans1, ans2 = -1, -1
if a < c:
ans1 = 1
if a*b > c:
... | output | 1 | 22,203 | 10 | 44,407 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to... | instruction | 0 | 22,204 | 10 | 44,408 |
Tags: greedy, implementation, math
Correct Solution:
```
t=int(input())
for i in range(t):
li=[int(i) for i in input().split()]
a=li[0]
b=li[1]
c=li[2]
if a<(c/b):
ans1=1;
ans2=-1
print(ans1,ans2)
continue
if a>c/b:
ans2=b
if a<c and b!=1:
... | output | 1 | 22,204 | 10 | 44,409 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,205 | 10 | 44,410 |
Yes | output | 1 | 22,205 | 10 | 44,411 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,206 | 10 | 44,412 |
Yes | output | 1 | 22,206 | 10 | 44,413 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,207 | 10 | 44,414 |
Yes | output | 1 | 22,207 | 10 | 44,415 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,208 | 10 | 44,416 |
Yes | output | 1 | 22,208 | 10 | 44,417 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,209 | 10 | 44,418 |
No | output | 1 | 22,209 | 10 | 44,419 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,210 | 10 | 44,420 |
No | output | 1 | 22,210 | 10 | 44,421 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,211 | 10 | 44,422 |
No | output | 1 | 22,211 | 10 | 44,423 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs a dollars.
The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want t... | instruction | 0 | 22,212 | 10 | 44,424 |
No | output | 1 | 22,212 | 10 | 44,425 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,543 | 10 | 45,086 |
Tags: binary search, data structures, implementation
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1... | output | 1 | 22,543 | 10 | 45,087 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,544 | 10 | 45,088 |
Tags: binary search, data structures, implementation
Correct Solution:
```
import operator
import itertools
import bisect
def maxl(l, m, mx):
l.sort(key=operator.itemgetter(1))
lp = [p for(b, p) in l]
lb = list(itertools.accumulate((b for (b, p) in l), max))
for i, ((b, p), mb) in enumerate(zip(l, lb))... | output | 1 | 22,544 | 10 | 45,089 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,545 | 10 | 45,090 |
Tags: binary search, data structures, implementation
Correct Solution:
```
n, t, d = map(int, input().split())
coin = [[(0, 0), (0, 0)] for i in range(100001)]
diam = [[(0, 0), (0, 0)] for i in range(100001)]
f = []
for i in range(n):
b, c, q = input().split()
b = int(b)
c = int(c)
if q == 'C':
... | output | 1 | 22,545 | 10 | 45,091 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,546 | 10 | 45,092 |
Tags: binary search, data structures, implementation
Correct Solution:
```
import operator
import itertools
import bisect
def maxl(l, m, mx):
l.sort(key=operator.itemgetter(1))
lp = [p for(b, p) in l]
lb = list(itertools.accumulate((b for (b, p) in l), max))
for i, (b, p) in enumerate(l):
k = b... | output | 1 | 22,546 | 10 | 45,093 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,547 | 10 | 45,094 |
Tags: binary search, data structures, implementation
Correct Solution:
```
import operator
import itertools
import bisect
def maxl(l, m, mx):
l.sort(key=operator.itemgetter(1))
m1, m2 = 0, 0
pp = None
for b, p in l:
if p != pp:
if 2 * p > m:
break
if... | output | 1 | 22,547 | 10 | 45,095 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,548 | 10 | 45,096 |
Tags: binary search, data structures, implementation
Correct Solution:
```
n,c,d=list(map(int,input().strip().split(' ')))
import bisect
FC=[]
FD=[]
for _ in range(n):
A,B,C=list(input().strip().split(' '))
A=int(A)
B=int(B)
if C=='C':
if B<=c:
FC+=[[int(A),int(B)]]
else:
... | output | 1 | 22,548 | 10 | 45,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,549 | 10 | 45,098 |
Tags: binary search, data structures, implementation
Correct Solution:
```
import operator
def maxl(l, m, mx):
for i in range(len(l) - 1):
b1, p1 = l[i]
for j in range(i + 1, len(l)):
b2, p2 = l[j]
if b1 + b2 <= mx:
break
if p1 + p2 <= m:
... | output | 1 | 22,549 | 10 | 45,099 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost c... | instruction | 0 | 22,550 | 10 | 45,100 |
Tags: binary search, data structures, implementation
Correct Solution:
```
#!/usr/bin/env python3
from sys import stdin,stdout
def rint():
return map(int, stdin.readline().split())
#lines = stdin.readlines()
n, c, d = rint()
def mt(T, index, a):
maxb0 = 0
maxb1 = 0
for i, j in enumerate(a):
... | output | 1 | 22,550 | 10 | 45,101 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,551 | 10 | 45,102 |
Yes | output | 1 | 22,551 | 10 | 45,103 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,552 | 10 | 45,104 |
Yes | output | 1 | 22,552 | 10 | 45,105 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,553 | 10 | 45,106 |
Yes | output | 1 | 22,553 | 10 | 45,107 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,554 | 10 | 45,108 |
Yes | output | 1 | 22,554 | 10 | 45,109 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,555 | 10 | 45,110 |
No | output | 1 | 22,555 | 10 | 45,111 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,556 | 10 | 45,112 |
No | output | 1 | 22,556 | 10 | 45,113 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,557 | 10 | 45,114 |
No | output | 1 | 22,557 | 10 | 45,115 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the ga... | instruction | 0 | 22,558 | 10 | 45,116 |
No | output | 1 | 22,558 | 10 | 45,117 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,106 | 10 | 46,212 |
Yes | output | 1 | 23,106 | 10 | 46,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,107 | 10 | 46,214 |
Yes | output | 1 | 23,107 | 10 | 46,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,108 | 10 | 46,216 |
Yes | output | 1 | 23,108 | 10 | 46,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,109 | 10 | 46,218 |
Yes | output | 1 | 23,109 | 10 | 46,219 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,110 | 10 | 46,220 |
No | output | 1 | 23,110 | 10 | 46,221 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,111 | 10 | 46,222 |
No | output | 1 | 23,111 | 10 | 46,223 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,112 | 10 | 46,224 |
No | output | 1 | 23,112 | 10 | 46,225 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i-th piece of gold has weight w_i. All weights are distinct. He will put his n pieces of gold... | instruction | 0 | 23,113 | 10 | 46,226 |
No | output | 1 | 23,113 | 10 | 46,227 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your search for Heidi is over β you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow ... | instruction | 0 | 23,414 | 10 | 46,828 |
Tags: greedy
Correct Solution:
```
n, k = map(int, input().split())
arr = [int(z) for z in input().split()]
books = set()
def latest(n, arr, i, books):
w = {}
for pos in range(i+1, n):
if w.get(arr[pos]):
continue
else:
w[arr[pos]] = pos
for j in books:
i... | output | 1 | 23,414 | 10 | 46,829 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your search for Heidi is over β you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow ... | instruction | 0 | 23,415 | 10 | 46,830 |
Tags: greedy
Correct Solution:
```
n,k=map(int,input().split())
a=list(map(int,input().split()))
z=[0]*81
kz,ans=0,0
for i in range(n):
if z[a[i]]: continue
ans+=1
if k>kz:
z[a[i]]=1; kz+=1
else:
h=-1
for j in range(1,n+1):
if z[j]:
m=n+1
... | output | 1 | 23,415 | 10 | 46,831 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your search for Heidi is over β you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow ... | instruction | 0 | 23,416 | 10 | 46,832 |
Tags: greedy
Correct Solution:
```
R = lambda:map(int, input().split())
stack= []
n, k = R()
l = list(R())
curr,tot = 0,0
for i in range(n):
if l[i] not in stack:
if curr<k:
curr = curr+1
else:
c,z=0,-1
for j in range(k):
if stack[j] not in l[i:]:
... | output | 1 | 23,416 | 10 | 46,833 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your search for Heidi is over β you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow ... | instruction | 0 | 23,417 | 10 | 46,834 |
Tags: greedy
Correct Solution:
```
(n,k) = (int(i) for i in input().split())
zapross = [int(i) for i in input().split()]
lave = 0
curh = set()
for i in range(n):
if zapross[i] in curh: continue
if len(curh)!=k:
lave+=1
curh.add(zapross[i])
else:
lpos = -1
cc = -1
for j in curh:
try:
pos = zapross[i+... | output | 1 | 23,417 | 10 | 46,835 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your search for Heidi is over β you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow ... | instruction | 0 | 23,418 | 10 | 46,836 |
Tags: greedy
Correct Solution:
```
from collections import deque
class Treap(): # self.priority_comparator(root.priority, descendant.priority) == True
def __init__(self, key, priority, prrty_cmprtr):
self.key = key
self.priority = priority
self.priority_comparator = prrty_cmprtr
s... | output | 1 | 23,418 | 10 | 46,837 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your search for Heidi is over β you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow ... | instruction | 0 | 23,419 | 10 | 46,838 |
Tags: greedy
Correct Solution:
```
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
library = []
money = 0
for i in range(len(a)):
if a[i] not in library:
money += 1
if len(library) < k:
library.append(a[i])
else:
curmin = n
curin... | output | 1 | 23,419 | 10 | 46,839 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.