ZhenlongDai/ACPR huggingface dataset:
Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
from math import radians, sin, cos

x = y = 0
deg = 90
while True:
    r, d = map(int, input().split(','))
    if r == d == 0: break
    x += r * cos(radians(deg))
    y += r * sin(radians(deg))
    deg -= d
print(int(x), int(y))

Failing test case input:
56,65
97,54
64,-4
67,56
42,-27
43,80
77,-86
55,-6
43,98
95,5
0,0

Expected output:
178
-224


Actual output:
178 -224


Fixed submission (verdict: Accepted):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(float, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real))
print(int(z.imag))

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
from math import *

x = 0
y = 0
D = []
A = []
sum_a = -90
while True:
    d, a = map(int, input().split(","))
    if a == 0 and d == 0:
        break
    else:
        D.append(d)
        A.append(a)
for i in range(len(A)):
    x = x + D[i] * cos(sum_a * pi / 180)
    y = y - D[i] * sin(sum_a * pi / 180)
    sum_a += A[i]
print(round(x))
print(round(y))

Failing test case input:
55,67
97,44
64,-4
55,76
42,-27
43,70
77,-86
56,-4
48,94
85,5
0,0

Expected output:
165
-212


Actual output:
166
-213


Fixed submission (verdict: Accepted):
from math import *

x = 0
y = 0
D = []
A = []
sum_a = -90
while True:
    d, a = map(int, input().split(","))
    if a == 0 and d == 0:
        break
    else:
        D.append(d)
        A.append(a)
for i in range(len(A)):
    x = x + D[i] * cos(sum_a * pi / 180)
    y = y - D[i] * sin(sum_a * pi / 180)
    if abs(x-round(x))<10**(-7):
        x=round(x)
    if abs(y - round(y)) < 10 ** (-7):
        y=round(y)
    sum_a += A[i]
if x >= 0:
    print(floor(x))
else:
    print(floor(x)+1)
if y >= 0:
    print(floor(y))
else:
    print(floor(y)+1)

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
import math
x = y = 0
h = math.radians(90)
while True:
    d, t = map(int, input().split(","))
    if d == t == 0:
        break
    x += d * math.cos(h)
    y += d * math.sin(h)
    h -= math.radians(t)
print("{} {}".format(int(math.modf(x)[1]), int(math.modf(y)[1])))


Failing test case input:
56,65
97,55
65,-4
65,76
42,-27
34,80
77,-86
55,-6
89,33
85,5
0,0

Expected output:
184
-285


Actual output:
184 -285


Fixed submission (verdict: Accepted):
import math
x = y = 0
h = math.radians(90)
while True:
    d, t = map(int, input().split(","))
    if d == t == 0:
        break
    x += d * math.cos(h)
    y += d * math.sin(h)
    h -= math.radians(t)
print(int(x))
print(int(y))
Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(float, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real), int(z.imag))

Failing test case input:
56,65
46,79
64,-4
57,64
42,-27
43,80
77,-86
55,-6
89,34
55,9
0,0

Expected output:
39
-310


Actual output:
39 -310


Fixed submission (verdict: Accepted):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(float, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real))
print(int(z.imag))

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
import math
x = y = n= 0
while True:
	d,a = map(int,input().split(','))
	if d == a == 0: break
	x += d*math.sin(math.radians(n))
	y += d*math.cos(math.radians(n))
	n+=a
print(map(int,(x,y)),sep='\n')


Failing test case input:
55,67
97,44
74,-4
55,75
42,-17
42,70
77,-86
56,-4
38,94
85,5
0,0

Expected output:
135
-199


Actual output:
<map object at 0x7f8d92839210>


Fixed submission (verdict: Accepted):
import math
x = y = n= 0
while True:
	d,a = map(int,input().split(','))
	if d == a == 0: break
	x += d*math.sin(math.radians(n))
	y += d*math.cos(math.radians(n))
	n+=a
print(*map(int,(x,y)),sep='\n')

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
import math

x, y, r = 0, 0, 90
while True:
    d, t = map(int, input().split(","))
    if d == t == 0:
        break
    x += r * math.cos(math.radians(r))
    y += r * math.sin(math.radians(r))
    r -= t
print(int(x))
print(int(y))

Failing test case input:
56,65
97,54
44,-6
65,76
42,-27
43,80
77,-86
54,-6
43,98
5,58
0,0

Expected output:
163
-156


Actual output:
193
532


Fixed submission (verdict: Accepted):
import math

x, y, r = 0, 0, 90
while True:
    d, t = map(float, input().split(","))
    if d == t == 0:
        break
    x += d * math.cos(math.radians(r))
    y += d * math.sin(math.radians(r))
    r -= t
print(int(x))
print(int(y))

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
import math

x, y, r = 0, 0, 90
while True:
    d, t = map(float, input().split(","))
    if d == t == 0:
        break
    x += r * math.cos(math.radians(r))
    y += r * math.sin(math.radians(r))
    r -= t
print(int(x))
print(int(y))

Failing test case input:
56,75
97,53
64,-4
65,77
42,-27
43,80
77,-68
56,-4
89,44
85,5
0,0

Expected output:
43
-301


Actual output:
256
650


Fixed submission (verdict: Accepted):
import math

x, y, r = 0, 0, 90
while True:
    d, t = map(float, input().split(","))
    if d == t == 0:
        break
    x += d * math.cos(math.radians(r))
    y += d * math.sin(math.radians(r))
    r -= t
