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

Fixed submission:
N=int(input())
H=list(map(int,input().split()))


M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    HH=[H[1]-H[0]]
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))

HH=[H[1]-H[0]]
M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))

HH=[0]
M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
K.append(M)
del K[0]
print(max(K))

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))

HH=[0]
M=0
K=[]
for i in range(1,N-1):
    HH.append(H[i+1]-H[i])
for i in range(len(HH)):
    if HH[i]<=0:
        M+=1
    else:
        K.append(M)
        M=0
K.append(M)
del K[0]
print(max(K))
Problem p02924 (python)

Fixed submission:
N=int(input())
S=(N*(N-1))//2
print(S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=N(N-1)/2
print(S)
Problem p03076 (python)

Fixed submission:
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)
if len(Y)==0:
    H=10
else:
    H=min(Y)

print(sum(Z)-(10-H))

Buggy submission (verdict: Runtime Error):
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)

print(sum(Z)-(10-min(Y)))

Buggy submission (verdict: Runtime Error):
Z=[]
Q=[]
Y=[]
for i in range(5):
    a=int(input())
    Q.append(a)
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)

print(sum(Z)-(10-min(Y)))

Buggy submission (verdict: Runtime Error):
Z=[]
Q=[]
Y=[]
for i in range(5):
    a=int(input())
    Q.append(a)
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)

print(sum(Z)-(10-min(Y)))
Problem p03331 (python)

Fixed submission:
N=int(input())

M=10**9
for i in range(1,N//2+1):
    a=list(str(i))
    b=list(str(N-i))
    #print(a,b)
    k=0
    for q in range(len(a)):
        k+=int(a[q])
    for p in range(len(b)):
        k+=int(b[p])
    M=min(M,k)
print(M)

Buggy submission (verdict: Runtime Error):
N=int(input())

M=10**9
for i in range(1,N//2+10):
    a=list(str(i))
    b=list(str(N-i))
    #print(a,b)
    k=0
    for q in range(len(a)):
        k+=int(a[q])
    for p in range(len(b)):
        k+=int(b[p])
    M=min(M,k)
print(M)
Problem p03371 (python)

Fixed submission:
A,B,C,X,Y=map(int,input().split())

K=10**9
for i in range(10**5+1):
    S=i*2*C+max(0,X-i)*A+max(0,Y-i)*B
    K=min(K,S)
print(K)

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y=map(int,input().split())

P=X*A+B*Y
if X>Y:
    Q=C*2*Y+(X-Y)*A
    L=X*2*C
elif Y<X:
    Q=C*2*Y+(Y-X)*B
    L=Y*2*C
elif X==Y:
    Q=min(C*2*Y, C*2*X)
    L=min(X*2*C, Y*2*C)



print(min(P,Q,L))
Problem p03547 (python)

Fixed submission:
X,Y =input().split()
a=int(X,16)
b=int(Y,16)

if a>b:
    print('>')
elif a<b:
    print('<')
elif a == b:
    print('=')

Buggy submission (verdict: Runtime Error):
a=int(X,16)
b=int(Y,16)

if a>b:
    print('>')
elif a<b:
    print('<')
elif a == b:
    print('=')
Problem p03548 (python)

Fixed submission:
X,Y,Z=map(int,input().split())
for i in range(50001):
    if Y*i+(i+1)*Z>X:
        print(i-1)
        break

Buggy submission (verdict: Runtime Error):
X,Y,Z =input().split()

U=(X-Y)/(Y+Z)

print(math.floor(U))
Problem p03612 (python)

Fixed submission:
N=int(input())
p=list(map(int,input().split()))

M=0
for i in range(N-1):
    if p[i]==i+1:
        p[i],p[i+1]=p[i+1],p[i]
        M+=1
if p[N-1]==N:
    M+=1
print(M)

Buggy submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))

M=0
for i in range(N):
    if p[i]==i+1:
        p[i],p[i+1]=p[i+1],p[i]
        M+=1
    
print(M)
Problem p03957 (python)

Fixed submission:
s=input()

if 'C' in s:
    A=s.index('C')
    for i in range(A,len(s)):
        if s[i]=='F':
            print('Yes')
            break
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=input()

A=s.index('C')
for i in range(A,len(s)):
    if s[i]=='F':
        print('Yes')
        break
