TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
num = input().split()
ans = int(num[0]) // (int(num[1])*2+1)
if int(num[0])%int(num[1])!=0: ans += 1
print(ans)

num = input().split()
ans = int(num[0]) // (int(num[1])*2+1)
if int(num[0])%(int(num[1])*2+1)!=0: ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n, d = [ int(_) for _ in input().split() ]
x  = n / (2*d+1)
if x.is_integer()
    print( x )
else:
    print( x + 1 )





n, d = [ int(_) for _ in input().split() ]
x  = n / (2*d+1)

if x.is_integer():
    print( x//1 )
else:
    print( (x//1) + 1 )





n, d = [ int(_) for _ in input().split() ]
x  = n / (2*d+1)
if x.is_integer():
    print( x )
else:
    print( x + 1 )

n, d = [ int(_) for _ in input().split() ]
x  = n / (2*d+1)

if x.is_integer():
    print( int(x//1) )
else:
    print( int( (x//1) + 1) ) 



Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
N, D = map(int, input().split())

print(math.ceil(N/(2*D+1))

import math
N,D = map(int, input().split())
print(math.ceil(N/(2*D+1)))

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N,D = map(int, input().split())
D = 2*D + 1
for i in range (N+1):
  if i >= D:
    print(i)

N,D = map(int, input().split())
D = 2*D + 1
k = N/D
l = N//D
if k == l:
    print(int(k))
else:
    print(l+1)

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n,d = map(int,input().split())
print(n//(d*2+1))

n,d = map(int,input().split())                                                                                          
print((n+(d*2))//(d*2+1))

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
a, b=list(map(int, input()))
print((a-1)/(2*b + 1)/1)

a, b=list(map(int, input().split()))
print(int((a-1)/(2*b + 1))+1)

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
n,d=map(int,input())
k=math.ceil(n/(2*d))
print(k)

import math
n,d=map(int,input().split())
k=math.ceil(n/(2*d+1))
print(k)

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):

def main():

    N,D = map(int,input().split())
    D += 4

    if N < D:
        N=D

    if N%D==0:
        print(int(N/D))
    else:
        print(int((N/D)+1))



if __name__== "__main__":
    main() 



def main():

    N,D = map(int,input().split())

    power = D*2+1

    if N <= power:
        print(1)
        exit()

    if N%power==0:
        print(int(N/D))
    else:
        print(int((N/D)+1))



if __name__== "__main__":
    main() 



def main():

    N,D = map(int,input().split())

    power = D*2+1

    if N <= power:
        print(1)
        exit()

    if N%power==0:
        print(int(N/power))
    else:
        print(int((N/power)+1))



if __name__== "__main__":
    main() 


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
N, D = int(input())
person = math.cell(N / (D*2+1))
print(person)

N,D = map(int,input().split())
if N % (D*2+1) != 0:
  p = n // (d*2+1) + 1
else:
  p = n // (d*2+1)
  
print(p)

import math
N, D = map(int, input().split())
person = math.cell(N / (D*2+1))
print(person)


N,D = map(int,input().split())
if N % (D*2+1) != 0:
  p = N // (D*2+1) + 1
else:
  p = N // (D*2+1)
  
print(p)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math

nd = input().strip().split()
n = nd[0]
d = nd[1]

inspectors = math.ceil(n / (2 * d + 1))
print(inspectors)

import math

nd = [int(x) for x in input().strip().split()]
n = nd[0]
d = nd[1]

inspectors = math.ceil(n / (2 * d + 1))
print(inspectors)

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N, D = map(int, input().split())

print(N//(2*D+1))


import math
N, D = map(int, input().split())
ans = math.ceil(N/(2*D+1))
print(ans)



Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n, d = map(int, input().split())
i = (n // 2*r) + 1
print(i)

n, d = map(int, input().split())
if n % (2*d + 1) == 0:
  print(n // (2*d + 1))
else:
  print(n // (2*d + 1) + 1)

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n = int(input())
d = int(input())
ans = n/(2*d + 1)
if n % (2*d + 1) != 0:
  print(ans+1)
else:
  print(ans)


n = int(input())
d = int(input())
ans = n/(2*d + 1)
if n % (2*d + 1) != 0:
  print("{}".format(ans+1))
else:
  print("{}".format(ans))

n = int(input())
d = int(input())
ans = n // (2*d + 1)
if n % (2*d + 1) != 0:
  print(ans+1)
else:
  print(ans)


N,D = map(int,input().split())
a = (N-1)/(2*D)
if (N-1)%(2*D) == 0:
	print(a)
else:
 	print((N-1)//(2*D+1))


n, d = map(int,input().split())
ans = n // (2*d + 1)
if n % (2*d + 1) == 0:
  print(ans)
else:
  print(ans+1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
N, D = map(int, input().split())
print(math.floor(N/(2*D+1)))

import math
N, D = map(int, input().split())
print(math.ceil(N/(2*D+1)))

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
n,d= map(int,input().split())
math.ceil(n/(d*2+1))

import math
n,d= map(int,input().split())
print(math.ceil(n/(d*2+1)))

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
N,D=map(int,input().split())
tmp = D *2.0 + 1
print(tmp)
print(math.ceil(N / tmp))

import math
N,D=map(int,input().split())
tmp = D *2.0 + 1
print(tmp)
print(int(math.ceil(N / tmp)))

import math
N,D=map(int,input().split())
tmp = D *2.0 + 1
print(int(math.ceil(N / tmp)))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n,d = map(int,input().split())
print((n+d+4-1)//(d+4))

n,d = map(int,input().split())
print((n+d*2)//(d*2+1))

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
N,D = map(int,input().split())

people = math.ceil(N // (2D+1))
print(people)

N, D = map(int, input().split())

people = N / (2*D+1)
if people % 1.0 != 0:
    people+=1
print(int(people))

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N,D = [int(s) for s in input().split()]
print(math.ceil(N/(2*D+1)))

s1,s2=input().split()
N=int(s1)
D=int(s2)
n=N
ans=0
while n>0:
  n=n-(2*D+1)
  ans=ans+1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n,d=map(int,input())
if n%(2*d+i)==0:
  print(n//(2*d+1))
else:
  print(n//(2*d+1)+1)

n,d=map(int,input().split())
if n%(2*d+i)==0:
  print(n//(2*d+1))
else:
  print(n//(2*d+1)+1)

import math
n,d=map(int,input().split())
print(math,ceil(n/(d*2+1)))

import math
n,d=map(int,input().split())
print(math.ceil(n/(d*2+1)))



Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n, d = map(int, input().split())
spl_num = d*2+1
if not n % spl_num:
    print(n // spl_num + 1)
else:
    print(n // spl_num)

n, d = map(int, input().split())
spl_num = d*2+1
if not n % spl_num:
    print(n // spl_num)
else:
    print(n // spl_num + 1)

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n, d = map(int, input().split())
print(n//(d*2))

n, d = map(int, input().split())
print((n+d*2)//(d*2+1))

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n,d = (int(x) for x in input().split())
print(n/2d)

n,d = (int(x) for x in input().split())
if n//(2*d) = 0:
  print(n/(2*d))
else:
  print(n/(2*d)+1)

N,D = array(input(),input())
print(roundup(N/2D ,0)

n,d = (int(x) for x in input().split())
if n % (2*d + 1) == 0:
  print(n//(2*d + 1))
else:
  print(n//(2*d + 1) + 1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N,D = map(int,input().split())
a = N%(2*D+1)
b = N//(2*D+1)
if a=0:
  print(int(b))
else:
  print(int(b+1))


N,D = map(int,input().split())
a = N%(2*D+1)
b = N//(2*D+1)
if a=0:
  print(b)
else:
  print(int(b+1))


N,D = map(int,input().split())
a = N%(2*D+1)
b = N//(2*D+1)
if a==0:
  print(int(b))
else:
  print(int(b+1))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N,D =map(int,input().split())
ans=0
while True:
  ans+=1
  tmp=ans*2+1
  if tmp >= N:
    break
print(ans)

N,D =map(int,input().split())
ans=0
while True:
  ans+=1
  tmp=(D*2+1)*ans
  if tmp >= N:
    break
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N, D = map(int, input().split())

i = 1
left = 1
res = 0
while i <= N:
    if i - D == left:
        print(i, left)
        left = i + D + 1
        res += 1
    i += 1

if left <= N: res += 1

print(res)

N, D = map(int, input().split())

i = 1
left = 1
res = 0
while i <= N:
    if i - D == left:
        left = i + D + 1
        res += 1
    i += 1

if left <= N: res += 1

print(res)

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
n, d = map(int, input().split)
print(math.ceil(n/(2*d+1)))

import math
n, d = map(int, input().split())
print(math.ceil(n/(2*d+1)))

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
a,b = map(int,input().split())

r = b*2+1

if a%b == 0:
    print(a//r)
else:
    print(a//r+1)


a,b = map(int,input().split())

r = b*2+1

if a%b == 0:
    print(a//b)
else:
    print(a//b+1)


a,b = map(int,input().split())

r = b*2+1

if a%r == 0:
    print(a//r)
else:
    print(a//r+1)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n,d=map(int ,input().split())
print((n+2*d)/(2*d+1))

n,d=map(int ,input().split())
print(n/(2*d+1))

import math
n,d=map(int,input().split())
print(math.ceil(n/(2*d+1)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import math
num_list = list(map(int, input().split()))

N = num_list[0]
D = num_list[1]

print (math.ceil(N//(2*D+1)))

import math
N,D= list(map(int, input().split()))

print (math.ceil(N/(2*D+1)))

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
a,b=map(int,input().split())
c=a//(2b+1)+1
print(c)

n, d = map(int, input().split())
if n%(2*d+1) == 0:
    print(n//(2*d+1))
else:
    print(n//(2*d+1)+1)


Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n,d = map(int,input().split())
sight = 2*d+1
i = 1
while(True)
  if n <= i*sight:
    print(i)
    break
  i += 1
    

n,d = list(map(int,input().split()))
sight = 2*d+1
print((n//sight) + (n%sight != 0))

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
a, b = int(input())
if a%(1+b) !=0:
  print(a//(1+b)+1)
else:
  print(a//(1+b))

a, b = map(int, input().split())
if a%(1+2*b) !=0:
  print(a//(1+2*b)+1)
else:
  print(a//(1+2*b))

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N, D = map(int, input().split())
if N%D == 0:
  print(N//(2*D+1))
else:
  print(N//(2*D+1)+1)

N, D = map(int, input().split())
if N%(2*D+1) == 0:
  print(N//(2*D+1))
else:
  print(N//(2*D+1)+1)

Verdicts: Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N, D = map(int,input().split())
a = N//(2D+1)
if N%(2D+1)==0:
  print(a)
else:
  print(a+1)

N, D = map(int,input().split())
a = N//(2*D+1)
if N%(2*D+1)==0:
  print(a)
else:
  print(a+1)

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
,d = map(int,input().split())

a = d * 2 + 1

b=n/a
b = int(b)
c=n%a
if c>0:
    b = b + 1
    
print(b)

n,d = map(int,input().split())

a = d * 2 + 1

b=n/a
b = int(b)
c=n%a
if c>0:
    b = b + 1
    
print(b)


Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
N=int(input())
D=int(input())
maximum=2*D+1
if N%maximum==0:
    print(int(N/maximum))
else:
    print(int(N/maximum+1))

inputing=input()
N=int(inputing.split()[0])
D=int(inputing.split()[1])

maximum=2*D+1
if N%maximum==0:
    print(int(N/maximum))
else:
    print(int(N/maximum+1))

Verdicts: Runtime Error

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
n, d = map(int, input().split())
ans = (n+2*d)/(2*d+1)
print(ans)


n,d = map(int,input().split())
s = 2*d+1
ans = (n + s -1)/s
print(ans)

n,d = map(int,input().split())
s = 2*d + 1
ans = (n+s-1)/s
print(ans)

n, d = map(int, input().split())
s = 2*d+1
ans = (n+s-1)/s
print(ans)

n, d = map(int, input().split())
ans = (n+2*d+1-1)/2*d+1
print(ans)


n, d = map(int, input().split())
ans = (n+2*d)//(2*d+1)
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N apple trees in a row. People say that one of them will bear golden apples.  We want to deploy some number of inspectors so that each of these trees will be inspected.  Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).  Find the minimum number of inspectors that we need to deploy to achieve the objective.

Submission attempts (in order):
import mth
n, d = map(int,input().split())
print(math.ceil(n / (2 * d + 1)))


import mth
n, d = map(int,input().split())
print(math.seil(n / (2 * d + 1)))


import math
n, d = map(int,input().split())
print(math.ceil(n / (2 * d + 1)))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
N = int(input())
A = [int(input()) for i range(N)]

x = sorted(A)

for i in range(N):
  if A[i] == x[N-1]:
    print(x[N-2])
  else:
    print(x[N-1])

N=int(input())
A=[int(input()) for i range(N)]

x=sorted(A)

for i in range(N):
  if A[i] == x[N-1]:
    print(x[N-2])
  else:
    print(x[N-1])

N = int(input())
A = [int(input()) for i in range(N)]

x = sorted(A)

for i in range(N):
  if A[i] == x[N-1]:
    print(x[N-2])
  else:
    print(x[N-1])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
def main():
  N = int(input())

  max_left = [0] * N
  max_right = [0] * N

  ary = []

  for i in range(N):
    v = int(input())
    ary.append(v)

  for i in range(N - 1):
    max_left[i+1] = max(max_left[i], ary[i])

  for i in range(N - 1, 0, -1):
    max_right[i-1] = max(max_right[i], ary[i])

  for i in range(N):
	v = max(max_left[i], max_right[i])
	print(v)

main()


def main():
  N = int(input())

  left = [0] * N
  right = [0] * N

  ary = []

  for i in range(N):
    ary.append(int(input()))

  max_left = 0
  for i in range(0, N-1):
    max_left[i+1] = max(max_left[i], a[i])
    

  max_right = 0
  for i in range(N - 1, 0, -1):
    max_right[i-1] = max(max_right[i], ary[i]):

  for i in range(0, N):
    print(max(max_left[i], max_right[i]))

main()


def main():
  N = int(input())

  max_left = [0] * N
  max_right = [0] * N

  ary = []

  for i in range(N):
    ary.append(int(input()))

  for i in range(0, N-1):
    max_left[i+1] = max(max_left[i], a[i])

  for i in range(N - 1, 0, -1):
    max_right[i-1] = max(max_right[i], ary[i])

  for i in range(N):
	v = max(max_left[i], max_right[i])
	print(v)

main()


def main():
  N = int(input())

  max_left = [0] * N
  max_right = [0] * N

  ary = []

  for i in range(N):
    ary.append(int(input()))

  for i in range(0, N-1):
    max_left[i+1] = max(max_left[i], a[i])

  for i in range(N - 1, 0, -1):
    max_right[i-1] = max(max_right[i], ary[i]):

  for i in range(0, N):
	v = max(max_left[i], max_right[i])
	print(v)

main()


def main():
  N = int(input())

  max_left = [0] * N
  max_right = [0] * N

  ary = []

  for i in range(N):
    v = int(input())
    ary.append(v)

  for i in range(N - 1):
    max_left[i+1] = max(max_left[i], ary[i])

  for i in range(N - 1, 0, -1):
    max_right[i-1] = max(max_right[i], ary[i])

  for i in range(N):
	v = max(max_left[i], max_right[i])
	print(v)

main()


def main():
    N = int(input())

    max_left = [0] * N
    max_right = [0] * N

    ary = []

    for i in range(N):
        v = int(input())
        ary.append(v)

    for i in range(N - 1):
        max_left[i+1] = max(max_left[i], ary[i])

    for i in range(N - 1, 0, -1):
        max_right[i-1] = max(max_right[i], ary[i])

    for i in range(N):
        v = max(max_left[i], max_right[i])
        print(v)


main()


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
n=int(input())
v=[int(input()) for i in range(n)]
t=sorted(v)
for i in v:
  print(t[1] if i==t[0] else t[0])

n=int(input())
v=[int(input()) for i in range(n)]
m1=v[0]
m2=v[1]
if m2>m1:m1,m2=m2,m1
for i in v:
  if i > m1:
    m2=m1
    m1=i
  elif i>m2:
    m2=i
for i in v:
  print(m2 if i==m1 else m1)

n=int(input())
v=[int(input()) for i in range(n)]
t=sorted(v,reverse=True)
for i in v:
  print(t[1] if i==t[0] else t[0])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
N = int(input())
l = [int(input()) for i in range(N)]
l_sort = sorted(l)

for i in range(N):

    if (l[i] != l_sort[-1]):
        print(l_sort[-2])
    else:
        print(l_sort[-1])

N = int(input())
l = [int(input()) for i in range(N)]
l_sort = sorted(l)

for i in range(N):

    if (l[i] != l_sort[-1]):
        print(l_sort[-1])
    else:
        print(l_sort[-2])


Verdicts: Wrong Answer

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
import copy
n=int(input())
A=[int(input()) for i in range(n)]
B=copy.copy(A)
for i in range(n):
    A.pop(i)
    print(max(A))
    A = B
    

n=int(input())
A=[int(input()) for i in range(n)]
B=sorted(A)
for a in A:
    if a == B[-1]:
      print(B[-1])
    else:
        print(B[-2])

n=int(input())
A=[int(input()) for i in range(n)]
B=sorted(A)
for a in A:
    if a == B[-1]:
      print(B[-2])
    else:
        print(B[-1])

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
n = int(input())
A = []
for i in range(n):
  A.append(int(input()))
  
for i in range(n):
  Ai = A
  Ai.pop(i)
  print(max(Ai))


n = int(input())
A = [int(input()) for i in range(n)]
for i in range(n):
  Ai = A
  Ai.pop(i)
  print(max(Ai))

n = int(input())
A = [int(a) for input() in range(n)]
for i in range(n):
  Ai = A
  Ai.pop(i)
  print(max(Ai))


n = int(input())
A = []
for a in range(n):
  A.append(int(input()))
  
for a in range(n):
  Ai = A.pop(a)
  print(max(Ai))


n = int(input())
A = [int(input()) for _ in range(n)]

sort = sorted(A)

max = sort[-1]
maxx = sort[-2]

for i in range(n):
  if max == A[i]:
    print(maxx)
  else:
    print(max)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
import heapq
n=int(input())
d=[]
for i in range(n):
  heapq.heappush(d,int(input()))
for j in range(n):
  if d[j]==d[n-1]:
    print(d[n-2])
  else:
    print(d[n-1])

n=int(input())
d=[]
for i in range(n):
  d.append(int(input()))
x=sorted(d)
for j in range(n):
  if d[j]==d[-1]:
    print(x[-2])
  else:
    print(d[-1])



import heapq
n=int(input())
d=[]
for i in range(n):
  heapq.heappush(d,int(input()))
for j in range(n):
  if d[j]==d[n-1]:
    print(x[n-2])
  else:
    print(x[n-1])

n=int(input())
a=[int(input()) for i in range(n)]
sa=sorted(a)

for i in a:
  if sa[-1]==i:
    print(sa[-2])
  else:
    print(sa[-1])

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = answer.append(second if Ai == maxiuam else maxiuam for Ai in A)
answer = "\n".join(map(str, answer))

print(answer)


N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = [second if Ai == maxiuam else maxiuam for Ai in A)]
answer = "\n".join(map(str, answer))

print(answer)


N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = [second if Ai == maxiuam else maxiuam for Ai in A]
answer = "\n".join(map(str, answer))

print(answer)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
n = int(input())
H = list(map(int,input().split()))

tmp = H[0]
for k in H:
    if tmp - k > 1:
        print('No')
        exit()
    if k > tmp:
        tmp = k
print('Yes')

n = int(input())
A = [int(input()) for _ in range(n)]
B = A[:]
B.sort(reverse = True)
max_A = max(A)
for i in range(n):
    if A[i] == max_A:
        print(B[1])
    else:
        print(max_A)

Verdicts: Wrong Answer

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))

B = A
for i in range(N):
    B.append(0)
    B.remove(B[i])
    c = max(B, key=int)
    print(c)
    B = A

N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))

max_A = max(A, key=int)
max_A_number = A.index(max_A)
A.remove(max_A)
next_A = max(A, key=int)

for i in range(N):
    if i == max_A_number:
        print(next_A)
    else:
        print(max_A)


Verdicts: Wrong Answer

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
a_l = [ int(input()) for _ in range(n)]

l = []
r = []
l_max = 0
r_max = 0
for i in range(n):
    l_max = max(l_max, a_l[i])
    r_max = max(r_max, a_l[-i-1])
    l.append(l_max)
    r.append(r_max)
for i in range(n):
    if i == 0:
        t_l = 0
    else:
        t_l = l[i-1]
    if i == n-1:
        t_r = 0
    else:
        t_r = r[-i-2]
    print(max([t_l,t_r]))

a_l = [ int(input()) for _ in range(n)]


l = []
r = []
l_max = 0
r_max = 0
for i in range(n):
    l_max = max(l_max, a_l[i])
    r_max = max(r_max, a_l[-i-1])
    l.append(l_max)
    r.append(r_max)
for i in range(n):
    if i == 0:
        t_l = 0
    else:
        t_l = l[i-1]
    if i == n-1:
        t_r = 0
    else:
        t_r = r[-i-2]
    print(max([t_l,t_r]))

n = int(input())
a_l = [ int(input()) for _ in range(n)]

l = []
r = []
l_max = 0
r_max = 0
for i in range(n):
    l_max = max(l_max, a_l[i])
    r_max = max(r_max, a_l[-i-1])
    l.append(l_max)
    r.append(r_max)
for i in range(n):
    if i == 0:
        t_l = 0
    else:
        t_l = l[i-1]
    if i == n-1:
        t_r = 0
    else:
        t_r = r[-i-2]
    print(max([t_l,t_r]))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
import sys
import math
import copy
a = int(input());
b = [int(input()) for i in range(a)];
c = 0;
first = max(b);
g = b.copy();
h = list(g.index(first));
del g[h];
second = max(g);

for i in range(a):
    if max(b) > b[i]:
        print(first);
    elif first == b[i]:
        print(second);


import sys
import math
import copy
a = int(input());
b = [int(input()) for i in range(a)];
c = 0;
first = max(b);
g = b.copy();
h = g.index(first);
del g[h];
second = max(g);

for i in range(a):
    if first > b[i]:
        print(first);
    elif first == b[i]:
        print(second);

Verdicts: Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append([i,A])

pop_que =[]
ans_list= []

print(f"A_list:{A_list}")

for i in range(N):
    pop_que =A_list.pop(0)
    pop_que.append(max(A_list,key=lambda x:x[1]))
    A_list.append(pop_que)

#print(f"A_list[0]:{A_list[0]}")
#print(f"A_list[0][0]:{A_list[0][0]}")
#print(f"A_list[0][2][0]:{A_list[0][2][0]}")

for i in range(N):
    print(f"{A_list[i][2][1]}")

N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append(A)
A_list_sort = sorted(A_list)

max_a = A_list_sort[-1]
max_b = A_list_sort[-2]


for i in range(N):
    if A_list[i] == max_a:
        print(max_b)
    else:
        print(max_a)



Verdicts: Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
import heapq
n = int(input())
A = [int(input()) for _ in range(n)]

lerge1, lerge2  = sorted(A)[-2:]
for i in range(n):
    if a[i]==m1:
        pritn(m2)
    else:
        print(m1)



n = int(input())
A = [int(input()) for _ in range(n)]

m2, m1  = sorted(A)[-2:]
for i in range(n):
    if A[i]==m1:
        print(m2)
    else:
        print(m1)

Verdicts: Runtime Error

Accepted
Problem: You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question:    * Find the maximum value among the N-1 elements other than A_i in the sequence.

Submission attempts (in order):
import sys

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
M = sorted(A)
if M[-1] == M[-2]:
    for i in range(N):
        print(M[-1])
    sys.exit()
high_num = M[-1]
print(high_num)
print(A)
for i in range(N):
    if A[i] == high_num:
        print(M[-2])
    else:
        print(M[-1])


import sys

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
M = sorted(A)
if M[-1] == M[-2]:
    for i in range(N):
        print(M[-1])
    sys.exit()
high_num = M[-1]
for i in range(N):
    if A[i] == high_num:
        print(M[-2])
    else:
        print(M[-1])


Verdicts: Wrong Answer

Accepted