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

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N, M = inp_list()
s = [0] * M
c = [0] * M
for i in range(M): s[i], c[i] = inp_list()

if M == 0:
    if N == 1:
        print(0)
        exit()
    else:
        print(10 ** (N - 1))
        exit()


# N 桁の整数 10 ** (N - 1) ~ 10 ** N - 1 を全探索
for i in range(10 ** (N - 1) - 1, 10 ** N):
    if N != 1 and i == 10 ** (N - 1) - 1: continue
    i_str = str(i)
    for m in range(M):
        if i_str[s[m] - 1] != str(c[m]):
            break
        if m == M - 1:
            print(i)
            exit()
print(-1)

Buggy submission (verdict: Runtime Error):
A = [[0] * 3] * 3

for i in range(3):
    a, b, c = map(int, input().split())
    A[i][0], A[i][1], A[i][2] = a, b, c

N = int(input())
B = [0] * N
for i in range(N):
    B[i] = int(input())

# input ここまで
import itertools
def flatten_list(l):
    return list(itertools.chain.from_iterable(l))

mark_list = [False] * 9

flatten_A = flatten_list(A)
for b in B:
    if not b in flatten_A: continue
    # 選ばれた数が自分のビンゴに含まれている
    for i in range(9):
        if flatten_A[i] == b:
            mark_list[i] = True

"""
[0, 1, 2], [3, 4, 5], [6, 7, 8]
[0, 3, 6], [1, 4, 7], [2, 5, 8]
[0, 4, 8], [2, 4, 6]
"""
def judge_bingo(l):
    yes = "Yes"
    no = "No"
    if l.count(True) < 3:
        return no
    if l[0] == 1:
        if (l[1] and l[2]) or (l[3] and l[6]) or (l[4] and l[8]):
            return yes
    if l[3] and l[4] and l[5]:
        return yes
    if l[1] and l[4] and l[7]:
        return yes
    if l[2]:
        if l[4] and l[6]: return yes
        if l[5] and l[8]: return yes
    if l[6] and l[7] and l[8]:
        return yes
    return no
        

ans = judge_bingo(mark_list)
print(ans)
Problem p02802 (python)

Fixed submission:
N, M = map(int, input().split())
p = [0] * M
S = [''] * M
for i in range(M):
    p_i, S[i] = input().split()
    p[i] = int(p_i)




penal_ct = 0
ac_count = 0
# prev_ac_num = -1
ac_list = [False] * N
pos = 0

wa_count = [0] * N

for i in range(M):
    if S[i] == 'WA':
        wa_count[p[i] - 1] += 1
        # print(wa_count[p[i] - 1])
    elif (not ac_list[p[i] - 1]) and S[i] == 'AC': # ACかつ今までにACしてない
        ac_list[p[i] - 1] = True
        ac_count += 1
        if i == 0:
            continue
        penal_ct += wa_count[p[i] - 1]
        # for j in range(i)[::-1]:
        #     if S[j] == 'WA' and p[j] == p[i]:
        #         penal_ct += 1
    # if all(ac_list):
        # break
# print(wa_count)
print(ac_count, penal_ct)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
p = [0] * M
S = [''] * M
for i in range(M):
    p_i, S[i] = input().split()
    p[i] = int(p_i)




# penal_ct = 0
# ac_count = 0
# # prev_ac_num = -1

# ac_list = [False] * N

# for i in range(M):
#     if (not ac_list[p[i] - 1]) and S[i] == 'AC': # ACかつ今までにACしてない
#         ac_list[p[i] - 1] = True
#         ac_count += 1
#         if i == 0:
#             continue
#         for j in range(i)[::-1]:
#             if S[j] == 'WA' and p[j] == p[i]:
#                 penal_ct += 1

#     if all(ac_list):
#         break



# for i in range(1, M)[::-1]:
#     if S[i] == 'AC' and p[i] != prev_ac_num:
#         prob_num = prev_ac_num = p[i]
#         ac_count += 1
#         for j in range(i)[::-1]:
#             if p[j] == prob_num and S[j] == 'WA':
#                 penal_ct += 1
print(ac_count, penal_ct)
Problem p02811 (python)