print(int(x))
print(int(y))
Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
import cmath,math,sys
z=0;p=90
for e in sys.stdin:
 r,d=map(int,e.split(','))
 z+=cmath.rect(r,math.radians(p))
 p-=d
print(int(z.real),int(z.imag))


Failing test case input:
56,65
46,79
64,-4
57,64
42,-27
43,80
77,-86
54,-6
89,34
55,9
0,0

Expected output:
39
-309


Actual output:
39 -309


Fixed submission (verdict: Accepted):
import cmath,math,sys
z=0;p=90
for e in sys.stdin:
 r,d=map(int,e.split(','))
 z+=cmath.rect(r,math.radians(p))
 p-=d
print(int(z.real),int(z.imag),sep='\n')

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(int, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg += d
print(-int(z.real), int(z.imag))

Failing test case input:
46,65
97,64
64,-4
67,54
42,-27
43,80
77,-86
55,-6
89,34
9,55
0,0

Expected output:
241
-241


Actual output:
241 -241


Fixed submission (verdict: Accepted):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(float, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real))
print(int(z.imag))

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(int, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real), int(z.imag))

Failing test case input:
56,65
97,54
64,-4
65,76
42,-27
43,80
77,-86
56,-4
89,34
85,5
0,0

Expected output:
185
-293


Actual output:
185 -293


Fixed submission (verdict: Accepted):
from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(float, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real))
print(int(z.imag))

Problem: p00016
Buggy submission (Python3, verdict: Wrong Answer):
import sys
import math

def TreasureHunt():
    x,y=(0.0,0.0)
    alpha=90
    
    for line in sys.stdin:
        a,b=list(map(int,line.split(',')))
        if a==0 and b==0:
            break
        
        x+=a*math.cos(alpha/180.0*math.pi)
        y+=a*math.sin(alpha/180.0*math.pi)
        alpha=(alpha-b+360)%360

    print(int(x),int(y))

        
        
            
TreasureHunt()

Failing test case input:
56,65
97,54
64,-4
65,76
42,-27
43,80
77,-86
56,-4
89,44
85,5
0,0

Expected output:
171
-290


Actual output:
171 -290


Fixed submission (verdict: Accepted):
import sys
import math

def TreasureHunt():
    x,y=(0.0,0.0)
    alpha=90
    
    for line in sys.stdin:
        a,b=list(map(int,line.split(',')))
        if a==0 and b==0:
            break
        
        x+=a*math.cos(alpha/180.0*math.pi)
        y+=a*math.sin(alpha/180.0*math.pi)
        alpha=(alpha-b+360)%360

    print(int(x))
    print(int(y))

        
        
            
TreasureHunt()
Problem: p02731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L=int(input())

x=round(L/3,3)

print(round(x*x*x,7))


Failing test case input:
-188

Expected output:
-246098.962963


Actual output:
-246102.890095


Fixed submission (verdict: Accepted):
L=int(input())

x=L/3

print(round(x*x*x,7))
Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

if n == 1: print(1)
else: print(2/n)

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
-0.0015420200462606013


Fixed submission (verdict: Accepted):
n = int(input())