else:
    print('No')
Problem p02696 (python)

Fixed submission:
# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))
A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*(i-1))
else:
    start = (math.floor(A*N/B)-A*math.floor(N/B))
    for i in range(1,ans+1):
        x= i*B-1
        start = max((math.floor(A*x/B)-A*(i-1)),start)
    print(start)
Problem p02702 (python)

Fixed submission:
# coding: utf-8
# Your code here!
def main():
    from functools import reduce
    import collections
     
    S = list(map(int,input().rstrip()))
    N=len(S)
    mod_list = [0]
    for i in range(1,N+1):
        new1 =pow(10,i-1,2019)
        new = (new1*S[-i]+mod_list[-1])%2019
        #print(new)
        mod_list.append(new)
        
    count = collections.Counter(mod_list)
    ans =0
    for j in range(2019):
        n = count[j]
        ans+= n*(n-1)/2
    print(int(ans))
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    S = list(map(str,input().rstrip()))
    l = len(S)
    result=0   
    
    for i in range(l):
        for j in range(1,l-i+1):
            print(S[i,i+j+1])
            n = int("".join(map(str, St)))
            print(S)
            if n %2019==0:
                result+=1
    print(result)
    
if __name__ == "__main__":
    main()
Problem p02705 (python)

Fixed submission:
# coding: utf-8
# Your code here!
r = int(input())
pai = 3.14159265359
rounds = 2*r*pai
print(rounds)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
line= list(map(int,input().split()))
N = line[0]
K = line[1]
#0~Nの連続した整数から
#K個以上(N+1)個以下だけ選ぶ
answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num
 
if answer >=(10**9+7):
    print(int(answer%(10**9+7)))
    
else:
    print(int(answer))
Problem p02718 (python)

Fixed submission:
#商品数を取り込む
line_num = input()
line = line_num.split(" ")
  
    #全得票数を計算する
line2 = input().split(" ")
sum_vote = 0
for i in line2:
   # print(i)
    sum_vote += int(i)
  
#規定得票数を算出する。
numa = sum_vote/int(line[1])
num= numa/4

list =[]
for i in line2:
    if int(i) >=num:
        list.append(i)
    else:
        pass