Fixed submission:
k, x = map(int, input().split())
if 500*k < x: print("No")
else: print("Yes")

Buggy submission (verdict: Runtime Error):
k, x = mao(int, inout().split())
if 500*k < x: print("No")
else: print("Yes")
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()

count = 0
for i in range(n - 2):
    if s[i] == 'A':
        if s[i + 1] == 'B':
            if s[i + 2] == 'C':
                count += 1
print(count)

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

count=0
for i in range(n-2):
  if s[i] = "A":
    if s[i+1] = "B":
      if s[i+2]="C":
        count += 1
print(count)
Problem p02837 (python)

Fixed submission:
from collections import  deque
import sys
import bisect
# import math
import itertools
from queue import deque
# from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

# def lcm(x, y): return (x * y) // gcd(x, y)

N = inp()
A = [0 for _ in range(N)]
xx = [[] for _ in range(N)]
yy = [[] for _ in range(N)]

for i in range(N):
    A[i] = inp()
    for _ in range(A[i]):
        x, y = inp_list()
        xx[i].append(x)
        yy[i].append(y)

# ↑ inputs
# ↓ main process

honest_count = 0
# {0, 1, ..., N-1} の集合の bit 全探索
ans = 0
for bit in range(1 << N):
    """
        例： bit == 10 のとき、2進数では 001010 
            右から人 1, 2, ..., 6 と対応させる。
    """
    ok = True
    is_honest = [(bit >> i) & 1 for i in range(N)] # bit を 1 右にシフトさせたものの2^0の位が1なら True
    for i in range(N):
        if not is_honest[i]: continue
        for (x, y) in zip(xx[i], yy[i]):
            if is_honest[x - 1] != y:
                ok = False
    if ok:
        ans = max(ans, sum(is_honest))
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import  deque
import sys
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)

N = inp()
A = [0 for _ in range(N)]
xx = [[] for _ in range(N)]
yy = [[] for _ in range(N)]

for i in range(N):
    A[i] = inp()
    for _ in range(A[i]):
        x, y = inp_list()
        xx[i].append(x)
        yy[i].append(y)

# ↑ inputs
# ↓ main process

honest_count = 0
# {0, 1, ..., N-1} の集合の bit 全探索
ans = 0
for bit in range(1 << N):
    """
        例： bit == 10 のとき、2進数では 001010 
            右から人 1, 2, ..., 6 と対応させる。
    """
    ok = True
    is_honest = [(bit >> i) & 1 for i in range(N)] # bit を 1 右にシフトさせたものの2^0の位が1なら True
    for i in range(N):
        if not is_honest[i]: continue
        for (x, y) in zip(xx[i], yy[i]):
            if is_honest[x - 1] != y:
                ok = False
    if ok:
        ans = max(ans, sum(is_honest))
print(ans)
Problem p02842 (python)

Fixed submission:
N = int(input())
for x in range(1, 50000):
    if int(x * 1.08) == N:
        print(x)
        exit()
print(":(")

Buggy submission (verdict: Runtime Error):
N = int(input())
for x in range(1, 50_000):
    if int(x * 1.08) == N:
        print(x)
        exit()
print(":(")
Problem p02909 (python)

Fixed submission:
s = input()
w = ["Sunny", "Cloudy", "Rainy"]
for i in range(3):
  if s == w[i]:
    if i == 2: j = 0
    else: j = i + 1
    print(w[j])
    break

Buggy submission (verdict: Runtime Error):
s = input()
ww = ["Sunny", "Cloudy", "Rainy"]
for w in ww:
  if s == w[i]:
    if i == 2: j = 0
    else: j = i + 1
    print(w[j])
    break
Problem p02947 (python)

Fixed submission:
import itertools

def comb(n, r):
    return len(list(itertools.combinations(range(n), r)))

def get_runlength(s): # ex) s = 'RRLLLLRLRLRLRR'
    ret = []
    count = 1
    for i in range(len(s)):
        if i == len(s) - 1:
            ret.append((s[i], count))
            continue
        if s[i] == s[i + 1]:
            count += 1
        else:
            ret.append((s[i], count))
            count = 1
    return ret

