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

Fixed submission:
S=str(input())
total = 0
for i in range(len(S)):
  total = total + int(S[i])
if int(S)%total==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if math.log(n,10)%1 == 0:
  print('Yes')
elif n%SN==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if n==1:
  print('Yes')
elif n%SN==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if n%SN==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
print(SN)
if n%SN==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
#  print(math.floor(n%(10**i)/(10**(i-1))))
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if n%SN==0:
  print('Yes')
else:
  print('No')
Problem p03337 (python)

Fixed submission:
A,B=map(int, input().split())
print(max([A+B,A-B,A*B]))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max([A+B,A-B,A*B]))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max([A+B,A-B,A*B])
Problem p03338 (python)

Fixed submission:
import numpy as np
N=int(input())
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
max_count = 0
for i in range(1,N-1): # N字目で切った場合
  count_list = np.zeros(26)
  for k in range(i):
#    print(i,k,S[k],S[i:len(S)])
    if S[k] in S[i:len(S)]:
      count_list[s_list.index(S[k])] = count_list[s_list.index(S[k])] + 1
  if max_count < len([1 for x in count_list if x>0]):
    max_count = len([1 for x in count_list if x>0])
#  print(count_list)
print(max_count)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
count_list = np.zeros(26)
max_count = 0
for i in range(N-1): # N字目で切った場合
  for k in range(i):
    if S[k] in S[N:len(S)]:
      count_list[s_list.index(S[k])] = count_list[s_list.index(S[k])] + 1
  if max_count < n = len([1 for x in count_list if x>0])
print(max_count)
Problem p03378 (python)

Fixed submission:
N,M,X=map(int, input().split())
A=list(map(int, input().split()))
print(min([len([1 for a in A if a>X]),len([1 for a in A if a<X])]))

Buggy submission (verdict: Runtime Error):
N,M,X=map(int, input().split())
A=list(map(int, input().split()))
print(min([len([1 for a in A if a>X]),len([1 for a in A if a<X])])
Problem p03385 (python)

Fixed submission:
arr=str(input())
a = len([1 for x in arr if x=='a'])
b = len([1 for x in arr if x=='b'])
c = len([1 for x in arr if x=='c'])
if a==1 and b==1 and c==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x=str(input())
a = len([1 for x in arr if x=='a'])
b = len([1 for x in arr if x=='b'])
c = len([1 for x in arr if x=='c'])
if a+b+c == 3:
  print('Yes')
else:
  print('No')
Problem p03408 (python)

Fixed submission:
N = int(input())
S = []
for i in range(N):
  Si = str(input())
  S.append(Si) 
  
M = int(input())
T = []
for i in range(M):
  Ti = str(input())
  T.append(Ti)

max_point = 0
for i in range(N):
  point = len([1 for s in S if s==S[i]]) - len([1 for t in T if t==S[i]])
  max_point = max([max_point,point])
  
print(max_point)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for i in range(N):
  Si = str(input())
  S.append(Si) 
  
M = int(input())
T = []
for i in range(M):
  Ti = str(input())
  T.append(Ti)

total = 0
tokuten_list = []
tokuten = []
for i in range(N):
  if not S[i] in T:
    if not S[i] in tokuten_list:
      tokuten_list.append(S[i])
      tokuten.append(1)
    else:
      tokuten[tokuten_list.index(S[i])] = tokuten[tokuten_list.index(S[i])] + 1

print(max(tokuten))
Problem p03423 (python)

Fixed submission:
import math
n=int(input())
print('{:.0f}'.format(math.floor(n/3)))

Buggy submission (verdict: Runtime Error):
n=int(input())
print('{:.0f}'.format(math.floor(n/3)))
Problem p03469 (python)

Fixed submission:
S=str(input())
print('2018/'+S[5:10])

Buggy submission (verdict: Runtime Error):
S=int(input())
S[3]='8'
print(S)
Problem p03547 (python)

Fixed submission:
X,Y=map(str, input().split())
str_list = 'ABCDEF'
x=str_list.index(X)
y=str_list.index(Y)
if x<y : print('<')
if x==y: print('=')
if x>y : print('>')

Buggy submission (verdict: Runtime Error):
X,Y=map(str, input().split())
str_list = 'abcdef'
x=str_list.index(X)
y=str_list.index(Y)
if x<y : print('<')
if x==y: print('=')
if x>y : print('>')
Problem p03555 (python)

Fixed submission:
S1=str(input())
S2=str(input())
if S1 == S2[2]+S2[1]+S2[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
S1=int(input())
S2=int(input())
if S1 == S2[2]+S2[1]+S2[0]:
  print('YES')
else:
  print('NO')
Problem p03597 (python)

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
print(Nn**2-a)
Problem p03606 (python)

Fixed submission:
n=int(input())
num = 0
for i in range(n):
  a,b=map(int, input().split())
  num = num + b - a + 1
print(num)

Buggy submission (verdict: Runtime Error):
n=int(input())
num = 0
for i in range(N):
  a,b=map(int, input().split())
  num = num + b - a + 1
print(num)
Problem p03609 (python)

Fixed submission:
X,t=map(int, input().split())
if X<t:
  print(0)
else:
  print(X-t)

Buggy submission (verdict: Runtime Error):
if X<t:
  print(0)
else:
  print(X-t)
Problem p03624 (python)

Fixed submission:
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])

