Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02691 (python)

Fixed submission:
import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
d=cc.defaultdict(int)
n,=I()
l=I()
ans=0
for i in range(n):
    d[l[i]+i]+=1
    ans+=d[i-l[i]]
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
f=cc.defaultdict(int)
n,=I()
l=I()
ans=0
for i in range(n):
    d[l[i]+i]+=1
    ans+=d[i-l[i]]
print(ans)
Problem p02756 (python)

Fixed submission:
from collections import deque
S = deque(input())
N = int(input())
is_inversed = False
for i in range(N):
    Q = input()
    if Q[0] == '1':
        is_inversed = not (is_inversed)
    else:
        if (Q[2] == '1' and is_inversed) or (Q[2] == '2' and not (is_inversed)):
            S.append(Q[4])
        else:
            S.appendleft(Q[4])
if is_inversed:
    print(''.join(list(S)[::-1]))
else:
    print(''.join(S))

Buggy submission (verdict: Runtime Error):
from collections import deque
ans=deque()
ans.append(input())
c=0
qu=[input().split() for i in range(int(input()))]
c=0
for i in qu:
    if i[0]=='1':
        c+=1
    else:
        if c%2==0:
            if i[1]=='1':
                ans.appendleft(i[2])
            else:
                ans.append(i[2])
        else:
            ans=ans[::-1]
            if i[1]=='1':
                ans.appendleft(i[2])
            else:
                ans.append(i[2])
            
print(''.join(ans))
Problem p02784 (python)

Fixed submission:
a,b=map(int,input().split())
l=list(map(int,input().split()))
if sum(l)>=a:
	print('Yes')
else:
	print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
l=list(map(int,input().spliit()))
if max(l)>=a:
	print('Yes')
else:
	print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(.split()))
*aa,=map(int,input().split())
if max(aa)>=a:
    print("yes")
else:
    print('no')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(.split()))
aa=max(map(int,input().split()))
if aa>=a:
    print("yes")
else:
    print('no')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(.split()))
aa=max(map(int,input().split()))
if aa>=a:
    print("yes")
else:
    print('No')
Problem p02801 (python)

Fixed submission:
s=input()
print(chr(ord(s)+1))

Buggy submission (verdict: Runtime Error):
s=input()
print(char(ord(s)+1))
Problem p02811 (python)

Fixed submission:

n,m=map(int,input().split())
print("Yes") if n*500>=m else print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if if n*500>=m:
    print("Yes")
else:
    print("No")
Problem p02813 (python)