n = int(input())
dic = {}
for i in range(n):
    sin = input()
    sin = list(sin)
    sin.sort()
    sin = ''.join(sin)
    try:
        dic[sin] += 1
    except:
        dic[sin] = 1

count = 0
for v in dic.values():
    count += v * (v - 1) / 2
count = int(count)
print(count)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

n = int(input())
s = []
for i in range(n):
    sin = input()
    sin = list(sin)
    sin.sort()
    sin = ''.join(sin)
    s.append(sin)

ss = set(s)
count = 0
for u in ss:
    al = s.count(u)
    count += comb(al, 2, exact=True)
print(count)
Problem p03162 (python)

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N = inp()
# a = np.zeros((N, 3), dtype=int)
a = [0] * N

for i in range(N):
    a[i] = inp_list()

# dp[i + 1][j]: i日目までの活動で、i日目に活動 j (0: A, 1: B, 2:C) を選んだときの i + 1 日目の幸福の最大値
# dp = np.zeros((N + 1, 3), dtype=int)
dp = [[0] * 3 for _ in range(N + 1)]
for i in range(N):
    for j in range(3): # i 日目の活動
        for k in range(3): # i + 1 日目の活動
            if j == k: continue
            dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + a[i][k])

ans = 0
for i in range(3):
    ans = max(ans, dp[N][i]) # N 日目を終了したときの幸福度 => dp[N][] (N + 1 番目)

# print(a)
# print(dp)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N = inp()
a = np.zeros((N, 3), dtype=int)

for i in range(N):
    a[i] = inp_list()

# dp[i + 1][j]: i日目までの活動で、i日目に活動 j (0: A, 1: B, 2:C) を選んだときの i + 1 日目の幸福の最大値
dp = np.zeros((N + 1, 3), dtype=int)
for i in range(N):
    for j in range(3): # i 日目の活動
        for k in range(3): # i + 1 日目の活動
            if j == k: continue
            dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + a[i][k])

ans = 0
for i in range(3):
    ans = max(ans, dp[N][i]) # N 日目を終了したときの幸福度 => dp[N][] (N + 1 番目)

# print(a)
# print(dp)
print(ans)
Problem p03574 (python)

Fixed submission:
import numpy as np

def main():
    H, W = list(map(int, input().split()))
    s = [input() for i in range(H)]
    ans = []
    for row in s:
        ans.append(list(row))
    
    diffs = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]
    for y in range(H):
        for x in range(W):
            if s[y][x] == '#': continue
            count = 0
            for dx, dy in diffs:
                if (x + dx < 0) or (x + dx > W - 1) or (y + dy < 0) or (y + dy > H - 1):
                    continue
                if s[y + dy][x + dx] == '#':
                    count += 1
            ans[y][x] = str(count)
    
    for i in range(H):
        print(''.join(ans[i]))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    H, W = list(map(int, input().split()))
    s = [input() for i in ragne(H)]
    ans = []
    for row in s:
        ans.append(list(row))
    
    diffs = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]
    for y in range(H):
        for x in range(W):
            if s[y][x] == '#': continue
            count = 0
            for dx, dy in diffs:
                if (x + dx < 0) or (x + dx > W - 1) or (y + dy < 0) or (y + dy > H - 1):
                    continue
                if s[y + dy][x + dx] == '#':
                    count += 1
            ans[y][x] = str(count)
    
    for i in range(H):
        print(''.join(ans[i]))

if __name__ == "__main__":
    main()
Problem p02621 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
b=a**2
c=a***3
print(a+b+c)
Problem p02608 (python)

Fixed submission:
L=[]
i=0
while i <100001:
    L.append(0)
    i+=1
for x0 in range(1,100):
    for y0 in range(1,100):
        for z0 in range(1,100):
            p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0
            if p<10001:
                L[p]+=1
N=int(input())
for i in range(1,N+1):
    print(L[i])