if len(list)>=int(line[1]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#商品数を取り込む
line_num = input()
line = line_num.split(" ")
  
    #全得票数を計算する
line2 = input().split(" ")
sum_vote = 0
for i in line2:
   # print(i)
    sum_vote += int(i)
  
#規定得票数を算出する。
numa = sum_vote/int(line[1])
num= numa/4

list =[]
for i in line2:
    if int(i) =>num:
        list.append(i)
    else:
        pass

if len(list)>int(line[1]):
    print("Yes")
else:
    print("No")
Problem p03161 (python)

Fixed submission:
import numpy as np
N,K = map(int,input().split())
h = np.array(list(map(int,input().split())))
dp=np.array([0 for i in range(N)])
dp[0]= 0
dp[1]=abs(h[1]-h[0])
if N<=K:
    dp[N-1]=abs(h[0]-h[N-1])
else:  
    for i in range(2,N):
      j=max(0,i-K)
      dp[i]=np.min(dp[j:i]+np.abs(h[i]-h[j:i]))
      #dp[i]=min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,min(k+1,i+1))])
print(int(dp[-1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
import numba
@numba.jit

def frog(N,K):

    h = np.array(list(map(int,input().split())))
    dp=np.array([0 for i in range(N)])
    dp[0]= 0
    dp[1]=abs(h[1]-h[0])
    if N<=K:
        dp[N-1]=abs(h[0]-h[N-1])
    else:  
        for i in range(2,N):
            dp[i]=min(dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-K),i))
            
            #dp[i]=np.min(list1)
             
    print(dp[N-1])

line = np.array(list(map(int,input().split())))
a,b = line[0],line[1]
frog(a,b)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
h = list(map(int,input().split()))
dp=[0for i in range(N)]
dp[0]= 0
for j in range(1,K+1):
    dp[j]= abs(h[0]-h[j])

for i in range(K,N):
    list1 =[]
    for k in range(1,K+1):
        cost = dp[i-k]+abs(h[i-k]-h[i])
        list1.append(cost)
    dp[i]= min(list1)
        
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
N,K = list(map(int,input().split()))
h= list(map(int,input().split()))
dp =[99999 for i in range(N)]
#初期条件を設定
for i in range(K):
    if i==0:
        dp[i]=0
    else:
        dp[i]=abs(h[i]-h[0])
for j in range(K,N):
    minit=[]
    for k in range(K):
        new =dp[j-k]+abs(h[j-k-1]-h[j])
        minit.append(new)
        
        
    dp[j]=min(minit)
print(dp[N-1])
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
if sum(a)+sum(b)<=k:
    print(n+m)
    exit()
num = 0
cnt = -1
for i in range(n+m):
    if num>k:
        break
    elif a == []:
        num += b[0]
        cnt +=1
        del b[0]
    elif b == []:
        num += a[0]
        cnt += 1
        del a[0]
    elif a[0] <= b[0]:
        num += a[0]
        cnt += 1
        del a[0]
    else:
        num += b[0]
        cnt += 1
        del b[0]
print(cnt)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
ans = "Yes"
for i in range(len(s)):
  if s[i] != t[i]:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
\s = input()
t = input()
ans = "Yes"
for i in range(len(s)):
  if s[i] != t[i]:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
s,t = input().split()
ans = "Yes"
for i in range(s):
  if s[i] != t[i]:
    ans = "No"
print(ans)
Problem p02700 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
ans = "No"
while True:
  c -= b 
  if c <= 0:
    ans = "Yes"
    break
  a -= d 
  if a <= 0:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
ans = "No"
while True:
  c -= b if c <= 0
    ans = "Yes" break
  a -= d if a <= 0 break
print(ans)
Problem p02705 (python)

Fixed submission:
R = int(input())
print(2*R*3.14159265)

Buggy submission (verdict: Runtime Error):
R = input()
print(2*R*3.14159265)
Problem p02717 (python)

Fixed submission:
X,Y,Z = map(int,input().split())
print(Z,X,Y)

Buggy submission (verdict: Runtime Error):
X,Y,Z = map(int,input().split())
print(Z X Y)
Problem p02718 (python)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
  else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)
Problem p02765 (python)

Fixed submission:
N,R = map(int,input().split())
if N <= 9:
  R += 100*(10-N)
print(R)

Buggy submission (verdict: Runtime Error):
N,R = input(int,split())
if N <= 9:
  R -= 100*(10-R)
print(R)
Problem p02789 (python)

Fixed submission:
N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
if N = M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(input().split())
if N == M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if N == M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if N == M:
  print("Yes")
if N != M:
  print("No")
Problem p02922 (python)

Fixed submission:
a,b = map(int,input().split())
if b==1:
  print(0)
  exit()
b -= a
if b%(a-1) == 0:
  print(b//(a-1) + 1)
else:
  print(b//(a-1) + 2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if b==1:
  print(0)
  exit()
b -= a
elif b%a == 0:
  print(b//a+1)
else:
  print(b//a + 2)
Problem p02924 (python)

Fixed submission:
N = int(input())
print(N*(N-1)//2)

Buggy submission (verdict: Runtime Error):
N = int(input())
print(int(N*(N-1)//2)

Buggy submission (verdict: Runtime Error):
zN = int(input())
print(1/2*14*13)
print(int((1/2)*N*(N-1)))
Problem p02947 (python)

Fixed submission:
import collections
N = int(input())
A = []
for i in range(N):
    s = sorted(input())
    A.append(str(s))
B = collections.Counter(A)
print(sum(i*(i-1)//2 for i in B.values()))

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
print(A)
B = collections.Counter(s)
print(sum(i*(i-1)//2 for i in B.values()))
Problem p02975 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
if len(set(a)) == 1 and a[0] == 0:
    print("Yes")
    exit()
if N%3 != 0:
    print("No")
    exit()

import collections
sa = list(set(a))
sa.sort()
B = collections.Counter(a)

if len(sa) == 2 and 0 in sa:
    if B[0] == N//3 and B[sa[1]] == N*2//3:
        print("Yes")
    else: print("No")
    exit()
if len(sa) != 3:
    print("No")
    exit()

if B[sa[0]] == B[sa[1]] == B[sa[2]]:
    print("Yes" if sa[0] ^ sa[1] == sa[2] else "No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
if len(set(a)) == 1 and a[0] == 0:
    print("Yes")
    exit()
if N%3 != 0:
    print("No")
    exit()

import collections
sa = list(set(a))
sa.sort()
B = collections.Counter(sa)
if len(sa) == 2 and 0 in sa:
    if B[0] == N//3 and B[sa[1]] == N*2//3:
        print("Yes")
    else: print("No")
    exit()

print("Yes" if sa[0] ^ sa[1] == sa[2] else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
if len(set(a)) == 1 and a[0] == 0:
    print("Yes")
    exit()
if N%3 != 0:
    print("No")
    exit()

import collections
sa = list(set(a))
sa.sort()
B = collections.Counter(a)
if len(sa) == 2 and 0 in sa:
    if B[0] == N//3 and B[sa[1]] == N*2//3:
        print("Yes")
    else: print("No")
    exit()

print("Yes" if sa[0] ^ sa[1] == sa[2] else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
if len(set(a)) == 1 and a[0] == 0:
    print("Yes")
    exit()
if N%3 != 0:
    print("No")
    exit()

import collections
B = collections.Counter(a)
sa = list(set(a))
sa.sort()
if len(sa) == 2 and 0 in sa:
    if B[0] == N//3 and B[sa[1]] == N*2//3:
        print("Yes")
    else: print("No")
    exit()

print("Yes" if sa[0] ^ sa[1] == sa[2] else "No")
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
bound = list(map(int,input().split()))
cnt = 1
pos = 0
for i in range(n):
  pos += bound[i]
  if pos <= x:
    cnt += 1
  if pos > x:
    break
print(cnt)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
bound = list(map(int,input().split()))
cnt = 0
pos = 0
for i in range(n+1):
  cnt += 1
  pos += bound[i]
  if pos > x:
    break
print(cnt)
Problem p03261 (python)

Fixed submission:
N = int(input())
W = [input() for _ in range(N)]
for i in range(N):
    for j in range(N):
        if i != j:
            if W[i] == W[j]:
                print("No")
                exit()
for k in range(N-1):
    if W[k][-1] != W[k+1][0]:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
w = input()
W_list = [w]
for i in range(N-1):
  W = input()
  if w[-1] == W[0] and W not in W.list:
    W_list.append(w)
    w = W
  else:
    print("No")
    exit()
print("Yes")
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
if S[:K].count("1") == K:
    print(1)
    exit()
A = S.lstrip("1")
print(A[0])

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if S[0] == "1" and K == 1:
    print(1)
    exit()
A = S.lstrip("1")
print(A[0])
Problem p03378 (python)

Fixed submission:
n,m,x = map(int,input().split())
a = list(map(int,input().split()))
cost = 0
for i in range (m):
  if a[i] < x:
    cost += 1
print(min(cost,m-cost))

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
a = list(map(int,input().split()))
cost = 0
for i in range (x):
  if a[i] < x:
    cost += 1
print(min(cost,m-cost))
Problem p03427 (python)

Fixed submission:
N = input()
print(max(sum([int(i) for i in N]),(len(N)-1)*9+int(N[0])-1))

Buggy submission (verdict: Runtime Error):
N = input()
M = N.lstrip("9")
if N != M:
    print((len(M)-1)*9+int(M[0])-1+(len(N)-len(M))*9)
else:
    print((len(N)-1)*9+int(N[0])-1)
Problem p03456 (python)

Fixed submission:
a,b = input().split()
c = a+b
c = int(c)
for i in range (1000):
  if i**2 == c:
    print("Yes")
    exit()
print("No")

Buggy submission (verdict: Runtime Error):
a,b = input().split()
c = a+b
import math
if int(math.sqrt(c)) ** 2 == c:
  print("Yes")
else:
  print("No")
Problem p03639 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
zero,one,two = 0,0,0
for i in a:
    if i%4 == 0:
        two += 1
    elif i%2 == 0:
        one += 1
    else:
        zero += 1
if one == N:
    print("Yes")
    exit()
print("Yes" if two+int(two>0) >= zero+int(one>0) else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
zero,one,two = 0,0,0
for i in a:
    if i%4 == 0:
        two += 1
    elif i%2 == 0:
        one += 1
    else:
        zero += 1
if one = N:
    print("Yes")
    exit()
print("Yes" if two+int(two>0) >= zero+int(one>0) else "No")
Problem p02612 (python)

Fixed submission:
n = int(input())
if n % 1000 == 0:
  print(0)
else:
  while n > 1000:
    n -= 1000
  print(1000-n)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n % 1000 == 0:
  print(0)
else:
  print(2000-int("1"+str(n[:-3])))
Problem p02696 (python)

Fixed submission:
a,b,n = map(int,input().split())
if n>= b-1:
    print(int(a*(b-1)/b)-a*int((b-1)/b))
else:
    print(int(a*n/b)-a*int(n/b))

Buggy submission (verdict: Runtime Error):
import sys
a,b,n = map(int,input().split())
d = 0
i = 0
for i in range(1,n+1):
    c = int(a*i/b)-a*int(i/b)
    if c >= d:
        d = c
    else:
        j += 1
        if j > 1:
            print(int(a*(j-2)/b)-a*int((j-2)/b))
            sys.exit()
print(d)
Problem p02705 (python)

Fixed submission:
import math
r = int(input())
print(math.pi*2*r)

Buggy submission (verdict: Runtime Error):
from tttest import circle
n = int(input())
circle(n)
Problem p02730 (python)

Fixed submission:
ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[k])
        for l in range(int((n-1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-1)/4)):
            e.append(b[m])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[k])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-3)/4)):
            e.append(b[m])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')

Buggy submission (verdict: Runtime Error):
ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[i])
        for l in range(int((n-1)/4),(n-1)/2):
            d.append(a[i])
        for m in range(int((n-1)/4)):
            e.append(b[i])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[i])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[i])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[i])
        for m in range(int((n-3)/4)):
            e.append(b[i])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[i])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
Problem p02755 (python)

Fixed submission:
a,b=map(int,input().split())
c=[]
d=[]
if a % 2 == 0:
    s = int(100*a/8)
    t = int(100*(a+1)/8) + 1
else:
    s = int(100*a/8) + 1
    t = int(100*(a+1)/8) 
u = int(10*b) 
v = int(10*(b+1)) 
for i in range(s,t):
    c.append(i)
for j in range(u,v):
    d.append(j)
c_d = set(c) & set(d)
if (len(c_d)>0):
    print(min(c_d))
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=[]
d=[]
if a % 2 == 0:
    s = int(100*a/8)
    t = int(100*(a+1)/8) + 1
else:
    s = int(100*a/8) + 1
    t = int(100*(a+1)/8) 
u = int(100*b/10) 
v = int(100*(b+1)/10) + 1
for i in range(s,t):
    c.append(i)
for j in range(u,v):
    d.append(j)
c_d = set(c) & set(d)
if (len(c_d)>=0):
    print(min(c_d))
else:
    print(-1)
Problem p02761 (python)

Fixed submission:
import sys
n,m = map(int,input().split())
inf = float("inf")
ls = [-inf]*n
for i in range(m):
    a,b = map(int,input().split())
    if ls[a-1] == -inf:
        ls[a-1] = b
    elif ls[a-1] != b:
        print(-1)
        sys.exit()
if ls[0] == 0:
    if n != 1:
        print(-1)
        sys.exit()
    else:
        print(0)
        sys.exit()
for j in range(n):
    if ls[j] == -inf:
        if j == 0 and n == 1:
            print(0)
            sys.exit()
        elif j == 0 and n != 1:
            ls[j] = 1
        else:
            ls[j] = 0
ls = list(map(str,ls))
print("".join(ls))

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split())
ls = [list(map(int,input().split())) for _ in range(m)]
ls.sort()
ans = []
di=[[] for _ in range(n)]
if n == 1:
    print(ls[0][1])
    sys.exit()
for i in range(m):
    di[ls[i][0]-1].append(ls[i][1])
for j in range(len(di)):
    if di[j] != []:
        di[j] = list(set(di[j]))
        if len(di[j]) > 1:
            print(-1)
            sys.exit()
for l in range(n):
    if l == 0:
        if di[l] == []:
            ans.append(str(1))
        elif 0 in di[l]:
            print(-1)
            sys.exit()
        else:
            ans.append(str(di[l][0]))
    else:
        if di[l] == []:
            ans.append(str(0))
        else:
            ans.append(str(di[l][0]))
print("".join(ans))