if n == 1: print(1)
elif n % 2 == 0: print(0.5)
else: print((n+1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print((N+1)/2/N)

Failing test case input:
-855

Expected output:
0.499415204678


Actual output:
0.4994152046783626


Fixed submission (verdict: Accepted):
N = int(input())
print(((N+1)

Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
print((n + 1) / (2 * n))

Failing test case input:
-2019

Expected output:
0.49975235265


Actual output:
0.49975235264982665


Fixed submission (verdict: Accepted):
n = int(input())
print(((n + 1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N%2 ==0:
    print(0.5000000000)
else:
    print((N / 2) /N)

Failing test case input:
-685

Expected output:
0.499270072993


Actual output:
0.5


Fixed submission (verdict: Accepted):
N = int(input())
if N%2 ==0:
    print(0.5000000000)
else:
    print(((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
    print('{:.10f}'.format(1.0000000000))
elif n%2 ==1:
    print('{:.10f}'.format(0.6000000000))
else:
    print('{:.10f}'.format(0.5000000000))

Failing test case input:
-669

Expected output:
0.499252615845


Actual output:
0.6000000000


Fixed submission (verdict: Accepted):
n = int(input())

k = n%2
if n == 1:
    print('{:.10f}'.format(1.0000000000))
elif k == 1:
    print('{:.10f}'.format((n
else:
    print('{:.10f}'.format(0.5000000000))

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = input()
N = int(A)


if N ==1:
    a = 1
elif N%2 == 0:
    a = 0.5
    a = float(a)
elif N%2 == 1:
    a = (N/2 + 1)/N

print(a)

Failing test case input:
-855

Expected output:
0.499415204678


Actual output:
0.4988304093567251


Fixed submission (verdict: Accepted):
A = input()
N = int(A)


if N ==1:
    a = 1
elif N%2 == 0:
    a = 0.5
    a = float(a)
elif N%2 == 1:
    a = (N

print(a)

Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

if (N % 2) == 0:
    print(1/2)

elif(N % 2) != 0 and N != 1 :
    print((N-2)/N)

elif N == 1:
    print("1.000000")

Failing test case input:
-1739

Expected output:
0.499712478436


Actual output:
1.0011500862564693


Fixed submission (verdict: Accepted):
N = int(input())

if 2 <= N and N%2 == 0:
    print(((N

elif 2<=N and N%2 != 0:
    print(((N+1)

else:
    print("1.00000")
Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n=k()
if n % 2==0:
    print((n/2)/n)
else:
    print((n/2+1)/n)


Failing test case input:
-669

Expected output:
0.499252615845


Actual output:
0.49850523168908817


Fixed submission (verdict: Accepted):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n=k()
if n == 1:
    print(1)
    sys.exit()

if n % 2==0:
    print((n/2)/n)
else:
    print((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

if N%2 == 0:
    print(0.5)
elif N%2 == 1 and N != 1:
    print(0.6)
elif N == 1:
    print(1)

Failing test case input:
-115

Expected output:
0.495652173913


Actual output:
0.6


Fixed submission (verdict: Accepted):
N = int(input())

if N%2 == 0:
    print(0.5)
elif N%2 == 1 and N != 1:
    print(-(-N
elif N == 1:
    print(1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N%2==0:
    print(N/2)
else:
    print(((N/2)+1)/N)

Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.49987295134036336


Fixed submission (verdict: Accepted):
N = int(input())
if N%2==0:
    print((N/2)/N)
else:
    print(((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
  print (n)
else:
  if n % 2 == 1:
    print((n/2+1)/n)
  else:
    print(1/2)

Failing test case input:
-175

Expected output:
0.497142857143


Actual output:
0.4942857142857143


Fixed submission (verdict: Accepted):
n = int(input())
if n == 1:
  print (n)
else:
  if n % 2 == 1:
    print((n
  else:
    print(1/2)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
  print(1)
elif n%2 == 0:
  print(0.5)
else:
  print(0.6)

Failing test case input:
-669

Expected output:
0.499252615845


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())
if n == 1:
  print(1)
elif n%2 == 0:
  print(0.5)
else:
  print((n
Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

if N%2 == 0:
    print(N/(N*2))
else:
    print((N-1)/(2*N))

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
0.5003855050115652


Fixed submission (verdict: Accepted):
N = int(input())

if N%2 == 0:
    print(1/2)
else:
    print(((N-1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n=int(input())
odd_num=n
print(float(odd_num/n))

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
1.0


Fixed submission (verdict: Accepted):

n=int(input())
odd_num=-(-n
print(float(odd_num/n))

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if(n == 1):
    print(1)
elif(n % 2 == 0):
    print(0.5)
else:
    print(0.6)


Failing test case input:
-919

Expected output:
0.499455930359


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())

if(n % 2 == 1):
    print((n 
else:
    print((n / 2) / n)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

if n%2 == 0:
  print((n/2)**(-1))
else:
  print(((((n-1)/2)+1)/n))

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
0.49961449498843485


Fixed submission (verdict: Accepted):
n = int(input())
 
if n%2 == 0:
  print(0.5)
else:
  print(1-((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
  print(1.0)
  exit()
if n%2 == 0:
  print(1/2)
else:
  print(3/5)

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())
if n == 1:
  print(1/1)
  exit()
if n%2 == 0:
  print(1/2)
else:
  print(1/(n/(n

Problem: p02897
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
print(N/2 if N%2==0 else (N+1)/2)

Failing test case input:
-1739

Expected output:
0.499712478436


Actual output:
-869.0


Fixed submission (verdict: Accepted):
N=int(input())
print(1/2 if N%2==0 else (-(-N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
if x == 1:
    print(1)
elif x % 2 == 0:
    print(0.5)
else:
    print(0.6)


Failing test case input:
-685

Expected output:
0.499270072993


Actual output:
0.6


Fixed submission (verdict: Accepted):
x = int(input())
if x == 1:
    print(1)
elif x % 2 == 0:
    print(0.5)
else:
    print((x

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
  print(1/1)
  exit()
if n%2 == 0:
  print(1/2)
else:
  print(3/5)

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())
if n == 1:
  print(1/1)
  exit()
if n%2 == 0:
  print(1/2)
else:
  print(1/(n/(n
Problem: p02897
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())

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

Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.49987295134036336


Fixed submission (verdict: Accepted):
N=int(input())

if N%2==0:
  print(1/2)
else:
  print((N

Problem: p02897
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())

if N%2 == 0:
    print(0.5)
else:
    print((N-2)/N)

Failing test case input:
-685

Expected output:
0.499270072993


Actual output:
1.0029197080291972


Fixed submission (verdict: Accepted):
N = int(input())

if N%2 == 0:
    print(0.5)
else:
    print((N-N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=float(input())
if n%2==0:
    print(float((n/2)/2))
else:
    print(float(((n/2)+1)/n))

Failing test case input:
-175

Expected output:
0.497142857143


Actual output:
0.4942857142857143


Fixed submission (verdict: Accepted):
n=float(input())
if n%2==0:
    print(float((n/2)/n))
else:
    print(float(((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

if N % 2 == 0:
    print(0.5)
else:
    print((N/2+1)/N)


Failing test case input:
-115

Expected output:
0.495652173913


Actual output:
0.49130434782608695


Fixed submission (verdict: Accepted):
N = int(input())

if N % 2 == 0:
    print(0.5)
else:
    print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())

if n == 1:
    print(float(1))
elif n % 2 != 0:
    print(float(3/5))
else:
    print(float(1/2))

Failing test case input:
-669

Expected output:
0.499252615845


Actual output:
0.6


Fixed submission (verdict: Accepted):

n = int(input())

if n == 1:
    print(float(1))
elif n % 2 != 0:
    print(float((n
else:
    print(float((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

Failing test case input:
-669

Expected output:
0.499252615845


Actual output:
-166.75


Fixed submission (verdict: Accepted):
N = int(input())

if N % 2 == 0:
  print(1 / 2)
else:
  print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
if s == 1:
    print(1)
elif s % 2 == 0:
    print(0.5)
else:
    print(0.600000)

Failing test case input:
-175

Expected output:
0.497142857143


Actual output:
0.6


Fixed submission (verdict: Accepted):
s = int(input())
if s == 1:
    print(1)
elif s % 2 == 0:
    print(0.5)
else:
    print((s

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
cnt = N 
print(cnt/N)


Failing test case input:
-1739

Expected output:
0.499712478436


Actual output:
1.0


Fixed submission (verdict: Accepted):
N = int(input())
cnt = -(-N 
print(cnt/N)
Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

Failing test case input:
-855

Expected output:
0.499415204678


Actual output:
0.4988304093567251


Fixed submission (verdict: Accepted):
N = int(input())

if N % 2 == 0:
  print(1 / 2)
else:
  print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if n==1:
	print('1')
elif n%2==0:
	print('0.5')
else:
	print('0.6')

Failing test case input:
-175

Expected output:
0.497142857143


Actual output:
0.6


Fixed submission (verdict: Accepted):
n=int(input())
if n==1:
	print('1')
elif n%2==0:
	print('0.5')
else:
	print(((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N%2==0:
    print('0.5000000000')
else:
    print(((N/2)+1)/N)

Failing test case input:
-1739

Expected output:
0.499712478436


Actual output:
0.49942495687176536


Fixed submission (verdict: Accepted):
N = int(input())
if N%2==0:
    print((N/2)/N)
else:
    print(((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

if n % 2 == 0:
	print(0.5)
else:
	print(1/n)

Failing test case input:
-4637

Expected output:
0.499892171663


Actual output:
-0.00021565667457407807


Fixed submission (verdict: Accepted):
n = int(input())

if n % 2 == 0:
	print(0.5)
else:
	print((n

Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

print((n/2+n%2)/n)


Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.49987295134036336


Fixed submission (verdict: Accepted):
n = int(input())

print(int(n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

odd =  n

print(odd/n)

Failing test case input:
-919

Expected output:
0.499455930359


Actual output:
1.0


Fixed submission (verdict: Accepted):
n = int(input())

odd = -(-n

print(odd/n)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())

print(1.0/2.0 if (N%2)==0 else (N+1)/2*N)

Failing test case input:
-1299

Expected output:
0.49961508853


Actual output:
843051.0


Fixed submission (verdict: Accepted):
N = int(input())

print("0.5" if (N%2)==0 else ((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N%2 ==0:
    print(0.5000000000)
else:
    print((N / 2 +1) /N)

Failing test case input:
-4637

Expected output:
0.499892171663


Actual output:
0.49978434332542593


Fixed submission (verdict: Accepted):
N = int(input())
if N%2 ==0:
    print(0.5000000000)
else:
    print(((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
i=int(input())
print(0.5 if i%2==0 else 1.0 if i==1 else 1-2/i)

Failing test case input:
-919

Expected output:
0.499455930359


Actual output:
1.002176278563656


Fixed submission (verdict: Accepted):
i=int(input())
print(0.5 if i%2==0 else 1.0 if i==1 else (i
Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n % 2 == 0:
  print((n/2)/n)
else:
  print( ((n%2)+1) /n)
  

Failing test case input:
-2019

Expected output:
0.49975235265


Actual output:
-0.0009905894006934125


Fixed submission (verdict: Accepted):
n = int(input())
if n % 2 == 0:
  print((n/2)/n)
else:
  print( ((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N == 1:
  print(1)
elif N%2 != 0:
  print((N-2)/N)
else:
  print(N/2)


Failing test case input:
-855

Expected output:
0.499415204678


Actual output:
1.0023391812865496


Fixed submission (verdict: Accepted):
import sys
N = int(input())
if N == 1:
  print(1)
  sys.exit(0)
if N % 2 == 0:
  print(1/2)
else:
  print(((N+1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if n==1:
	print(1)
elif n%2==0:
	print(.5)
else:
	print(.6)

Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.6


Fixed submission (verdict: Accepted):
n=int(input())
if n==1:
    print(1)
elif n%2==0:
    print(.5)
else:
    print((n

Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
print((n + 1) / 2 * n)

Failing test case input:
-175

Expected output:
0.497142857143


Actual output:
15225.0


Fixed submission (verdict: Accepted):
n = int(input())
print(((n + 1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

if n == 1:
    print(1)
    
elif n % 2 == 0:
    print(0.5)
else:
    print(0.6)

Failing test case input:
-2019

Expected output:
0.49975235265


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())

if n == 1:
    print(1)
    
elif n % 2 == 0:
    print(0.5)
else:
    print((n

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())



print((N/2)/N if N%2 == 0 else (N/2+1)/N)

Failing test case input:
-685

Expected output:
0.499270072993


Actual output:
0.4985401459854015


Fixed submission (verdict: Accepted):

N = int(input())



print((N/2)/N if N%2 == 0 else (N

Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

if n%2 == 0:
    t=(n/2)/n
else:
    t=(n/2+1)/n

print('{:.10f}'.format(t))

Failing test case input:
-919

Expected output:
0.499455930359


Actual output:
0.4989118607


Fixed submission (verdict: Accepted):
n = int(input())

if n%2 == 0:
    t=(n
else:
    t=(n

print('{:.10f}'.format(t))

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print((n+1)/(2*n))

Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.4999364756701817


Fixed submission (verdict: Accepted):
n = int(input())
print((n+1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print((n+1)/2)

Failing test case input:
-669

Expected output:
0.499252615845


Actual output:
-334.0


Fixed submission (verdict: Accepted):
n=int(input())
print(((n+1)
Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N == 1:
  print(1)
elif N%2 != 0:
  print((N-2)/5)
else:
  print(N/2)

Failing test case input:
-1299

Expected output:
0.49961508853


Actual output:
-260.2


Fixed submission (verdict: Accepted):
import sys
N = int(input())
if N == 1:
  print(1)
  sys.exit(0)
if N % 2 == 0:
  print(1/2)
else:
  print(((N+1)

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(2 / N)

Failing test case input:
-4637

Expected output:
0.499892171663


Actual output:
-0.00043131334914815614


Fixed submission (verdict: Accepted):
N=int(input())
print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

if N%2==0:
  print(0.5)
else:
  print((0.5*N+1)/N)

Failing test case input:
-175

Expected output:
0.497142857143


Actual output:
0.4942857142857143


Fixed submission (verdict: Accepted):
N=int(input())
 
if N%2==0:
  print(0.5)
else:
  print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
if x == 1:
    print(1.0000000000)
elif x % 2 == 0:
    print(0.5000000000)
else:
    print(0.6000000000)


Failing test case input:
-1173

Expected output:
0.49957374254


Actual output:
0.6


Fixed submission (verdict: Accepted):
x = int(input())
if x == 1:
    print(1)
elif x % 2 == 0:
    print(0.5)
else:
    print((x

Problem: p02897
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
if N % 2 == 0:
    print(2/N)
else:
    print(2/(N+1))

Failing test case input:
-1739

Expected output:
0.499712478436


Actual output:
-0.0011507479861910242


Fixed submission (verdict: Accepted):
N = int(input())
if N % 2 == 0:
    print((N/2)/N)
else:
    print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
if a==1:
    print(1)
else:
    if a%2==1:
        print(float(3/2))
    else:
        print(float(1/2))

Failing test case input:
-2019

Expected output:
0.49975235265


Actual output:
1.5


Fixed submission (verdict: Accepted):
a=int(input())
if a==1:
    print(1)
else:
    if a%2==1:
        print(float((a
       
    else:
        print(float(1/2))

Problem: p02897
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

if 2 <= N and N%2 == 0:
    print((2/N))

elif 2<=N and N%2 != 0:
    print((N-2)/N)

else:
    print("1.00000")

Failing test case input:
-1297

Expected output:
0.499614494988


Actual output:
1.00000


Fixed submission (verdict: Accepted):
N = int(input())

if 2 <= N and N%2 == 0:
    print(((N

elif 2<=N and N%2 != 0:
    print(((N+1)

else:
    print("1.00000")

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
  print (n)
else:
  if n % 2 == 1:
    print(0.6)
  else:
    print(0.5)

Failing test case input:
-1299

Expected output:
0.49961508853


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())
if n == 1:
  print (n)
else:
  if n % 2 == 1:
    print((n
  else:
    print(1/2)
Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
if n == 1:
    print('{:.10g}'.format(0.5000000000))
elif n%2 ==1:
    print('{:.10g}'.format(0.6000000000))
else:
    print('{:.10g}'.format(0.5000000000))

Failing test case input:
-855

Expected output:
0.499415204678


Actual output:
0.6


Fixed submission (verdict: Accepted):
n = int(input())

k = n%2
if n == 1:
    print('{:.10f}'.format(1.0000000000))
elif k == 1:
    print('{:.10f}'.format((n
else:
    print('{:.10f}'.format(0.5000000000))

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 1:
    print('{:.10f}'.format(0.5000000000))
elif n%2 ==1:
    print('{:.10f}'.format(0.6000000000))
else:
    print('{:.10f}'.format(0.5000000000))

Failing test case input:
-1173

Expected output:
0.49957374254


Actual output:
0.6000000000


Fixed submission (verdict: Accepted):
n = int(input())

k = n%2
if n == 1:
    print('{:.10f}'.format(1.0000000000))
elif k == 1:
    print('{:.10f}'.format((n
else:
    print('{:.10f}'.format(0.5000000000))

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

if N == 1:
  print(1)
elif N%2 == 0:
  print(0.5)
else:
  print(0.6)

Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.6


Fixed submission (verdict: Accepted):
N = int(input())

if N == 1:
  print(1)
elif N%2 == 0:
  print(0.5)
else:
  print((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())

print(1/2 if (N%2)==0 else (N+1)/2*N)

Failing test case input:
-685

Expected output:
0.499270072993


Actual output:
234270.0


Fixed submission (verdict: Accepted):
N = int(input())

print("0.5" if (N%2)==0 else ((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=int(input())
if A%2==0:
    print(0.5)
elif A==1:
    print(1)
else:
    print(0.6)

Failing test case input:
-7871

Expected output:
0.49993647567


Actual output:
0.6


Fixed submission (verdict: Accepted):
A=int(input())
if A%2==0:
    print(0.5)
elif A==1:
    print(1)
else:
    print((A-A

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
mod = N % 2

if N == 1:
    print(N)
elif mod == 0:
    print(0.500000)
elif mod == 1:
    print((float(N-2)/float(N)))

Failing test case input:
-1173

Expected output:
0.49957374254


Actual output:
1.0017050298380221


Fixed submission (verdict: Accepted):
N = int(input())
mod = N % 2

if N == 1:
    print(1.0000000)
elif mod == 0:
    print(0.500000)
elif mod == 1:
    print((float((N

Problem: p02897
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

if n == 1: print(1)
elif n % 2 == 0: print(2/n)
else: print((2+1)/n)

Failing test case input:
-2609

Expected output:
0.499808355692


Actual output:
-0.0011498658489842851


Fixed submission (verdict: Accepted):
n = int(input())

if n == 1: print(1)
elif n % 2 == 0: print(0.5)
else: print((n+1)
Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = input()
str_list = []
ans = "Yes"
str_list = h.split(" ")

for j in range (len(str_list)-1):

  if(int(str_list[j]) > int(str_list[j+1])):
    str_list[j] = str(int(str_list[j])-1)
  if(int(str_list[j]) > int(str_list[j+1])):
    ans = "No"
    break

print(ans)

Failing test case input:
4
1 3 2 1

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
h = input()
str_list = []
ans = "Yes"
str_list = h.split(" ")

for j in range (len(str_list)-1):

  if(int(str_list[j]) < int(str_list[j+1])):
    str_list[j+1] = str(int(str_list[j+1])-1)
  elif(int(str_list[j]) > int(str_list[j+1])):
    ans = "No"
    break

print(ans)

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



N=4
s=[1,3,1,2]

for i in range(N-1):    
    if s[i]<s[i+1]:
        s[i+1]=s[i+1]-1


        
if s==sorted(s):
    print("Yes")
else:
    print("No")


Failing test case input:
1
0011001010

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
s=list(map(int, input().split()))




for i in range(len(s)-2,-1,-1):    
    if s[i]>s[i+1]:
        s[i]=s[i]-1


        
if s==sorted(s):
    print("Yes")
else:
    print("No")

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import exit

n = int(input())
h = [int(x) for x in input().split()]
h_max = max(h)
max_index = h.index(h_max)

if n == 1:
    print('Yes')
else:
    for i in range(max_index + 1, n):
        if  h_max - 1 > h[i] :
            print('No')
            exit()
    print('Yes')

Failing test case input:
5
1 2 0 6 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from sys import exit

N = int(input())
H = [int(x) for x in input().split()]

if N == 1:
    print('Yes')
else:
    num = 0
    for h in H:
        if num - 1 <= h:
            num = max(num, h)
        else:
            print('No')
            exit()
    print('Yes')

Problem: p02953
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
H = list(map(lambda h: int(h), input().split(" ")))

impossible = False
for i in range(len(H) - 1):
  if H[i] - H[i+1] >= 2:
    impossible = True

print("No") if impossible else print("Yes")

Failing test case input:
4
1 3 2 1

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(lambda h: int(h), input().split(" ")))

maxH = []
for i in range(len(H)):
  if i == 0:
    maxH.append(H[i])
  else:
    maxH.append(max([H[i],maxH[i-1]]))

impossible = False
for i in range(len(H)):
  if maxH[i] - H[i] >= 2:
    impossible = True

print("No") if impossible else print("Yes")
Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())

tan = list(map(int, input().split()))


a=True

for i in range(n-2):
    if tan[i] < tan[i+1] :
        if tan[i+1] - tan[i] > 1:
            print("No")
            a=False

if a:
    print("Yes")




Failing test case input:
5
0 2 0 3 6

Expected output:
No


Actual output:
No
No


Fixed submission (verdict: Accepted):

n = int(input())

tan = list(map(int, input().split()))

f = 0

a=True

for i in range(n-1):
    if tan[i] < tan[i+1] :
        f -= 1
    else :
        f += (tan[i]-tan[i+1])

    if f < 0 :
        f=0
    elif f >= 2 :
        print("No")
        exit()
    else :
        pass

if a :
    print("Yes")

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

if n == 1:
    print("Yes")

h = list(map(int, input().split()))
highest = h[-1]
for hi in h[-2::-1]:
    if hi - highest >= 2:
        print("No")
        exit()
    elif hi - highest == 1:
        highest = hi - 1
    else:
        highest = hi
print("Yes")


Failing test case input:
1
0011101001

Expected output:
Yes


Actual output:
Yes
Yes


Fixed submission (verdict: Accepted):
n = int(input())

if n == 1:
    print("Yes")
    exit()

h = list(map(int, input().split()))
highest = h[-1]
for hi in h[-2::-1]:
    if hi - highest >= 2:
        print("No")
        exit()
    elif hi - highest == 1:
        pass
    else:
        highest = hi
print("Yes")

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
h = [int(i) for i in input().split()]

if N > 1:
    for i in range(N-2):
        if h[i+1] >= h[i] + 2 or h[i+1] <= h[i] - 2:
            print("No")
            exit()

    if h[N-1] >= h[N-3]:
        print("Yes")
    else:
        print("No")

else:
    print("Yes")


Failing test case input:
5
1 2 3 6 5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
h = [int(i) for i in input().split()]

for i in range(N-1):
    if h[-(i+2)] > h[-(i+1)] + 1:
        print("No")
        exit()
    
    elif h[-(i+2)] == h[-(i+1)] + 1:
        h[-(i+2)] -= 1
    
    else:
        continue

print("Yes")
Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
lst = sorted(map(int, input().split()))

print(lst)
flag = 0
for i in range(0,len(lst)-1):
    print(i)
    if lst[i]-1 == lst[i+1]:
        lst[i] = lst[i] - 1


print(lst)

if flag == 0:
    for i in range(0,len(lst)-1):
        if lst[i] <= lst[i+1]:
            flag = 0
        else:
            flag = 1



if flag == 0:
    print('Yes')
else:
    print('No')

Failing test case input:
1
1000011100

Expected output:
Yes


Actual output:
[1000011100]
[1000011100]
Yes


Fixed submission (verdict: Accepted):
n = int(input())
lst = [int(i) for i in input().split()]

lst[0] -=1
for i in range(1,len(lst)):
    if (lst[i-1] != lst[i]) or (lst[i-1] > lst[i]):
        lst[i] -= 1

flag = 0
for i in range(len(lst)-1):
    if (lst[i] <= lst[i + 1]) & (flag==0):
        flag = 0
    else:
        flag = 1

if len(lst) == 1:
    flag = 1


if flag == 0:
    print('Yes')
else:
    if len(lst) == 1:
        print('Yes')
    else:
        print('No')

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))
ans = "YES"
tmplist = [H[0]]
for i in range(1,N):
    tmp = H[i]
    if tmp >= max(tmplist)-1:
        tmplist.append(tmp)
    else:
        ans = "NO"
        break
print(ans)

Failing test case input:
5
4 2 -1 1 3

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int,input().split()))
ans = "Yes"
for i in range(1,N):
    if H[-i] < H[-i-1]:
        if H[-i]+1 == H[-i-1]:
            H[-i-1] += -1
        else:
            ans = "No"
            break
print(ans)

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
list_h= list(map(int,input().split()))
check = 0
for i in range(n-2):
    if list_h[i+1] >= list_h[i]:
        list_h[i] -= 1
        check = 0
    elif list_h[i+1] < list_h[i] - 1:
        check = 2
        break
    elif list_h[i+1] == list_h[i] - 1:
        list_h[i] -= 1
        check += 1
if check <= 1 or n == 1:
    print("Yes")
else:
    print("No")

Failing test case input:
4
1 1 18 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
list_h= list(map(int,input().split()))
check = 0
for i in range(n-1):
    if list_h[i+1] > list_h[i]:
        check = 0
    elif list_h[i+1] == list_h[i] and check == 0:
        list_h[i] -= 1
    elif list_h[i+1] < list_h[i] - 1:
        check = 2
    elif list_h[i+1] == list_h[i] - 1:
        list_h[i] -= 1
        check += 1
    if  check == 2:
        break
if check <= 1 or n == 1:
    print("Yes")
else:
    print("No")
Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
import math
input = sys.stdin.readline


def main():
    n = int(input())
    h = list(map(int, input().split()))

    for i in reversed(range(n - 1)):
        if h[i + 1] >= h[1]:
            continue
        elif h[i + 1] + 1 == h[i]:
            h[i] -= 1
            continue
        elif h[i + 1] < h[i]:
            print("No")
            return
    print("Yes")


if __name__ == '__main__':
    main()


Failing test case input:
4
1 0 11 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

import sys
import math
input = sys.stdin.readline


def main():
    n = int(input())
    h = list(map(int, input().split()))

    for i in reversed(range(n - 1)):
        if h[i] <= h[i + 1]:
            continue
        elif h[i] == h[i + 1] + 1:
            h[i] -= 1
            continue
        elif h[i] > h[i + 1]:
            print("No")
            return
    print("Yes")


if __name__ == '__main__':
    main()

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
numbers = list(map(int, input().split()))

def checkCondition():
  count = 0
  for i in range(n-1):
    if numbers[i] > numbers[i+1]:
      if numbers[i] - numbers[i+1] > 1:
        return False
      else:
        numbers[i+1] -= 1
  return True

if n == 1:
  print('Yes')
else:
  if checkCondition():
    print('Yes')
  else:
    print('No')

Failing test case input:
4
1 3 2 1

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
numbers = list(map(int, input().split()))

def checkCondition():
  for i in range(n-1):
    if numbers[i] > numbers[i+1]:
      if numbers[i] - numbers[i+1] > 1:
        return False
  for i in range(-1, -n, -1):
    if numbers[i-1] - numbers[i] == 1:
      numbers[i-1] -= 1
    elif numbers[i-1] - numbers[i] > 1:
      return False
  return True

if n == 1:
  print('Yes')
else:
  if checkCondition():
    print('Yes')
  else:
    print('No')

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = list(map(int,input().split()))

for i in range(n-1):
    if h[n-1-i] < h[n-1-i-1]:
        h[n-1-i-1] -= 1
print(h)
for i in range(1,n):
    if h[i] < h[i-1]:
        print('No')
        exit()

print('Yes')
        

Failing test case input:
1
0011111001

Expected output:
Yes


Actual output:
[11111001]
Yes


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int,input().split()))

for i in range(n-1):
    if h[n-1-i] < h[n-1-i-1]:
        h[n-1-i-1] -= 1
for i in range(1,n):
    if h[i] < h[i-1]:
        print('No')
        exit()

print('Yes')
Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-2):
  if H[i+1]-H[i]<0 and H[i+2]-H[i+1]<0:
    cnt = 1
    break
  elif H[i+1]-H[i]<-1:
    cnt = 1
    break
if cnt >0:
  print('No')
else:
  print('Yes')


Failing test case input:
4
1 1 18 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int,input().split()))
H.reverse()
cnt = 0
for i in range(N-1):
  if H[i+1]-H[i]==1:
    H[i+1] = H[i+1]-1
  elif H[i+1]-H[i]>1:
    cnt = 1
    break
if cnt == 0:
  print('Yes')
else:
  print('No')

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys

def main():
    N = int(input())
    H = list(map(int, input().split()))

    for i in range(N-1):
        if H[i + 1] - H[i] == 1:
            H[i + 1] -= 1
        elif H[i] <= H[i + 1]:
            continue
        else:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()

    


Failing test case input:
5
1 2 3 6 5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

import sys

def main():
    N = int(input())
    H = list(map(int, input().split()))
    H = H[::-1]

    for i in range(N-1):
        if H[i + 1] - H[i] == 1:
            H[i + 1] -= 1
        elif H[i] >= H[i + 1]:
            continue
        else:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())

tan = list(map(int, input().split()))

t=tan[n-1]

m = max(tan)

a=True

if (m - t) > 1 :
    print("No")
    a=False

if a:
    for i in range(n-1):
        if (tan[i] - tan[i+1]) > 1:
            print("No")
            a=False


if a:
    print("Yes")




Failing test case input:
5
5 3 -1 0 4

Expected output:
No


Actual output:
No
No


Fixed submission (verdict: Accepted):

n = int(input())

tan = list(map(int, input().split()))

f = 0

a=True

for i in range(n-1):
    if tan[i] < tan[i+1] :
        f -= 1
    else :
        f += (tan[i]-tan[i+1])

    if f < 0 :
        f=0
    elif f >= 2 :
        print("No")
        exit()
    else :
        pass

if a :
    print("Yes")

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h = list(map(int,input().split()))



for i in range(n):

    if(i==0):
        pass
    elif( int(h[-(i+1)]) >= 1 + int(h[-i]) ):
        answer = "No"
        break
    elif(int(h[-(i+1)]) == 1 + int(h[-i])):
        tem = 1
    else:
        tem = 0

    answer = "Yes"


print(answer)

Failing test case input:
5
0 1 0 1 3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
h = list(map(int,input().split()))

tem =0

for i in range(n):

    if(i==0):
        pass
    elif( int(h[-(i+1)]) > 1 + int(h[-i]) - tem ):
        answer = "No"
        break
    elif(int(h[-(i+1)]) == 1 + int(h[-i]) - tem  ):
        tem = 1
    else:
        tem = 0

    answer = "Yes"


print(answer)
Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[int(i) for i in input().split()]
r='Yes'
for i in range(n-1):
  if a[-2-i]-a[-1-i]>1:
    r='No'
    break
  elif a[-2-i]-a[-1-i]==1:
    a[-2-i]=a[-2-i]-1
print(a)    

Failing test case input:
5
0 2 0 0 6

Expected output:
No


Actual output:
[0, 2, 0, 0, 6]


Fixed submission (verdict: Accepted):
n=int(input())
a=[int(i) for i in input().split()]
r='Yes'
for i in range(n-1):
  if a[-2-i]-a[-1-i]>1:
    r='No'
    break
  elif a[-2-i]-a[-1-i]==1:
    a[-2-i]=a[-2-i]-1
print(r)

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
N = int(input())
H = list(map(int, input().split()))

for i in range(N-2):
  if H[i] >= H[i+1] > H[i+2]:
    print('No')
    sys.exit()
print('Yes')

Failing test case input:
4
1 0 5 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
N = int(input())
H = list(map(int, input().split()))

for i in range(N-1,0,-1):
  if H[i-1] - H[i] > 1:
    print('No')
    sys.exit()
  elif H[i-1] > H[i]:
    H[i-1] -= 1
print('Yes')

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
b=True
for i in range(1,n):
  if l[-i]>=l[-i-1]:
    pass
  elif l[-i]==l[-1-i]+1:
    l[-1-i]=l[-1-i]-1
  else:
    b=False
    break
if b:
  print("Yes")
else:
  print("No")


Failing test case input:
5
0 1 0 0 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
b=True
for i in range(1,n):
  if l[n-i]>=l[n-i-1]:
    pass
  elif l[n-i]==l[n-1-i]-1:
    p=l[n-1-i]
    l[n-1-i]=p-1
  else:
    b=False
    break
if b:
  print("Yes")
else:
  print("No")

Problem: p02953
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

H = list(map(int, input().split()))

for i in range(N):
    if i == 0:
        H[i] -= 1
        continue

    if i == N - 1:
        if H[i] < H[i - 1]:
            print('No')
            exit()
        else:
            break

    if H[i + 1] - H[i] <= -1:
        H[i] -= 1

        if H[i] < H[i - 1]:
            print('No')
            exit()

print('Yes')


Failing test case input:
5
2 2 0 0 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

H = list(map(int, input().split()))

for i in range(N):
    if i == 0:
        H[i] -= 1
        continue

    if i == N - 1:
        if H[i] < H[i - 1]:
            print('No')
            exit()
        else:
            break

    if H[i + 1] - H[i] <= -2:
        print('No')
        exit()

    if H[i + 1] - H[i] <= 0:
        if H[i] > H[i - 1]:
            H[i] -= 1
    elif H[i] < H[i + 1] and H[i - 1] < H[i]:
        H[i] -= 1

    if H[i] < H[i - 1]:
        print('No')
        exit()

print('Yes')