Buggy submission (verdict: Runtime Error):
L=[]
i=0
while i <10000:
    L.append(0)
    i+=1
for x0 in range(1,100):
    for y0 in range(1,100):
        for z0 in range(1,100):
            p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0
            if p<10001:
                L[p]+=1
N=int(input())
for i in range(0,N):
    print(L[i])

Buggy submission (verdict: Runtime Error):
L=[]
i=0
while i <10000:
    L.append(0)
    i+=1
for x0 in range(1,100):
    for y0 in range(1,100):
        for z0 in range(1,100):
            p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0
            if p<10000:
                L[p]+=1
N=int(input())
for i in range(1,N+1):
    print(L[i])
Problem p02780 (python)

Fixed submission:
N,K=map(int,input().split())
p=list(map(int,input().split()))
q=[]
q.append(0)
for i in range(len(p)):
  q.append(q[-1]+p[i])
maxi=q[K]-q[0]
for i in range(1,N-K+1):
  sub=q[K+i]-q[i]
  if sub>=maxi:
    maxi=sub
print((maxi+K)/2)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
p=list(map(int,input().split()))
q=[]
for i in range(len(p)):
  q.append(p[i])
maxi=q[K]-q[0]
for i in range(1,N-K+1):
  sub=q[K+i]-q[i]
  if sub>=maxi:
    maxi=sub
print((maxi+K)/2)
Problem p02787 (python)

Fixed submission:
H,N=map(int,input().split())
A=[]
B=[]
for i in range(N):
    n,a=input().split()
    A.append(int(n))
    B.append(int(a))
def f(x):
    if x<=0:
        return 0
    else:
        mini=g(x-A[0])+B[0]
        for i in range (1,N):
            sub=g(x-A[i])+B[i]
            if sub<mini:
                mini=sub
        return mini
def g(x):
    if x<0:
        return 0
    else:
        return g_list[x]
g_list=[]
g_list.append(0)
for i in range(1,H+1):
    g_list.append(f(i))
print(g_list[-1])

Buggy submission (verdict: Runtime Error):
import math
H,N=map(int,input().split())
A=[]
B=[]
for i in range(N):
    n,a=input().split()
    A.append(int(n))
    B.append(int(a))
C=[]
for i in range(N):
    C.append(A[i]/B[i])
sub=0
for i in range(N):
    if C[i]>=C[sub]:
        sub=i
sub2=math.ceil(H/A[sub])
sub3=sub2*B[sub]
def f(x):
    if x<=0:
        return 0
    else:
        mini=f(x-A[0])+B[0]
        for i in range (1,N):
            sub=f(x-A[i])+B[i]
            if sub<mini:
                mini=sub
        return mini
for ia in range(H,sub2*A[sub]):
    if f(ia)<sub3:
        sub3=f(ia)
print(sub3)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
H,N=map(int,input().split())
A=[]
B=[]
for i in range(N):
  n,a=input().split()
  A.append(int(n))
  B.append(int(a))
C=[]
for i in range(N):
  C.append(A[i]/B[i])
sub=0
for i in range(N):
  if C[i]>=C[sub]:
    sub=i
sub2=math.ceil(H/A[sub])
sub3=sub2*B[sub]
for ia in range(H,sub2*A[sub]):
  t = ia
  M = len(A) - 1
  elm = []
  for i, step in enumerate(A):
    temp = [1] * (M - i)
    elm.append(np.arange(0, t+1, step).reshape(-1, *temp))
  res = 0
  for x in elm:
    res = res + x
  for x in np.argwhere(res == t):
    sub4=0
    for ib in range(N):
      sub4+=B[ib]*x[ib]
    if sub4<=sub3:
      sub3=sub4
print(sub3)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
H,N=map(int,input().split)
A=[]
B=[]
for i in range(N):
    n,a=input().split()
    A.append(int(n))
    B.append(int(a))
C=[]
for i in range(N):
  C.append(A[i]/B[i])
sub=0
for i in range(N):
  if C[i]>=C[sub]:
    sub=i
