message stringlengths 2 22.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 145 109k | cluster float64 9 9 | __index_level_0__ int64 290 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights are 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g in o... | instruction | 0 | 90,014 | 9 | 180,028 |
"Correct Solution:
```
while True:
try:
w = int(input())
except:
break
ans = [2 ** i if w // 2 ** i % 2 else 0 for i in range(10)]
while ans.count(0):
del ans[ans.index(0)]
print(*ans)
``` | output | 1 | 90,014 | 9 | 180,029 |
Provide a correct Python 3 solution for this coding contest problem.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights are 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g in o... | instruction | 0 | 90,015 | 9 | 180,030 |
"Correct Solution:
```
def get_input():
while True:
try:
yield ''.join(input())
except EOFError:
break
N = list(get_input())
w = [1,2,4,8,16,32,64,128,256,512]
w.reverse()
for l in range(len(N)):
n = int(N[l])
ans = []
for i in range(10):
if n >= w[i]:
... | output | 1 | 90,015 | 9 | 180,031 |
Provide a correct Python 3 solution for this coding contest problem.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights are 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g in o... | instruction | 0 | 90,016 | 9 | 180,032 |
"Correct Solution:
```
import sys
W = []
N = [1,2,4,8,16,32,64,128,256,512]
for line in sys.stdin:
W.append(int(line))
for x in W:
ans = []
for y in N:
if x & y:
ans.append(str(y))
print(' '.join(ans))
``` | output | 1 | 90,016 | 9 | 180,033 |
Provide a correct Python 3 solution for this coding contest problem.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights are 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g in o... | instruction | 0 | 90,017 | 9 | 180,034 |
"Correct Solution:
```
def solve(num, l):
if num == 0:
return l
l.append(num % 2)
return solve(num // 2, l)
while True:
try:
num = int(input())
nums = solve(num, [])
ans = ""
for i, v in enumerate(nums):
if v:
ans += str(2 ** i) + " "
print(ans.rstrip())
except EOFErro... | output | 1 | 90,017 | 9 | 180,035 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,018 | 9 | 180,036 |
Yes | output | 1 | 90,018 | 9 | 180,037 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,019 | 9 | 180,038 |
Yes | output | 1 | 90,019 | 9 | 180,039 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,020 | 9 | 180,040 |
Yes | output | 1 | 90,020 | 9 | 180,041 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,021 | 9 | 180,042 |
Yes | output | 1 | 90,021 | 9 | 180,043 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,022 | 9 | 180,044 |
No | output | 1 | 90,022 | 9 | 180,045 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,023 | 9 | 180,046 |
No | output | 1 | 90,023 | 9 | 180,047 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,024 | 9 | 180,048 |
No | output | 1 | 90,024 | 9 | 180,049 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
My grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights ... | instruction | 0 | 90,025 | 9 | 180,050 |
No | output | 1 | 90,025 | 9 | 180,051 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,385 | 9 | 184,770 |
"Correct Solution:
```
n,x,t=map(int,input().split())
import math
print(math.ceil(n/x)*t)
``` | output | 1 | 92,385 | 9 | 184,771 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,386 | 9 | 184,772 |
"Correct Solution:
```
n,x,t = map(int,input().split())
print(-(n//-x)*t)
``` | output | 1 | 92,386 | 9 | 184,773 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,387 | 9 | 184,774 |
"Correct Solution:
```
(N,X,T) = map(int,input().split())
print((-((-N)//X)*T))
``` | output | 1 | 92,387 | 9 | 184,775 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,388 | 9 | 184,776 |
"Correct Solution:
```
N, X, T = [int(n) for n in input().split()]
print((N+X-1)//X*T)
``` | output | 1 | 92,388 | 9 | 184,777 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,389 | 9 | 184,778 |
"Correct Solution:
```
N, X, T = map(int, input().split())
ans = (N + X - 1)//X*T
print(ans)
``` | output | 1 | 92,389 | 9 | 184,779 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,390 | 9 | 184,780 |
"Correct Solution:
```
N,X,T=map(int,input().split())
print(-(-N//X*T))
``` | output | 1 | 92,390 | 9 | 184,781 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,391 | 9 | 184,782 |
"Correct Solution:
```
N,X,T=map(int,input().split())
import math
print(T*math.ceil(N/X))
``` | output | 1 | 92,391 | 9 | 184,783 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki?
Constraints
* 1 \l... | instruction | 0 | 92,392 | 9 | 184,784 |
"Correct Solution:
```
n,x,t=map(int,input().split())
print((n//x+((n%x)!=0))*t)
``` | output | 1 | 92,392 | 9 | 184,785 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,393 | 9 | 184,786 |
Yes | output | 1 | 92,393 | 9 | 184,787 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,394 | 9 | 184,788 |
Yes | output | 1 | 92,394 | 9 | 184,789 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,395 | 9 | 184,790 |
Yes | output | 1 | 92,395 | 9 | 184,791 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,396 | 9 | 184,792 |
Yes | output | 1 | 92,396 | 9 | 184,793 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,397 | 9 | 184,794 |
No | output | 1 | 92,397 | 9 | 184,795 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,398 | 9 | 184,796 |
No | output | 1 | 92,398 | 9 | 184,797 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,399 | 9 | 184,798 |
No | output | 1 | 92,399 | 9 | 184,799 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.
How lo... | instruction | 0 | 92,400 | 9 | 184,800 |
No | output | 1 | 92,400 | 9 | 184,801 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Three men, A, B and C, are eating sushi together. Initially, there are N pieces of sushi, numbered 1 through N. Here, N is a multiple of 3.
Each of the three has likes and dislikes in sushi. A'... | instruction | 0 | 92,497 | 9 | 184,994 |
No | output | 1 | 92,497 | 9 | 184,995 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Three men, A, B and C, are eating sushi together. Initially, there are N pieces of sushi, numbered 1 through N. Here, N is a multiple of 3.
Each of the three has likes and dislikes in sushi. A'... | instruction | 0 | 92,498 | 9 | 184,996 |
No | output | 1 | 92,498 | 9 | 184,997 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,019 | 9 | 186,038 |
Tags: greedy
Correct Solution:
```
from bisect import bisect_left
n, x = map(int, input().split())
s, a, b = 0, [[], []], [[], []]
for i in range(n):
t, h, m = map(int, input().split())
a[t].append((h, m))
for t in [0, 1]:
a[t].sort(key = lambda x: x[0])
for h, m in a[t]:
if h > x: break
... | output | 1 | 93,019 | 9 | 186,039 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,020 | 9 | 186,040 |
Tags: greedy
Correct Solution:
```
n, x = map(int, input().split())
can = [[], []]
for i in range(n):
a, b, c = map(int, input().split())
can[a].append((b, c))
ans = 0
for nturn in range(2):
u = [[], []]
for i in range(2):
for j in range(len(can[i])):
u[i].append(False)
nx = x
... | output | 1 | 93,020 | 9 | 186,041 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,021 | 9 | 186,042 |
Tags: greedy
Correct Solution:
```
n, x1 = map(int, input().split())
class Candy:
t = 0
h = 0
m = 0
candy0 = []
candy1 = []
for i in range(n):
candy = Candy()
candy.t, candy.h, candy.m = map(int, input().split())
if candy.t == 0:
candy0.append(candy)
else:
candy1.append(candy)
def sortfn(item):
... | output | 1 | 93,021 | 9 | 186,043 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,022 | 9 | 186,044 |
Tags: greedy
Correct Solution:
```
n, x = (int(x) for x in input().split())
cs = []
for i in range(n):
cs.append([int(x) for x in input().split()])
if cs[-1][0] > 0:
cs[-1][0] = 1
def try_eat(t0):
h0 = x
used = set()
while True:
m0 = 0
i0 = -1
for i,... | output | 1 | 93,022 | 9 | 186,045 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,023 | 9 | 186,046 |
Tags: greedy
Correct Solution:
```
def solve(currentT):
result = 0
way = list(candy)
bestCandy = -1
flag = False
for i in range(n):
if way[i][0] == currentT:
if way[i][1] <= x and (way[i][2] >= way[bestCandy][2] or bestCandy == -1):
bestCandy = i
f... | output | 1 | 93,023 | 9 | 186,047 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,024 | 9 | 186,048 |
Tags: greedy
Correct Solution:
```
from functools import cmp_to_key
def get_max_from(data, x):
for i, c in enumerate(data):
if c[0] <= x:
data.pop(i)
return c[1]
return None
def test(data0, data1, x):
total = 0
while True:
max_m = get_max_from(da... | output | 1 | 93,024 | 9 | 186,049 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,025 | 9 | 186,050 |
Tags: greedy
Correct Solution:
```
n,height=map(int,input().split())
caramel=[];frut=[];h=height
for i in range(n):
x,y,z = map(int,input().split())
if x==0:
caramel.append([y,z])
else:
frut.append([y,z])
caramel.sort()
frut.sort()
q1=caramel.copy()
q2=frut.copy()
ans=f2=0;f1=1
a1=0
while a1... | output | 1 | 93,025 | 9 | 186,051 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend Evan. Evan has n candies of two types (fruit d... | instruction | 0 | 93,026 | 9 | 186,052 |
Tags: greedy
Correct Solution:
```
def solve ( p, n, x, t, h, m ):
used, xx, ans = [0] * n, x, 0
while ( True ):
k = -1
for i in range( n ):
if ( used[i] == 0 ) and ( t[i] == p ) and ( h[i] <= xx ) and ( ( k == -1 ) or ( m[i] > m[k] ) ): k = i
if ( k == -1 ): break
a... | output | 1 | 93,026 | 9 | 186,053 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,027 | 9 | 186,054 |
Yes | output | 1 | 93,027 | 9 | 186,055 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,028 | 9 | 186,056 |
Yes | output | 1 | 93,028 | 9 | 186,057 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,029 | 9 | 186,058 |
Yes | output | 1 | 93,029 | 9 | 186,059 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,030 | 9 | 186,060 |
Yes | output | 1 | 93,030 | 9 | 186,061 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,031 | 9 | 186,062 |
No | output | 1 | 93,031 | 9 | 186,063 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,032 | 9 | 186,064 |
No | output | 1 | 93,032 | 9 | 186,065 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,033 | 9 | 186,066 |
No | output | 1 | 93,033 | 9 | 186,067 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is the hero of today's problem.
<image>
One day, Om Nom visited his friend... | instruction | 0 | 93,034 | 9 | 186,068 |
No | output | 1 | 93,034 | 9 | 186,069 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can't make a problem about stacking pancakes without working at a specific IT company, so he decided ... | instruction | 0 | 93,731 | 9 | 187,462 |
Tags: dp, implementation, sortings
Correct Solution:
```
from sys import stdin
def main():
MAX_N = 200000
a = [0] * MAX_N
drenched = [0] * MAX_N
def solve():
N = int(next(tokens))
for i in range(N):
a[i] = int(next(tokens))
current_cream = 0
for i in range... | output | 1 | 93,731 | 9 | 187,463 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can't make a problem about stacking pancakes without working at a specific IT company, so he decided ... | instruction | 0 | 93,732 | 9 | 187,464 |
Tags: dp, implementation, sortings
Correct Solution:
```
def solve():
global n,a
ans=[0]*n
amt=0
for i in range(n-1,-1,-1):
if a[i]>amt:
amt=a[i]
if amt>0:
ans[i]=1
amt-=1
for x in range(n):
print(ans[x],en... | output | 1 | 93,732 | 9 | 187,465 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can't make a problem about stacking pancakes without working at a specific IT company, so he decided ... | instruction | 0 | 93,733 | 9 | 187,466 |
Tags: dp, implementation, sortings
Correct Solution:
```
import sys,os.path
from math import ceil
def II(): return int(sys.stdin.buffer.readline())
def MI(): return map(int, sys.stdin.buffer.readline().split())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
if(os.path.exists('input.txt')):
sy... | output | 1 | 93,733 | 9 | 187,467 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can't make a problem about stacking pancakes without working at a specific IT company, so he decided ... | instruction | 0 | 93,734 | 9 | 187,468 |
Tags: dp, implementation, sortings
Correct Solution:
```
from collections import defaultdict,OrderedDict,Counter
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
# import numpy as np
from queue import Queue,PriorityQueue
from heapq import *
from statistics import *
from math import *
import frac... | output | 1 | 93,734 | 9 | 187,469 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.