Buggy submission (verdict: Runtime Error):
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  print(a_list[c_list.index(0)])

Buggy submission (verdict: Runtime Error):
S=str(input())
list_ = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(S)):
  if len([1 for s in list_ if s==S[i]])>0:
    n=list_.index(S[i])
    list_ = list_[:n] + list_[n + 1:]
print(list_[0])

Buggy submission (verdict: Runtime Error):
S=str(input())
list_ = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(S)):
  if len([1 for s in list_ if s==S[i]]>0):
    n=list_.index(S[i])
    list_ = list_[:n] + list_[n + 1:]
print(list_[0])
Problem p03635 (python)

Fixed submission:
a,b=map(int, input().split())
print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
print((a-1)*(B-1))
Problem p03658 (python)

Fixed submission:
N,K=map(int, input().split())
L=list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[0:K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
L=list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[0,K]))
Problem p03672 (python)

Fixed submission:
S=str(input())
for i in range(1,len(S)):
  s = S[0:len(S)-i]
  if len(s)%2 == 0:
    if s[0:round(len(s)/2)] == s[round(len(s)/2):len(s)]:
      break
print(len(s))

Buggy submission (verdict: Runtime Error):
S=str(input())
for i in range(len(S)):
  s = S[0:len(S)-i]
  if len(s)%2 == 0:
    if s[0:len(s)/2] == s[len(s)/2:len(s)]:
      break
print(len(s))
Problem p03679 (python)

Fixed submission:
X,A,B=map(int, input().split())
if A>=B:
  print('delicious')
elif A+X>=B:
  print('safe')
else:
  print('dangerous')

Buggy submission (verdict: Runtime Error):
X,A,B=map(int, input().split())
if A>=B:
  print('delicious')
elif A+X>=N:
  print('safe')
else:
  print('dangerous')
Problem p03680 (python)

Fixed submission:
N=int(input())
A = []
for i in range(N):
  Ai=int(input())
  A.append(Ai)
on = 1 #現実世界での番号
for i in range(N):
  on = A[on-1] #次のボタンを知るために、配列を参照する
  if on == 2:
    print(i+1)
    break
if on != 2:
  print(-1)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = []
for i in range(N):
  Ai=int(input())
  A.append(Ai)
on = 1
for i in range(N):
  on = A[on]
  if on == 2:
    print(i)
    break
if i != 2:
  print(-1)
Problem p03729 (python)