sub2=math.ceil(H/A[sub])
sub3=sub2*B[sub]
for ia in range(H,sub2):
  t = ia
  M = len(A) - 1
  elm = []
  for i, step in enumerate(A):
    temp = [1] * (M - i)
    elm.append(np.arange(0, t+1, step).reshape(-1, *temp))
  res = 0
  for x in elm:
    res = res + x
  sub4=0
  for x in np.argwhere(res == t):
    for ib in range(N):
    sub4+=B[ib]*x[ib]
  if sub4<=sub3:
    sub3=sub4
print(sub3)
Problem p02803 (python)

Fixed submission:
from collections import deque
import numpy as np
H,W = map(int,input().split())
Maze=[list(input()) for i in range(H)]
ans=0
for hi in range(0,H):
    for wi in range(0,W):
        if Maze[hi][wi]=="#":
            continue
        maze1=[[0]*W for _ in range(H)]
        stack=deque([[hi,wi]])
        while stack:
            h,w=stack.popleft()
            for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
                new_h,new_w=h+i,w+j
                if new_h <0 or new_w <0 or new_h >=H or new_w >=W:
                    continue
                elif Maze[new_h][new_w]!="#" and maze1[new_h][new_w]==0:
                    maze1[new_h][new_w]=maze1[h][w]+1
                    stack.append([new_h,new_w])
        
        maze1[hi][wi]=0
        ans=max(ans,np.max(maze1))
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
import numpy as np
H,W = map(int,input().split())
Maze=[list(input()) for i in range(H)]
for hi in range(0,H):
    for wi in range(0,W):
        if Maze[hi][wi]=="#":
            continue
        maze1=[[0]*W for _ in range(H)]
        stack=deque([[hi,wi]])
        while stack:
            h,w=stack.popleft()
            for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
                new_h,new_w=h+i,w+j
                if new_h <0 or new_w <0 or new_h >=H or new_w >=W:
                    continue
                elif Maze[new_h][new_w]!="#" and maze1[new_h][new_w]==0:
                    maze1[new_h][new_w]=maze1[h][w]+1
                    stack.append([new_h,new_w])
        
        maze1[hi][wi]=0
        ans=max(ans,np.max(maze1))
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
import numpy as np
H,W = map(int,input().split())
Maze=[list(map(int,input().split())) for i in range(H)]
for hi in range(0,H):
    for wi in range(0,W):
        if Maze[hi][wi]=="#":
            continue
        maze1=[[0]*W for _ in range(H)]
        stack=deque([[hi,wi]])
        while stack:
            h,w=stack.popleft()
            for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
                new_h,new_w=h+i,w+j
                if new_h <0 or new_w <0 or new_h >=H or new_w >=W:
                    continue
                elif Maze[new_h][new_w]!="#" and maze1[new_h][new_w]==0:
                    maze1[new_h][new_w]+=maze1[h][w]
                    stack.append([new_h,new_w])
        
        maze1[hi][wi]=0
        ans=max(ans,np.max(maze1))
print(ans)
Problem p02882 (python)

Fixed submission:
import math
a,b,x = map(int,input().split())
y = math.pi
if x >= 1/2 * (a*a*b):
    theta = math.atan(2*(a*a*b-x)/(a*a*a))
else:
    theta = y/2 - math.atan(2*x/(a*b*b))
print(theta*180/y)

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if x >= 1/2 * (a*a*b):
    theta = math.atan(2(a*a*b-x)/(a*a*a))
else:
    theta = 90 - math.atan(2x/(a*b*b))
print(theta)

Buggy submission (verdict: Runtime Error):
a,b,x = map(int,input().split())
if x >= 1/2 * (a*a*b):
    theta = arctan(2(a*a*b-x)/(a*a*a))
else:
    theta = 90 - arctan(2x/(a*b*b))
print(theta)
Problem p03145 (python)

Fixed submission:
a,b,c = map(int,input().split())
print(round(0.5*a*b))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(rount(0.5*a*b))
Problem p03777 (python)

Fixed submission:
a,b = input().split()
if a == b :
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b = input()
if a == b :
  print('H')
else:
  print('D')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
