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

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int, input().split()))

dp = np.zeros((N+1, 2), dtype=int)
dp[0, 1] = -10**9

for i in range(N):
    dp[i+1, 0] = max(dp[i, 0] + A[i], dp[i, 1] - A[i])
    dp[i+1, 1] = max(dp[i, 0] - A[i], dp[i, 1] + A[i])
print(dp[N, 0])

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

dp = np.zeros((N+1, 2), dtype=int)
dp[0, 1] = -10**9

for i in range(N):
    dp[i+1, 0] = max(dp[i, 0] + A[i], dp[i, 1] - A[i])
    dp[i+1, 1] = max(dp[i, 0] - A[i], dp[i, 1] + A[i])
print(dp[N, 0])
Problem p02765 (python)

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

Buggy submission (verdict: Runtime Error):
N,R=input().split()
N=int(N)
R=int(R)
if N>=10:
	print(R)
else :
	prinAt((100*(10-N))+R)
Problem p03943 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b==c or a+c==b or b+c==a  :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
sum=a+b+c
if a+b==c or a+c=b or b+c==a :
    print("Yes")
else :
    print("No")
Problem p04044 (python)

Fixed submission:
#NとLを入力
N, L = map(int, input().split())


# 空のリストを生成
S = []

#入力
for i in  range(N):
    array = input()
    S.append(array)

#辞書順に並べ替え
S.sort()

#pythonのリストの出力では[と,が出力されるので取る
S=''.join(S)

#出力
print(S)

Buggy submission (verdict: Runtime Error):
N,L = input().split()
L=int(L)
S=[]
for i in range (L):
    S.append(input())
S.sort()
for j in S :
	print(j ,end="")

Buggy submission (verdict: Runtime Error):
N,L = input().split()
L=int(L)
S=[]
for i in range (L):
    S.append(input())
S.sort()
for j in S :
	print(j ,end="")
Problem p02885 (python)

Fixed submission:
def func():
    A,B=map(int,input().split())
    
    if A>=B*2:
        C=A-2*B
        print(C)
    else:
        print(0)
        
if __name__=="__main__":
    func()

Buggy submission (verdict: Runtime Error):
def func():
  A,B= map(int,input().split())
  if A >= B*2:
  	print(A-2B)
  else:
  	print(0)
  
if __name__=="__main__":
  print("Input two Integers with space")
  func()

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

if A >= B*2:
  print(A-2B)
else:
  print(0)
Problem p02675 (python)

Fixed submission:
s = input()
t = s[-1]
if t == '2' or t == '4' or t == '5' or  t == '7' or t == '9':
    print("hon")
if t == '0' or t == '1' or t== '6' or t == '8':
    print("pon")
if t == '3':
    print("bon")