Fixed submission:
a,b,c=map(str, input().split())
if a[len(a)-1]==b[0] and b[len(b)-1]==c[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c=map(str, input().split())
if a[len(a)]==b[0] and b[len(b)]==c[0]:
  print('YES')
else:
  print('NO')
Problem p03760 (python)

Fixed submission:
O=str(input())
E=str(input())
S=""
if len(O)==len(E):
  for i in range(len(O)):
    S=S+O[i]+E[i]
else:
  for i in range(len(O)-1):
    S=S+O[i]+E[i]
  S=S+O[len(O)-1]
print(S)

Buggy submission (verdict: Runtime Error):
O=str(input())
E=str(input())
S=""
if len(O)==len(E):
  for i in range(len(O)):
    S=S+O[i]+E[i]
else:
  for i in range(len(O)-1):
    S=S+O[i]+E[i]
  S=S+O[len(O)]
print(S)
Problem p03844 (python)

Fixed submission:
a,b,c=map(str, input().split())
if b == '+':
  print((int(a)+int(c)))
else:
  print(int(a)-int(c))

Buggy submission (verdict: Runtime Error):
a,b,c=str(int, input().split())
if b == '+':
  print(int(a)+int(b))
else:
  print(int(a)-int(b))
Problem p03845 (python)

Fixed submission:
N=int(input())
T=list(map(int, input().split()))
M=int(input())
for i in range(M):
  P,X=map(int, input().split())
  print(sum(T)-T[P-1]+X)

Buggy submission (verdict: Runtime Error):
N=int(input())
T=list(map(int, input().split()))
M=int(input())
for i in range(M):
  P,X=map(int, input().split())
  print(sum(T)-(T[P]-X))
Problem p03861 (python)

Fixed submission:
a,b,x=map(int, input().split())
print(b//x-((a-1)//x+1)+1)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(long, input().split())
print(math.floor(b/x)-math.ceil(a/x)+1)
Problem p03998 (python)

Fixed submission:
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn == "A":
    if len(A) == 0:
      print(turn)
      break
    turn = A[0].upper()
    A = A[1:len(A)]
  elif turn == "B":
    if len(B) == 0:
      print(turn)
      break
    turn = B[0].upper()
    B = B[1:len(B)]
  else:
    if len(C) == 0:
      print(turn)
      break
    turn = C[0].upper()
    C = C[1:len(C)]

Buggy submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn == "A":
    turn = A[0].upper()
    if len(A) == 0:
      print(A.upper())
      break
    A = A[1:len(A)]
  elif turn == "B":
    turn = B[0].upper()
    if len(B) == 0:
      print(B.upper())
      break
    B = B[1:len(B)]
  else:
    turn = C[0].upper()
    if len(C) == 0:
      print(C.upper())
      break
    C = C[1:len(C)]

Buggy submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn = "A":
    turn = A[0].upper()
    if len(A) == 1:
      print(A)
      break
    A = A[1:len(A)]
  if turn = "B":
    turn = B[0].upper()
    if len(B) == 1:
      print(B)
      break
    B = B[1:len(B)]
  if turn = "C":
    turn = C[0].upper()
    if len(C) == 1:
      print(C)
      break
    C = C[1:len(C)]
Problem p04012 (python)

Fixed submission:
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
n_list = []
for i in range(26):
  n_list.append(0)
for i in range(len(S)):
  n_list[s_list.index(S[i])] = n_list[s_list.index(S[i])] + 1
num = 1
for i in range(26):
  num = num * (n_list[i]+1)
if num % 2 == 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
n_list = []
for i in range(26):
  n_list.append(0)
for i in range(len(S)):
  n_list.index(S[i]) = n_list.index(S[i]) + 1
num = 1
for i in range(26):
  num = num * (n_list[i]+1)
if num % 2 == 1:
  print('Yes')
else:
  print('No')
Problem p02741 (python)

Fixed submission:
dataset = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k = int(input())
print(dataset[k-1])

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-50:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-100:
    print('Yes')
else:
    print('No')
Problem p02576 (python)

Fixed submission:
kk = list(map(int, input().split()))
a = kk[0] - (kk[0] % kk[1])
b = a / kk[1]

if (kk[0] % kk[1]) == 0:
  answer = b * kk[2]
else:
  answer = (b + 1) * kk[2]
print(int(answer))

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

if N == 1:
  print(0)
else:
  for k in range (N-1):
    if kk[N-k-2] > kk[N-k-1]:
      c = kk[N-k-1:N]
      d=kk[N-k-2]
      c_=[d if i<d else i for i in c]
      kk[N-k-1:N]=c_
  b = sum(kk)
  print(b-a)
Problem p02612 (python)

Fixed submission:
input_line = int(input())
a = input_line % 1000
if a == 0:
  print(0)
else:
  print(1000-a)

Buggy submission (verdict: Runtime Error):
input_line = input()
a = input_line % 1000
if a == 0:
  print(0)
else:
  print(1000-a)
Problem p02613 (python)

Fixed submission:
N=int(input())
AC=0
WA=0
TLE=0
RE=0
 
for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  if K=="WA":
    WA=WA+1
  if K=="TLE":
    TLE=TLE+1
  if K=="RE":
    RE=RE+1
 
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Buggy submission (verdict: Runtime Error):
N=int(input())
AC=0
WA=0
TLE=0
RE=0
 
for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  elif K=="WA":
    WA=WA+1
  elif K=="TLE":
    TLE=TLE+1
  else:
    RE=RE+1
 
print("AC x " + AC)
print("WA x " + RE)
print("TLE x " + TLE)
print("RE x " + RE)

Buggy submission (verdict: Runtime Error):
N=int(input())
AC=0
WA=0
TLE=0
RE=0

for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  if K=="WA":
    WA=WA+1
  if K=="TLE":
    TLE=TLE+1
  if K=="RE":
    RE=RE+1

print("AC x " + AC)
print("WA x " + RE)
print("TLE x " + TLE)
print("RE x " + RE)
Problem p02844 (python)

Fixed submission:
N=int(input())
S=input()
S=list(map(int,S))
ans=0
for s in range(1000):
      A=s//100
      B=(s-A*100)//10
      C=s-A*100-B*10
      isOne=0
      isTen=0
      isHundred=0
      for i in range(N) :
        if isOne==0:
          if S[i]==A: 
            isOne=1
        elif isTen==0:
          if S[i]==B: 
            isTen=1
        elif isHundred==0:
          if S[i]==C:
            isHundred=1
            ans+=1
        else:
          break

print(ans)

Buggy submission (verdict: Runtime Error):
ans=0
for i in range(10):
  for j in range(10):
    for k in range(10):
      s='{}{}{}'.format(i,j,k)
      isOne=0
      isTen=0
      isHundred=0
      for i in range(N) :
        if S[i]==s[0] and isOne==0:
          isOne=1
        elif S[i]==s[1] and isOne==1 and isTen==0:
          isTen=1
        elif S[i]==s[2] and isOne==1 and isTen==1 and isHundred==0:
          isHundred=1
      if isHundred==1:
      ans+=1

print(ans)
Problem p03086 (python)

Fixed submission:
S=input()
 
acgt_list=[0]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      acgt_list.append(slen)
      
print(max(acgt_list))

Buggy submission (verdict: Runtime Error):
S=input()
 
acgt_list=[]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      acgt_list.append(slen)
      
print(max(acgt_list))

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

actg_list=[]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      atcg_list.append(slen)
      
print(max(atcg_list))
Problem p03281 (python)

Fixed submission:
N=int(input())
 
ans=0
odd=[]
for i in range(1,N+1):
  if i%2!=0:
    odd.append(i)
    
if N  <104:
  pass
else:
  for i in range(105,N+1):
    if i%2!=0:
      tmp=0
      for j in odd:
        if i%j==0:
          tmp+=1
      if tmp==8:
        ans+=1 
print(ans)

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

ans=0
odd=[]
for i in range(1,N+1):
  if i%2!=0:
    odd.append(i)
    
if N  <104:
  pass
elif N=105:
  ans=1
else:
  ans=1
  for i in range(106,N+1):
    if i%2 !=0:
      tmp=0
      for j in odd:
        if i%j==0:
          tmp=+1
      if tmp==8:
        ans+=1
        
        
print(ans)
Problem p02646 (python)

Fixed submission:
a,v = map(int,input().split())
b,w  = map(int,input().split())
t = int(input())

if (abs(a-b) - (v-w)*t <= 0):
    print("YES")
    
else:print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = a,v = map(int,input().split())
t = int(input())
flg = 0
for i in range(t):
  a+=v
  b+=w
  if(a==b):
    flg=1
    break
    
if(flg==1):print("YES")
else:print("NO")
Problem p02694 (python)

Fixed submission:
x=int(input())

a=100
k=0
y=0
for i in range(10**18):
  y=y+1
  
  k = a//100
  a=a+k
  
  if(a>=x):break

print(y)

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

a=100
k=0
while(1):
  k+=1
  a=a+a(1//100)
  if(a>=x):break
print(k)
Problem p02717 (python)

Fixed submission:
a,b,c=map(int,input().split())
t1=0
t2=0
t3=0
t4=0
t1=t1+a
t2=t2+b
b=t1
a=t2

t3=t3+a
t4=t4+c
a=t4
c=t3
print(a,b,c)

Buggy submission (verdict: Runtime Error):
a,b,c=int(input().split())
t=a
b=t
a=b
t2=a
c=t2
a=c
print(a,b,c)
Problem p02719 (python)

Fixed submission:
n,k=map(int,input().split())
def temp(n,k):
    if(n>=k):
        if(n % k ==0):
            return 0
        else :
            return(min(n%k,k-(n%k)))
        
    else:
        return (min(n,k-n))
print(temp(n,k))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
def temp(n,k):
    if(n>=k):
        if(n % k ==0):
            return 0
        else:
            return(temp(n%k,k))
        
    else:
        if(k%n == 0):return n
        else:
            return (min(n,k%n))
print(temp(n,k))
Problem p03456 (python)

Fixed submission:
import math
a,b=input().split()

ss=str(a)+str(b)
num=int(ss)
n=math.sqrt(num)

if (int(n)*int(n)==num):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
a=input()
b=input()
c=str(a)+str(b)
s=int(c)
m=np.sqrt(s)
if m*m==s:
  print("Yes")
else:
  print("No")
Problem p02602 (python)

Fixed submission:
n, k = map(int, input().split())
AA =[int(a) for a in input().split()]


for b, t in zip(AA, AA[k:]):
    if t > b:
        print("Yes")
    else:
        print("No")

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

n, k = map(int, input().split())
AA =[]
c =False
for a in input().strip().split():
    a = int(a)
    if not c:
        AA+= [a]
        if len(AA) == k:
            c = True
    else:
        base = AA[0]
        if a - base > 0:
            print("Yes")
        else:
            print("No")
        AA = AA[1:]+[a]

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

n = int(input())

AA = [int(a) for a in input().split()]
c = 0
updwn=[None]*(n-1)
for a in AA:
    if c ==0:
        c +=1
        base = a
        continue
    if a - base >= 0:
        updwn[c-1] = True
        base = a
    else:
        updwn[c-1] = False
        base = a
    c += 1
updwn+=[False, False]
base = False
total = 1000
stock = 0
if n ==2:
    if updwn[0]==True:
        total += (total//AA[0])*(AA[1]-AA[0])
else:
    for i in range(n-1):
        if updwn[i] == True and base == False:
            tdcost= AA[i]
            stock = total // tdcost
            base_cost = tdcost
        elif updwn[i] == True and updwn[i+1]==False:
            tdcost=AA[i+1]
            total += (tdcost - base_cost)*stock
            stock = 0
        else:
            pass
        base = updwn[i]
print(total)
Problem p02645 (python)

Fixed submission:
import sys
input = sys.stdin.readline
import numpy as np

s = input()
print(s[:3])

Buggy submission (verdict: Runtime Error):

import numpy as np


def nextL(A, D):
    L = D
    i = 1
    for a in A:
        line = np.ones(a*2+1, dtype =int)
        L[i-1, n+i-a:n+i+a+1] = line
        i+=1
    L = L[:, n+1:2*n+1]
    Na = np.sum(L, axis=0)
    return Na


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

A = [int(a) for a in input().split()]

D = np.zeros((n, 3*n+2), dtype =int)

if k >= 50:
    print((str(n)+" ")*n)
else:
    for i in range(k):
        Na = nextL(A, D)
        A = Na
    Li=[str(int(a)) for a in A]
    Li=" ".join(Li)
    print(Li)
Problem p02696 (python)

Fixed submission:
import sys
input = sys.stdin.readline


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


#f_table = [a*t//b for t in range(b)]

if c >= b:
    print((a * (b-1)) // b)

else:
    x = c
    c_amari = c%b
    c_sho = c//b
    ans =(a * c_amari) //b
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy as np
import time



"""
def make_table_min(n, m):
    Table = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    c = 10
    for i in range(n):
        rem = np.random.randint(1,m+1)
        Table.remove(rem)
    return Table

"""

def make_table(n, m):
    Table = [None]*n
    for i in range(n):
        rem = np.random.randint(1,m+1)
        Table[i] = rem
    return Table

t0 = time.time()
n, m, q = map(int, input().split())
Lis = [[int(e) for e in input().split()] for _ in range(q)]

Sum_cor = []
for i in range(10000000000):
    if m >=6:
        Table = make_table(n,m)
    else:
        Table = make_table(n,m)
    Table.sort()
    d_sum = 0
    for l in Lis:
        if Table[l[1]-1]-Table[l[0]-1] == l[2]:
            d_sum+=l[3]
    Sum_cor.append(d_sum)
    t1 = time.time()
    if t1-t0 >1.8:
        print(max(Sum_cor))
        break
Problem p02705 (python)

Fixed submission:
import sys
input = sys.stdin.readline

import math

p = math.pi

r = int(input())
print(r*2*p)

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

def print_sub(A, Ones):
  A = np.array(A)
  Ones = np.array([1]*(n-1))
  A = A -Ones
  print(n-1 -len(np.nonzero(A)[0]))
  return print_sub(A, Ones)

n= int(input())
A = [int(a) for a in input().split()]

print_sub(A, Ones)
    
print("0")