if a == b:
  print("H")
else:
  print("D")
Problem p04011 (python)

Fixed submission:
n,k,x,y = (int(input())for i in [0]*4)
if k <= n:
    print(k*(x-y)+n*y)
else:
    print(n*x)

Buggy submission (verdict: Runtime Error):
n,k,x,y = (int(iinput())for i in [0]*4)
if k <= n:
    print(k*(x-y)+n*y)
else:
    print(n*x)

Buggy submission (verdict: Runtime Error):
n = input()
k = input()
x = input()
y = input()
if k <= n:
    print(k*(x-y)+n*y)
else:
    print(n*x)

Buggy submission (verdict: Runtime Error):
n,k,x,y = map(int,input().split())
if k <= n:
    print(k*(x-y)+n*y)
else:
    print(n*x)

Buggy submission (verdict: Runtime Error):
n = input()
k = input()
x = input()
y = input()
print(k*(x-y)+n*y)
Problem p02582 (python)

Fixed submission:
n=(input())
if n=='RSR':
    print(1)
else:
    print(n.count('R'))

Buggy submission (verdict: Runtime Error):
n=list(input())
print(n.index('S'))
Problem p02612 (python)

Fixed submission:
n=int(input())
while n>0:
    n-=1000
print(abs(n))

Buggy submission (verdict: Runtime Error):
n=input()
print(0 if n[-3]=='0' else (1000-int(n[-3])*100))

Buggy submission (verdict: Runtime Error):
n=input()
print(int(n[-3])*100)
Problem p02641 (python)

Fixed submission:
x,n=map(int,input().split())
S=map(int, input().split())
K=(list(range(0,102)))
for i in S:
    K.remove(i)
L=[]
for i in K:
    L.append(abs(x-i))
m=min(L)
ind_m=L.index(m)
print(K[ind_m])

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
S=map(int, input().split())
K=(list(range(1,101)))
for i in S:
    K.remove(i)
L=[]
for i in K:
    L.append(abs(x-i))
m=min(L)
ind_m=L.index(m)
print(K[ind_m])
Problem p03860 (python)

Fixed submission:
a,b,c=input().split()
print(a[0]+b[0]+c[0])

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
a_p=a//x
b_p=b//x

if a%x==0:
    print(b_p-a_p+1)
else:
    print(b_p-a_p)
Problem p03861 (python)

Fixed submission:
a,b,x=map(int,input().split())
a_p=a//x
b_p=b//x

if a%x==0:
    print(b_p-a_p+1)
else:
    print(b_p-a_p)

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
L=list(range(a,b+1))
L_2=[]
for i in L:
    if i % x != 0:
        continue
    L_2.append(i)
print(len(L_2))
Problem p02657 (python)

Fixed submission:
a = input()
a = [int(n) for n in a.split()]
print(a[0] * a[1])

Buggy submission (verdict: Runtime Error):
in = input()
in = int(in.split())
print(in[0] * in[1])

Buggy submission (verdict: Runtime Error):
a = (int)input()
b = (int)input()
print(a*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)
Problem p02582 (python)

Fixed submission:
A = input()
b = A.count("RRR")
C = A.count("RR")
if b == 1: 
   print(3)
elif C ==1:
   print(2)
else:
   if A.count("R")>0:
      print(1)
   else:
      print(0)

Buggy submission (verdict: Runtime Error):
A = input()
b = A.count("RRR")
C = A.count("RR")
D = A.count("R")
if b == 1: 
   print(3)
elif C ==1:
   print(2)
else:
   if D >0:
      print(1)
   else:
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
output = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        output *= A[i]
        if output> 10**18:
            print(-1)
            quit()
    print(output)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(0)
    quit()
for i in range(N):
    output = 1
    output *= a[i]
    if output> 10**18:
        print(-1)
        quit()
print(output)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
if (0 in A):
    print(0)
for i in range(N):
    output = 1
    output *= a[i]
    if output> 10**18:
        print(-1)
        quit()
print(output)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    output = 1
    output *= a[i]

    if output> 10**18:
        print(-1)
        quit()
print(output)