Buggy submission (verdict: Runtime Error):
from collections import deque
import sys
sys.setrecursionlimit(2000000)
N, M = map(int, input().split())
graph = [[] for j in range(M)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

Buggy submission (verdict: Runtime Error):
from collections import deque
import sys
sys.setrecursionlimit(2000000)
N, M = map(int, input().split())
graph = [[] for j in range(M)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

for room, depth in enumerate(depth_array):
    for node in graph[room]:
        if depth_array[node] + 1 == depth_array[room]:
            mark_array[room] = node
if -1 in mark_array[1:]:
    print("No")
else:
    print("Yes")
    for m in mark_array[1:]:
        print(m+1)

Buggy submission (verdict: Runtime Error):
from collections import deque
import sys
sys.setrecursionlimit(2000)
N, M = map(int, input().split())
graph = [[] for j in range(M)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

for room, depth in enumerate(depth_array):
    for node in graph[room]:
        if depth_array[node] + 1 == depth_array[room]:
            mark_array[room] = node
if -1 in mark_array[1:]:
    print("No")
else:
    print("Yes")
    for m in mark_array[1:]:
        print(m+1)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
if S[:]==T[:-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
P = 0
S = 0
while S==0:
    P += A
    K -= A
    if K < 0:
        P = K
        break
    elif K == 0:
        break

    K -= B
    if K <= 0:
        break

    P -= C
    K -= C
    if K <= 0:
        P += abs(K)
        break
    S=1
if P >= 0:
    print(P)
else:
    print("0")

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
P = 0
S = 0
while S==0:
    P += A
    K -= A
    if K < 0:
        P = K
        break
    elif K == 0:
        break

    K -= B
    if K <= 0:
        break

    P -= C
    K -= C
    if K <= 0:
        P += abs(K)
        break
    S=1
if P >= 0:
    print(P)
else:
    print(0)
Problem p02576 (python)

Fixed submission:
N, X, T = map(int ,input().split())

ans = (N // X) * T
if N % X != 0:
    ans += T

print(ans)

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

hantei = 0

while N != 0 or N > 1:
    hantei += N % 10
    N = N // 10

if hantei % 9 == 0:
    ans = "Yes"
else:
    ans = "No"

print(ans)
Problem p02582 (python)

Fixed submission:
s = input()

if "RRR" in s:
    ans = 3
elif "RR" in s:
    ans = 2;
elif "R" in s:
    ans = 1;
else:
    ans = 0;

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
p = [0] + list(map(int, input().split()))
c = [0] + list(map(int, input().split()))

max = -10000000000

for i in range(1,N+1):
    naw = i
    S = 0
    l = 0
    lmax = -10000000000
    kl = K

    while 1:
        naw = p[naw]
        S += c[naw]
        l += 1
        kl -= 17
        if S > lmax:
            lmax = S
            max_l = l
        if kl == 0 or naw == i:
            break
    
    if kl == 0:
        imax = lmax
    else:
        if S <= 0:
            imax = lmax
        else:
            imax = lmax + S * ( (K - max_l) // l)
    
    if (imax > max):
        max = imax

print(max)
Problem p02584 (python)

Fixed submission:
X, K, D = map(int ,input().split())

if K * D < abs(X):
    ans = abs(X) - K * D
else:
    if abs(X) < D:
        if K % 2 == 0:
            ans = abs(X)
        else:
            ans= abs(abs(X) - D)
    else:
        if abs(X) // D % 2 == 0:
            if K % 2 == 0:
                ans = abs(X) % D
            else:
                ans = abs(abs(X) % D - D)
        else:
            if K % 2 == 0:
                ans = abs(abs(X) % D - D)
            else:
                ans = abs(X) % D

print(ans)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main(void)
{
    long long X,K,D;
    long long ans = 0;
    cin >> X >> K >> D;

    if(K * D <  abs(X)){
        ans = abs(X) - K * D;
    }else{
        if( (abs(X) / D) % 2 == 0 ){
            if( K % 2 == 0){
                ans = abs(X) % D;
            }else{
                ans = abs(abs(X) % D  - D);
            }
            
        }else{
            if( K % 2 == 0){
                ans = abs(abs(X) % D  - D);
            }else{
                ans = abs(X) % D;
            }
        }
    }

    cout << ans << endl;

}
Problem p02582 (python)

Fixed submission:
a, b, c = input()

if b == "R":
  d = 1
  if a == "R":
    d += 1
  if c == "R":
  	d += 1
else:
  d = 0
  if a == "R" or c == "R":
    d += 1
 
print(d)

Buggy submission (verdict: Runtime Error):
l = [e in e in input().split()]
c = 0
if l[1] == "R":
  c += 1
  if l[0] == "R":
    c += 1
  if l[2] == "R":
  	c += 1
else:
  if l[0] == 1 or l[2] == "R":
    c += 1

print(c)
Problem p02583 (python)

Fixed submission:
N = int(input())
L = [int(e) for e in input().split()]
c = 0

if len(set(L)) >= 3:
  for i in range(N-2):
    for j in range(i+1, N-1):
      for k in range(j+1, N):
        if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
          if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
            c += 1
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(e) for e in input().split()]
c = 0

if len(N) >= 3:
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
          if L[i] != L[j] + L[k] and L[j] != L[k] + L[i] and L[k] != L[i] + L[j]:
            print(i+1, j+1, k+1)
            c += 1
print(c)

Buggy submission (verdict: Runtime Error):
N = input()
L = [int(e) for e in input().split()]
c = 0
for i in range(N):
  for j in range(i, N):
    for k in range(j, N):
      if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
        if L[i] < L[j] + L[k] or L[j] > L[k] + L[i] or L[k] > L[i] + L[j]:
          c += 1
print(c)
Problem p02582 (python)

Fixed submission:
S = input()
if S[0] == 'R':
    if S[1] == 'R':
        if S[2] == 'R':
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    if S[1] == 'R':
        if S[2] == 'R':
              print(2)
        else:
              print(1)
    else:
        if S[2] == 'R':
              print(1)
        else:
              print(0)

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
if S[0] == 'R':
  if S[1] == 'R':
    if S[2] == 'R':
      	print(3)
  	else:
    	print(2)
  else:
    if S[2] == 'R':
      print(1)
else:
  if S[1] == 'R':
    if S[2] == 'R':
      print(2)
    else:
      print(1)
  else:
    if S[2] == 'R':
      print(1)
    else:
      print(0)
Problem p02600 (python)

Fixed submission:
N = int(input())
if 400<= N < 600:
    c = '8'
elif 600<= N < 800:
    c = '7'
elif 800 <= N < 1000:
    c = '6'
elif 1000 <= N < 1200:
    c = '5'
elif 1200 <= N < 1400:
    c = '4'
elif 1200 <= N < 1600:
    c = '3'
elif 1600 <= N < 1800:
    c = '2'
elif 1800 <= N < 2000:
    c = '1'
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        stock = money // A[i]
        money = money % A[i]
        money += stock * A[i+1]
print(money)
Problem p02603 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        stock = money // A[i]
        money = money % A[i]
        money += stock * A[i+1]
print(money)

Buggy submission (verdict: Runtime Error):
N = int(input())
values = [int(s) for s in input().split()]
rest = 1000
for i in range(N):
  if rest >= 1000:
  	if values[i] >= values[i+1]:
    	have = values[i] // rest
	    rest = values[i] % rest
  elif value != 0:
    rest += values[i] * have
print(rest)
Problem p03424 (python)

Fixed submission:
N = input()
S = input().split()
if 'Y' in S:
    print('Four')
else:
    print('Three')

Buggy submission (verdict: Runtime Error):
N = input()
    S = input().split()
if 'Y' in S:
    print('Four')
else:
    print('Three')
Problem p03241 (python)

Fixed submission:
import math
N,M= map(int, input().split())
 
answer = 1
list = []
for i in range(1,math.floor(M**(1/2))+1):
    if M % i == 0 and int(M/i) >= N:
        answer = i
        list.append(int(M/i))
 
 
for k in list:
    if M/k >= N:
        answer = k
        break
 
print(answer)

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

def dividable(x,y):
    if x/y == x//y:
        return True
    else:
        return False

for i in range(2,int(M//N)+1):
    if dividable(M,i) and int(M/i) >= N:
            answer = i

print(answer)
Problem p02801 (python)

Fixed submission:
list_alpha = [chr(ord('a') + i) for i in range(26)]
c = input()
index = list_alpha.index(c)
print(list_alpha[index + 1])

Buggy submission (verdict: Runtime Error):
list_alpha = [chr(ord('a') + i) for i in range(26)]
c = input()
index = list_alpha.find(c)
print(list_alphs[index + 1])
Problem p02975 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = "Yes"
if N % 3 != 0:
  if len(set(A)) != 1 or list(set(A))[0] != 0:
    ans = "No"
  print(ans)
else:
  if len(set(A)) == 1:
    if list(set(A))[0] != 0:
      ans = "No"
  elif len(set(A)) == 2:
    if A.count(0) != N // 3:
      ans = "No"
  elif len(set(A)) == 3:
    A_s = list(set(A))
    for a in A_s:
      if A.count(a) != N // 3:
        ans = "No"
      elif A_s[0] ^ A_s[1] ^ A_s[2] != 0:
        ans = "No"
  else:
    ans = "No"
  print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ans = "Yes"
if N % 3 != 0:
  if len(set(A)) != 1 or set(A)[0] != 0:
    ans = "No"
  print(ans)
else:
  if len(set(A)) == 2:
    if A.count(0) != N // 3:
      ans = "No"
  elif len(set(A)) == 3:
    A_s = list(set(A))
    for a in A_s:
      if A.count(a) != N // 3:
        ans = "No"
      elif A_s[0] ^ A_s[1] ^ A_s[2] != 0:
        ans = "No"
  else:
    ans = "No"
  print(ans)
Problem p03162 (python)

Fixed submission:
import numpy as np
n = int(input())
ans = 0
field = [map(int,input().split()) for _ in range(n)]
x,y,z = 0,0,0
# 1つ前の値のみわかればよいので
# aにはa,a,aがbには
for a,b,c in field:
  #x,y,zは毎回入れ替わるので活動は連続しない
  x,y,z = max(y,z) + a,max(x,z) + b,max(x,y) + c

print(max(x,y,z))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
ans = 0
field = [list(map(int,input().split())) for _ in range(n)]
dp = np.zeros((n + 1,3),np.int64)
for i in range(n):
  for j in range(3):
    for k in range(3):
      if j == k:
        continue
      dp[i + 1][k] = max(dp[i + 1][k],dp[i][j] + field[i][k])
for d in dp[-1]:
  ans = max(ans,d)
print(ans)
Problem p03240 (python)

Fixed submission:
import sys
N = int(input())
pyramids = [tuple(map(int,input().split())) for _ in range(N)]
for i in range(101):
  for j in range(101):
    H_set = set()
    keep = []
    for k in range(len(pyramids)):
      x,y,h = pyramids[k]
      if h == 0:
        keep.append((x,y))
        continue
      H_set.add(h + abs(x - j) + abs(y - i))
    if len(H_set) == 1:
      if len(keep) != 0:
        is_suitable = True
        for x,y in keep:
          if list(H_set)[0] - abs(j - x) - abs(i - y) > 0:
            is_suitable = False
            break
        if is_suitable:
          print(j,i,list(H_set)[0])
          sys.exit()
        else:
          continue
      else:
        print(j,i,list(H_set)[0])
        sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
pyramids = [tuple(map(int,input().split())) for _ in range(N)]
for i in range(101):
  for j in range(101):
    H_set = set()
    keep = []
    for k in range(len(pyramids)):
      x,y,h = pyramids[k]
      if h == 0:
        keep.append(x,y)
        continue
      H_set.add(h + abs(x - j) + abs(y - i))
    if len(H_set) == 1:
      if len(keep) != 0:
        is_suitable = True
        for x,y in keep:
          if list(H_set)[0] - abs(j - x) - abs(i - y) > 0:
            is_suitable = False
            break
        if is_suitable:
          print(j,i,list(H_set)[0])
          sys.exit()
        else:
          continue
      else:
        print(j,i,list(H_set)[0])
        sys.exit()
Problem p03401 (python)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A_l = [0,0]
A_l[1:1] = A
D = 0
for i in range(len(A_l) - 1):
  D += abs(A_l[i] - A_l[i + 1])
for i in range(n):
  print(D - abs(A_l[i] - A_l[i + 1])- abs(A_l[i + 1] - A_l[i + 2]) + abs(A_l[i] - A_l[i + 2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
A_l = [0,*A[:],0]
D = 0
for i in range(len(A_l) - 1):
  D += abs(A_l[i] - A_l[i + 1])
for i in range(n):
  print(D - abs(A_l[i] - A_l[i + 1])- abs(A_l[i + 1] - A_l[i + 2]) + abs(A_l[i] - A_l[i + 2]))
Problem p03486 (python)

Fixed submission:
s = sorted(input())
t = sorted(input(),reverse=True)
ans = ""
def check_dict():
  for i in range(min(len(s),len(t))):
    if s[i] < t[i]:
      ans = "Yes"
      return ans
    elif s[i] > t[i]:
      ans = "No"
      return ans
  return ""
if len(s) < len(t):
  ans = check_dict()
  if ans == "":
    ans = "Yes"
  print(ans)
else:
  ans = check_dict()
  if ans == "":
    ans = "No"
  print(ans)

Buggy submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input(),reverse=True)
ans = ""
def check_dict():
  for i in range(len(s)):
    if s[i] < t[i]:
      ans = "Yes"
      return ans
    elif s[i] > t[i]:
      ans = "No"
      return ans
  return ""
if len(s) < len(t):
  ans = check_dict()
  if ans == "":
    ans = "Yes"
  print(ans)
else:
  ans = check_dict()
  if ans == "":
    ans = "No"
  print(ans)
Problem p03493 (python)

Fixed submission:
s = list(input())
ans = 0
for i in s:
  if i == "1":
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int,input().split()))
ans = float("inf")
for i in a:
  ans = min(ans,len(bin(i)) - bin(i).rfind("1") - 1)
print(ans)
Problem p03643 (python)

Fixed submission:
n = input()
print("ABC"+n)

Buggy submission (verdict: Runtime Error):
n = input()
print(f"ABC{n}")
Problem p02642 (python)

Fixed submission:
from collections import Counter
import bisect
N = int(input())
A = list(map(int,input().split()))
cnt = Counter(A)
A.sort()
ans = 0
MX = 10**6
P = [0] * (MX+1)
for a in A:
    if P[a]==0:
        for i in range(MX+1):
            x = a*i
            if x > MX:
                break
            P[x] = 1
        if cnt[a]==1:
            ans+=1
print (ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
lista = list(map(int, input().split()))

count = Counter(lista)
lista.sort()

M = 1000001
P = [0] * (M)
ans = 0

for i in lista:
    if P[i] == 0:
        for j in range(M):
            x = i * j
            if x > M:
                break
            P[x] = 1
        if count[i] == 1:
            ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
lista = list(map(int, input().split()))

count = Counter(lista)
lista.sort()

M = 1000001
P = [0] * (M)
ans = 0

for i in lista:
    if P[i] == 0:
        for j in range(M):
            x = i * j
            if x > M:
                break
            P[x] = 1
        if count[i] == 1:
            ans += 1

print(ans)
Problem p02657 (python)

Fixed submission:
a, b = list(map(int,input().split()))

ans = a*b
print(ans)

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

def prime_factorise(n):
    a = []
    tmp = n
    for i in range(2, int(n**0.5//1 + 1)):
        if tmp % i == 0:
            index = 0  # 指数
            while tmp % i == 0:
                index += 1
                tmp //= i
            a.append([i, index])

    if tmp != 1:
        a.append([tmp, 1])

    print(a)
    return a

x = prime_factorise(n)
count = 0


for i in range(len(x)):
    if x[0][0] == 1:
        break

    k = x[i][1]  # 指数の値
    for j in range(k):
        if n % (x[i][0] ** (j+1)) == 0:
            n //= x[i][0] ** (j+1)
            count += 1
            k -= (j+1) #指数の値をへらす

        elif n % (x[i][0]**(j+1)) != 0:
            break
        
        if k <= 0:
            break

print(count)
Problem p02747 (python)

Fixed submission:
s = input()
ans = "No"

if s=="hi" :
    ans="Yes"
if s=="hihi":
    ans="Yes"
if s=="hihihi":
    ans="Yes"
if s=="hihihihi":
    ans="Yes"
if s=="hihihihihi":
    ans="Yes"

print(ans)

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

for i in 5:
    hitachi += "hi"
    if s==hitachi:
        print("Yes")

print("No")
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
temp = 100000
index = 0

for i in range(n):
    c = t - listh[i] * 0.006
    diff = abs(c-a)
    if temp > diff:
        temp = diff
        index = i+1

print(index)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
diff = [abs((t-x*0.006)-a) for x in listh]
print(diff.index(min(diff)+1))
Problem p02642 (python)

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = sorted([int(i) for i in input().split()])
    cnt_list = collections.Counter(a)
    search_list = [0] * (a[-1]+1)
    ans = 0
    for num, cnt in cnt_list.items():
        search_list[num] = cnt
    for i in a:
        if search_list[i] == 1:
            ans += 1
        for j in range(i, a[-1]+1, i):
            search_list[j] = 0
    print(ans)
    
if __name__ == '__main__':
    main()

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

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a = sorted([i for i in a if a.count(i) == 1])
    a = np.array(a)
    ans = []
    if let(set(a)) == 1:
        print(0)
        return
    while a != []:
        ans.append(a[0])
        a = a[a%a[0] != 0]
    print(len(ans)+1)
    
if __name__ == '__main__':
    main()
Problem p02675 (python)

Fixed submission:
N = int(input())

num = N % 10

if ((num==2)or(num==4)or(num==5)or(num==7)or(num==9)):
	print('hon')
elif ((num==0)or(num==1)or(num==6)or(num==8)):
	print('pon')
else:
    print('bon')

Buggy submission (verdict: Runtime Error):
def josu(N):
    N %= 10
    if ((N==2)or(N==4)or(N==5)or(N==7)or(N==9)):
        print('hon')
    elif ((N==0)or(N==1)or(N==6)or(N==8)):
        print('pon')
    else:
        print('bon')
        
josu(N)
Problem p02802 (python)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    penalty = dict()
    penalty_cnt = 0
    ans = set()
    for _ in range(m):
        num, result = input().split()
        if result == 'AC':
            ans.add(num)
            if num not in penalty:
                penalty[num] = 0
        elif num not in ans:
            if num not in penalty:
                penalty[num] = 1
            else:
                penalty[num] += 1
    ans = list(ans)
    for i in range(len(ans)):
        penalty_cnt += penalty[ans[i]]
    print(len(ans), penalty_cnt)

if __name__ == '__main__':
    main()

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

def main():
    n, m = map(int, input().split())
    penalty = dict()
    penalty_cnt = 0
    ans = set()
    for _ in range(m):
        num, result = input().split()
        if result == 'AC':
            ans.add(num)
        elif num not in ans:
            if num not in penalty:
                penalty[num] = 1
            else:
                penalty[num] += 1
    ans = list(ans)
    for i in range(len(ans)):
        penalty_cnt += penalty[ans[i]]
    print(len(ans), penalty_cnt)

if __name__ == '__main__':
    main()