Fixed submission:
n=int(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
import itertools as it
x=0
y=0
for i,j in enumerate(it.permutations(list(range(1,n+1)))):
    if a==j:
        x=i
    if b==j:
        y=i
print(abs(x-y))

Buggy submission (verdict: Runtime Error):
n=(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
import itertools as it
x=0
y=0
for i,j in enumerate(it.permutations(range(1,n+1))):
    if a==j:
        x=i
    if b==j:
        y=i
print(abs(x-y))
Problem p02817 (python)

Fixed submission:
a,b=map(str,input().split())
print(b+a)

Buggy submission (verdict: Runtime Error):
nn=int(input())
n=10**5+100
ar=[0]*(n)
ar[1]=0
ans=0
pre=1
for i in range(2,int((n**0.5))+1):
    if ar[i]==0:

        for j in range(2*i,n,i):
            ar[j]=1
ans=1
if ar[nn]==0:
    print(nn)
else:
        
    for i in range(nn,n):
        if ar[i]==0:
            print(i)
            break
Problem p03160 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
dp=[0]*(n)
dp[0]=0
dp[1]=abs(l[0]-l[1])
for i in range(2,n):
    dp[i]=min(abs(l[i]-l[i-2])+dp[i-2],abs(l[i]-l[i-1])+dp[i-1])
print(dp[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
dp=[0]*(n)
dp[0]=0
dp[1]=abs(l[0]-l[1])
dp[2]=abs(l[2]-l[1])
for i in range(2,n):
    dp[i]=min(abs(l[i]-l[i-2])+dp[i-2],abs(l[i]-l[i-1])+dp[i-1])
print(dp[-1])
Problem p03161 (python)

Fixed submission:

n,k=map(int,input().split())
l=list(map(int,input().split()))
a=[10**9+7]*(n)
a[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j>=0:
            a[i]=min(a[i],abs( l[i]-l[i-j])+a[i-j]) 
print(a[-1])

Buggy submission (verdict: Runtime Error):
import math as mt
n,k=map(int,input().split())
l=list(map(int,input().split()))
a=[mt.inf]*(n)
a[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j>=0:
            a[i]=min(a[i],abs( l[i]-l[i-j])+a[i-j]) 
print(a[-1])

Buggy submission (verdict: Runtime Error):
import math as mt
n,k=map(int,input().split())
l=list(map(int,input().split()))
a=[mt.inf]*(n)
a[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j>=0:
            a[i]=min(a[i],abs( l[i]-l[i-j])+a[i-j]) 
print(a[-1])
Problem p04029 (python)

Fixed submission:
n=int(input())
print(int(n*(n+1)/2))

Buggy submission (verdict: Runtime Error):
s=input()
temp=0
tem=0
tot=0
if len(s)>10**3:
        
    for i in range(len(s)):
        tem=1
        temp=1
        flag=0
        for j in range(i+1,len(s)):
            if s[j]==s[i]:
                temp+=1
            tem+=1
            if temp>(tem//2 ):
                print(i+1,j+1)
                
                flag=1
                tot=1
                break
        if flag:
            break
    if tot==0:
        print("-1 -1")
else:
    for i in range(len(s)-2):
        if s[i]==s[i+1]:
            print(i+1,i+2)
            flag=1
            break
        elif s[i]==s[i+2]:
            print(i+1,i+3)
            flag=1
            break
    if flag==0:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
x=10**9+7
if max(l)==min(l):
    print(0)
else:
        
    for i in range(min(l),max(l)+1):
        te=0
        
        for j in l:
            te=te+(abs(j-i))**2
        #print(i,te)
        x=min(x,te)
    print(x)
Problem p04032 (python)

Fixed submission:
s=input()
temp=0
tem=0
tot=0
flag=0
if s[-2]==s[-1]:
    print(len(s)-1,len(s))
else:
        
    if 1:
        for i in range(len(s)-2):
            if s[i]==s[i+1]:
                print(i+1,i+2)
                flag=1
                break
            elif s[i]==s[i+2]:
                print(i+1,i+3)
                flag=1
                break
        if flag==0:
            print("-1 -1")

Buggy submission (verdict: Runtime Error):
s=input()
temp=0
tem=0
tot=0
if len(s)>10**3:
        
    for i in range(len(s)):
        tem=1
        temp=1
        flag=0
        for j in range(i+1,len(s)):
            if s[j]==s[i]:
                temp+=1
            tem+=1
            if temp>(tem//2 ):
                print(i+1,j+1)
                
                flag=1
                tot=1
                break
        if flag:
            break
    if tot==0:
        print("-1 -1")
else:
    for i in range(len(s)-2):
        if s[i]==s[i+1]:
            print(i+1,i+2)
            flag=1
            break
        elif s[i]==s[i+2]:
            print(i+1,i+3)
            flag=1
            break
    if flag==0:
        print("-1 -1")
Problem p04033 (python)

Fixed submission:
import sys
# import numpy as np 
 
def main():
    a, b = map(int, sys.stdin.read().split())
 
    if 0 < a:
        ans = 'Positive'
    elif 0 <= b:
        ans = 'Zero'
    else:
        if (b - a + 1) % 2 == 0:
            ans = 'Positive'
        else:
            ans = 'Negative'
    
    print(ans)
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
# import numpy as np 
 
def main():
    a, b = map(int, sys.stdin.read().split())
 
    if 0 < a:
        ans = 'Positive'
    elif 0 <= b:
        ans = 'Zero'
    else:
        if (b - a + 1) % 2 == 0:
            ans = 'Positive'
        else:
            ans = 'Negative'
    
    print(ans)
 
if __name__ == '__main__':
    main(

Buggy submission (verdict: Runtime Error):
I=lambda:list(map(int,input().split()))
a=I()
if a[0]>=0:
    print("Positive")
else:
    d=list(range(a[0],a[1]+1))
    if 0 in d:
        print("Zero")
    elif len(d)%2==0:
        print("Positive")
    else:
        print("Negative")
Problem p02642 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
xs = [0] * (max(a) + 1)
 
for v in a:
    if xs[v] == 0:
        for j in range(v, len(xs), v):
            xs[j] += 1
    else:
        xs[v] += 1
print(len(list(filter(lambda v: xs[v] == 1, a))))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import math
 
def INT(): return int(input())
def MAPINT(): return map(int, input().split())
def LMAPINT(): return list(map(int, input().split()))
def STR(): return input()
def MAPSTR(): return map(str, input().split())
def LMAPSTR(): return list(map(str, input().split()))
 
f_inf = float('inf')
 
n = INT()
a = sorted(LMAPINT())

ans = [True] * n
for i in range(n)):
  if ans[i] is False:
    continue
  for j in range(i+1, n):
    if a[j] % a[i] == 0:
      ans[j] = False
    if a[j] == a[i]:
      ans[i], ans[j] = False, False
 
print(ans.count(True))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import math
 
def INT(): return int(input())
def MAPINT(): return map(int, input().split())
def LMAPINT(): return list(map(int, input().split()))
def STR(): return input()
def MAPSTR(): return map(str, input().split())
def LMAPSTR(): return list(map(str, input().split()))
 
f_inf = float('inf')
 
n = INT()
a = sorted(LMAPINT())

ans = [True] * n
for i in range(int(math.sqrt(n))+1):
  if ans[i] is False:
    continue
  for j in range(i+1, n):
    if a[j] % a[i] == 0:
      ans[j] = False
    if a[j] == a[i]:
      ans[i], ans[j] = False, False
 
print(ans.count(True))
Problem p02756 (python)

Fixed submission:
import sys
from collections import deque

def main():
    input = sys.stdin.readline

    s = input()[:-1]
    q = int(input())
    tmp = [input().split() for _ in range(q)]

    flag = 0
    ans = deque([s])
    for t in tmp:
        if len(t) == 1:
            flag = ~flag 
        else:
            f = int(t[1])
            c = t[2]
            if (f == 1 and flag == 0) or (f ==2 and flag == -1):
                ans.appendleft(c)
            else:
                ans.append(c)
    if flag == 0:
        print(''.join(ans))
    else:
        print(''.join(ans)[::-1])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque

def main():
    input = sys.stdin.readline

    s = input()[:-1]
    q = int(input())
    tmp = [input().split() for _ in range(q)]

    flag = 0
    ans = deque([s])
    for t in tmp:
        if len(t) == 1:
            flag = ~flag 
        else:
            f = int(t[1])
            c = t[2]
            if (f == 1 and flag == 0) or (f ==2 and fag == -1):
                ans.appendleft(c)
            else:
                ans.append(c)
    if flag == 0:
        print(''.join(ans))
    else:
        print(''.join(ans[::0]))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    s = input()[:-1]
    q = int(input())
    tmp = [input().split() for _ in range(q)]

    for i in range(len(tmp)):
        if len(tmp[i]) == 1:
            s = s[::-1]
        else:
            if int(tmp[i][1]) == 1:
                s = tmp[i][2] + s
            else:
                s = tmp[i][2] + c
                
    print(s)

if __name__ == '__main__':
    main()
Problem p03501 (python)

Fixed submission:
N, A, B = [int(i) for i in input().split()]

cost = B

if(N*A < B):
    cost = N*A

print(cost)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

N = int(input())
_N = N

size = int (math.log10(N) + 1)

f = 0
while(size > 0):
    if(size > 1):
        f += int(N/(10**(size-1)))
        N %= 10**(size-1)
    else:
        f += N
    size -= 1

if(_N%f == 0):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

N = int(input())
_N = N

size = int (math.log10(N) + 1)

f = 0
while(size > 0):
    if(size > 1):
        f += int(N/(10**(size-1)))
        # print(int(N/(10**(size-1))))
        N %= 10**(size-1)
    else:
        f += N
        # print(N)
    size -= 1

# print(_N, f, _N%f)

if(_N%f == 0):
    print('Yes')
else:
    print('No')
Problem p02606 (python)

Fixed submission:
import sys

if __name__ == "__main__":
    L, R, d = list(map(lambda x: int(x), sys.stdin.readline().split()))
    ans = sum([1 if i % d == 0 else 0 for i in range(L, R+1)])
        
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
import math

if __name__ == "__main__":
    N = int(sys.stdin.readline())

    for i in range(1, N+1):
        ans = 0
        ls = range(1, int(math.sqrt(i)))
        # ls = range(1, int(math.sqrt(i))-2*i)
        # print(ls)
        for (x,y,z) in sorted(itertools.combinations_with_replacement(ls, 3), key=lambda x: (sum(x), max(x))):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if tmp > i:
                break
            elif i == tmp:
                ans += 1
                if x == y and y == z:
                    continue
                elif x == y or y == z or z == x:
                    ans += 3-1
                else:
                    ans += 6-1
        print(ans)
Problem p02642 (python)

Fixed submission:
inf =  1100000
def main():
  N =  int(input())
  a = list(map(int, input().split()))
  a.sort()
  detect = [0] *inf
  for x in a:
    if detect[x] != 0:
      detect[x] = 2
      continue
    for i in range(x, inf, x):
      detect[i] += 1
  ans = 0
  for i in range(N):
    if detect[a[i]] == 1:
      ans += 1
  print(ans)
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
inf =  1000005
def main():
  N = int(input())
  a = list(map(int, input().split()))
  a.sort()
  flag = [True]*inf
  num = [0]*inf 
  for i in range(N):
    num[a[i]] += 1
    if flag[a[i]*2]:
      j = 2
      while (j*a[i] < inf):
        flag[j*a[i]] = False
        j += 1
  ans = 0
  for i in range(N):
    if flag[a[i]] and num[a[i]] == 1:
      ans += 1
  print(ans)
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
inf =  210000
def main():
  N =  int(input())
  a = list(map(int, input().split()))
  a.sort()
  detect = [0] *inf
  for i in range(N):
    detect[a[i]] += 1
    j = 2
    while (a[i]*j < inf):
      if detect[a[i]*j] >= 2:
        break
      else:
        detect[a[i]*j] += 2
        j+=1
  ans = 0
  for i in range(N):
    if detect[a[i]]<2:
      ans += 1
  print(ans)
  
if __name__ == "__main__":
  main()
Problem p02720 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

k = int(input())
S = []
def dfs(s):
  if len(s)<10:
    for i in range(-1, 2, 1):
      a = str(min(9, max(0, int(s[0])+i)))+s
      S.append(a)
      dfs(a)

for i in range(10):
  S.append(i)
  dfs(str(i))
S = sorted(set([int(s) for s in S]))
print(S[k])

Buggy submission (verdict: Runtime Error):
k = int(input())
def dfs(s):
  if len(s)<10:
    for i in range(-1, 2, 1):
      s+str(min(9, max(0, int(s[-1])+i)))
      return dfs(s)
  else:
    return s
S = []
for i in range(10):
  S.append(dfs(str(i)))
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A = sorted(A)
B = sorted(B)

A = A[len(A)-x:]
B = B[len(B)-y:]
C = list(map(lambda x: x*(-1), C))

import heapq
heapq.heapify(A)
heapq.heapify(B)
heapq.heapify(C)

flag = True
while flag:
  a = heapq.heappop(A)
  b = heapq.heappop(B)
  c = heapq.heappop(C)*(-1)
  if c < a and c < b:
    heapq.heappush(A, a)
    heapq.heappush(B, b)
    flag = False
  else:
    if a > b:
      heapq.heappush(A, a)
      heapq.heappush(B, c)
      if not C:
        break
    else:
      heapq.heappush(A, c)
      heapq.heappush(B, b)
      if not C:
        break
print(sum(A) + sum(B))

Buggy submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A = sorted(A)
B = sorted(B)

A = A[len(A)-x:]
B = B[len(B)-y:]
C = list(map(lambda x: x*(-1), C))

import heapq
heapq.heapify(A)
heapq.heapify(B)
heapq.heapify(C)

flag = True
while flag:
  a = heapq.heappop(A)
  b = heapq.heappop(B)
  c = heapq.heappop(C)*(-1)
  if c < a and c < b:
    flag = False
  else:
    if a-c > b-c:
      heapq.heappush(A, c)
      heapq.heappush(B, b)
      if not C:
        break
    else:
      heapq.heappush(A, a)
      heapq.heappush(B, c)
      if not C:
        break
print(sum(A) + sum())
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
a = [[] for _ in range(N)]
flag = 0
for i in range(M):
  s, c = map(int, input().split())
  a[s-1].append(c)
ans = [0]*N
 
for i in range(len(a)): 
  if i == 0 and a[i]:
    if len(a) == 1:
      pass
    elif len(set(a[i]))> 1 or 0 in a[i]:
      flag = 1
      break
    else:
      ans[i] = a[i][0] 
  if len(set(a[i]))>1:
    flag = 1
    break
  elif a[i]:
    ans[i] = a[i][0]
if flag == 0:
  if ans[0] == 0:
    if len(a) == 1:
      ans[0] = 0
    else:
      ans[0] = 1
  ans = ''.join((str(n) for n in ans))
  print(int(ans))
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [[] for _ in range(N)]
for i in range(M):
  s, c = map(int, input().split())
  a[s-1].append(c)
flag = 0
ans = [0]*N
for i in range(len(a)):
  if len(set(a[i]))>1:
    flag = 1
    break
  elif a[i]:
    ans[i] = a[i][0]
if a[0][0] == 0:
  flag = 1
ans = ''.join((str(n) for n in ans))
if flag == 0:
  if a[0] == 0:
    a[0] = 1
  ans = ''.join((str(n) for n in ans))
  print(int(ans))
else:
  print(-1)
Problem p02817 (python)

Fixed submission:
T, S = map(str, input().split())
print(S + T)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
if K <= A:
  print(*[A-K, B])
elif K <= A + B:
  print(*[0, B-(K-A)])
else:
  print(*[0, 0])
Problem p02865 (python)

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

Buggy submission (verdict: Runtime Error):
N ＝ int(input())
if N%2＝＝0:
  print(N//2-1)
else:
  print(N//2)
Problem p02888 (python)

Fixed submission:
import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
ans = 0
 
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += bisect.bisect_left(l,l[i] + l[j]) - j - 1
print(ans)

Buggy submission (verdict: Runtime Error):
)import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
ans = 0
 
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += bisect.bisect_left(l,l[i] + l[j]) - j - 1
print(ans)

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
l = sorted(l)
ans = 0
for i in range(n):
  a = l[i]
  for j in range(i + 1, n):
    b = l[j]
    bel1 = j #OK
    up1 = n #OUT
    while up1- bel1 > 1:
      mid = (bel1 + up1)//2
      if a + b > l[mid]:
        bel1 = mid
      else:
        up1 = mid
    ans += (bel1-j)
print(ans)
Problem p02898 (python)

Fixed submission:
N, K = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(len(a)):
    if a[i] >= K:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split)
a = list(map(int, input().split))
count = 0
for i in range(len(a)):
    if a[i] >= K:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split)
a = list(map(int, input().split))
count = 0
for i in range(len(a)):
  if a[i] >= K:
    count += 1
print(count)
Problem p02899 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
import numpy as np
A = np.array(A)
for i in range(N):
    b = np.where(A==i+1)
    print(b[0][0]+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = map(int, input().split())
import numpy as np
A = np.array(A)
B = []
for i in range(n):
    b = np.where(A==i+1)
    print(b[0][0]+1)

Buggy submission (verdict: Runtime Error):
n = input()
A = map(int, input().split())
import numpy as np
A = np.array(A)
B = []
for i in range(N):
    b = np.where(A==i+1)
    print(b[0][0]+1)
Problem p02911 (python)

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]-1] += 1
for i in range(N):
  if point_list[i] <= 0:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]-1] += 1
for i in range(N):
  if point_list <= 0:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]] += 1
for i in range(N):
  if point_list <= 0:
    print("No")
  else:
    print("Yes")
Problem p02917 (python)

Fixed submission:
N = int(input())
B = list(map(int, input().split()))
A = []
for i in range(N):
  if i == 0:
    A.append(B[0])
  elif i == N-1:
    A.append(B[N-2])
  else:
    A.append(min(B[i], B[i-1]))
print(sum(A))

Buggy submission (verdict: Runtime Error):
N = input()
B = list(map(int, input().split()))
A = []
for i in range(N):
  if i == 0:
    A.append(B[0])
  elif i == N-1:
    A.append(B[N-2])
  else:
    A.append(min(B[i], B[i-1]))
print(sum(A))
Problem p02923 (python)

Fixed submission:
N = int(input())
H =list(map(int, input().split()))
count = []
count_tmp = 0
if N == 1:
    print(0)
else:
    for i in range(N-1):
        if H[i] >= H[i+1]:
            count_tmp += 1
            if i == N-2:
                count.append(count_tmp)
        else:
            count.append(count_tmp)
            count_tmp = 0
    print(max(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
H =list(map(int, input().split()))
count = []
count_tmp = 0
if N == 0:
    print(0)
else:
    for i in range(N-1):
        if H[i] >= H[i+1]:
            count_tmp += 1
            if i == N-2:
                count.append(count_tmp)
        else:
            count.append(count_tmp)
            count_tmp = 0
    print(max(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
H =list(map(int, input().split()))
count = []
count_tmp = 0
if N == 0:
  print(0)
else:
	for i in range(N-1):
    	if H[i] >= H[i+1]:
        	count_tmp += 1
        	if i == N-2:
            	count.append(count_tmp)
    	else:
        	count.append(count_tmp)
        	count_tmp = 0
	print(max(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
H =list(map(int, input().split()))
count = []
count_tmp = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        count_tmp += 1
        if i == N-2:
            count.append(count_tmp)
    else:
        count.append(count_tmp)
        count_tmp = 0
print(max(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
H =list(map(int, input().split()))
count = []
count_tmp = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        count_tmp += 1
        if i == N-2:
            count.append(count_tmp)
    else:
        print(i)
        count.append(count_tmp)
        count_tmp = 0
print(max(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
H =list(map(int, input().split()))
count = []
count_tmp = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    count_tmp += 1
  else:
    count.append(count_tmp)
    count_tmp = 0
print(max(count))