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

Fixed submission:
n = int(input())
s = input()      
pattern = list('ABC')          
cnt = 0

for i in range(n-len(pattern)+1):
    if s[i] == pattern[0]:
        if s[i+1] == pattern[1]:
            if s[i+2] == pattern[2]:
                cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()      
pattern = list('ABC')          
cnt = 0

for i in range(n):
    for j in range(3):
        if s[i + j] != pattern[j]:
            match = False
            break
    if match:                   # すべての文字が一致していればカウント
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()            # テキストをリストに変換
pattern = list('ABC')          # パターンをリストに変換
cnt = 0

for i in range(n):
    match = True                # 一致しているものとして探索開始
    for j in range(len(pattern)):
        if s[i + j] != pattern[j]:
            match = False       # 一致しなかった
    if match:                   # すべての文字が一致していればカウント
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
text = input()            # テキストをリストに変換
pattern = list('ABC')          # パターンをリストに変換
cnt = 0

for i in range(n):
    match = True                # 一致しているものとして探索開始
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       # 一致しなかった
            break
    if match:                   # すべての文字が一致していればカウント
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
text = input(list())            # テキストをリストに変換
pattern = list('ABC')          # パターンをリストに変換
cnt = 0

for i in range(n):
    match = True                # 一致しているものとして探索開始
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       # 一致しなかった
            break
    if match:                   # すべての文字が一致していれば出力
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
text = input(list()            # テキストをリストに変換
pattern = list('ABC')          # パターンをリストに変換
cnt = 0

for i in range(n):
    match = True                # 一致しているものとして探索開始
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       # 一致しなかった
            break
    if match:                   # すべての文字が一致していれば出力
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
text = input(list()            # テキストをリストに変換
pattern = list('ABC')          # パターンをリストに変換


for i in range(n):
    match = True                # 一致しているものとして探索開始
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       # 一致しなかった
            break
    if match:                   # すべての文字が一致していれば出力
        print(i)
        break
Problem p02848 (python)

Fixed submission:
n = int(input())
s = input()
ans = []

for i in range(len(s)):
    temp = ord(s[i]) +n
    if temp > 0x5a:
        temp -= 26
    ans.append(chr(temp))
    
for k in range(len(ans)):
    print(ans[k], end = "")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = []
for s in S:
    if ord(s) + N > 90:
        ans.append(chr(ord(s)+(N-26)))
    else:
        ans.append(chr(ord(s)+N))
for j in range(len(S)):
    print(ans, end ="")
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
for i in range(50):
    if  a * i  - (i-1) >= b:
        print(i)
        exit()

Buggy submission (verdict: Runtime Error):
a,b=map(int(input().split()))
print(b%(a+1))

Buggy submission (verdict: Runtime Error):
a,b=map(int(input().split()))
print(b%a+1)
Problem p02945 (python)

Fixed submission:
a, b = map(int, input().split())
l = []
c = a +b
d = a -b
e = a *b
l.append(c)
l.append(d)
l.append(e)
print(max(l))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
l = []
c = a +b
d = a -b
e = a *b
l.append(c)
l.append(d)
l.append(e)
print(max(l[c, d, e]))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
l = []
c = a +b
d = a -b
e = a *b
l.append =c
l.append =d
l.append =e
print(max(l[c, d, e]))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
l = []
c = a +b
d = a -b
e = a *b
l.append =c
l.append =d
l.append =e
print(max(l))
Problem p02993 (python)

Fixed submission:
s = input()
flg = 0
for i in range(3):
    if s[i] == s[i+1]:
        flg = 1

if flg == 0:
    print("Good")
else:
    print("Bad")

Buggy submission (verdict: Runtime Error):
s = input()
flg = 0
for i in range(4):
    if s[i] == s[i+1]:
        flg = 1

if flg == 0:
    print("Good")
else:
    print("Bad")
Problem p02999 (python)

Fixed submission:
x,a=map(int,input().split())
if x>=a :
   print("10")
else:
   print("0")

Buggy submission (verdict: Runtime Error):
x,a=map{int,input().split()}
if a>x:
   print("0")
else:
   print("10")
Problem p03029 (python)

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

apple = 3 * a + p
pie = apple // 2

print(pie)

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

apple = 3 * a + b
pie = apple // 2

print(pie)
Problem p03076 (python)

Fixed submission:
menu = [int(input()) for i in range(5)]
def kuriage(n):
    if n %10 == 0:
        return 0
    else:
        return 10-(n %10)
ans = 0
mini = 10
k = 5
for i in range(5):
    if menu[i] %10 < mini and menu[i]%10 !=0:
        mini = menu[i] %10
        k = i
for i in range(5):
    if i == k:
        menu[i], menu[-1] = menu[-1], menu[i]

for i in range(5):
    if i != 4:
        ans += menu[i] + kuriage(menu[i])
    else:
        ans += menu[-1]
        print(ans)

Buggy submission (verdict: Runtime Error):
menu = [int(input()) for i in range(5)]
def kuriage(n):
    if n %10 == 0:
        return 0
    else:
        return 10-(n %10)
ans = 0
mini = 10
for i in range(5):
    if menu[i] %10 < mini and menu[i]%10 !=0:
        mini = menu[i] %10
        k = i
for i in range(5):
    if i == k:
        menu[i], menu[-1] = menu[-1], menu[i]

for i in range(5):
    if i != 4:
        ans += menu[i] + kuriage(menu[i])
    else:
        ans += menu[-1]
        print(ans)
Problem p03109 (python)

Fixed submission:
s = input()
if s[5] == "1":
    print("TBD")
elif s[6] == "4" or s[6] == "3" or s[6] == "2" or s[6] == "1":
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
s = input()
if s[5] == "1":
    print("TBD")
elif s[6] == "4" or s[6] == "3" s[6] == "2" s[6] == "1":
    print("Heisei")
else:
    print("TBD")
Problem p03125 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().spli())
if b % a == 0:
    print(a + b)
else:
    print(b-a)
Problem p03145 (python)

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

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

Fixed submission:
n = int(input())
for i in range(1, 10):
    if (100*i + 10*i + i ) >= n:
        print(100*i + 10*i + i)
        exit()

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10):
    if 100*i + 10*i + i => n:
        print(100*i + 10*i + i)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(10):
    if 100*i + 10*i + i => n:
        print(100*i + 10*i + i)
Problem p03293 (python)

Fixed submission:
S = input()
T = input()
if S in T*2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if s in T*2:
    print("Yes")
else:
    print("No")
Problem p03324 (python)

Fixed submission:
d, n = map(int, input().split())
x = 100 **d
if n != 100:
    print(x*n)
else:
    print(x*(n +1))

Buggy submission (verdict: Runtime Error):
d, n = map(int, input().split())
if d == 0:
    print(x)
    exit()
x = 100 **d
print(x*n)
Problem p03378 (python)

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

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

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a, b) + min(c, d))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(sum(min(a, b), min(c, d)))
Problem p03434 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse = True)
i = 0
a = 0
b = 0
while i < n: 
    a = a +l[i]
    i += 2
i = 1
while i < n:
    b = b +l[i]
    i += 2
print(a -b)

Buggy submission (verdict: Runtime Error):
li = list(map(int, input().split()))
li.sort(reverse = True)
i = 0
while i <= len(li): 
    a = li[i]
    i += 2
i = 1
while i <= len(li):
    b = li[i]
    i += 2
print(a -b)

Buggy submission (verdict: Runtime Error):
li = list(map(int, input().split()))
li.sort(*, key = None, reverse = True)
i = 0
while i <= len(li): 
    a = li[i]
    i += 2
i = 1
while i <= len(li):
    b = li[i]
    i += 2
print(a -b)

Buggy submission (verdict: Runtime Error):
li = list(map(int, input().split()))
li.sort(*, key = None, reverse = True)
for i in range(len(li)):
    a = li[i]
    b = li[i +1]
print(a -b)

Buggy submission (verdict: Runtime Error):
li = list(map(int, input().split()))
li.sort(*, key = None, reverse = True)
for i in range(len(li)):
    a = li[i]
    b = li[i +1]]
print(a -b)
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if h *500 + i *100 + j *50 == x:
                count += 1
print(count)

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

count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if total = h *500 + i *100 + j *50 == x:
                count += 1
print(count)

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

count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if total = a *500 + b *100 + c *50 == x:
                count += 1
print(count)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a % 2 == 1) and (b % 2 == 1):
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input.split())
if a // 2 == 1 and b // 2 == 1:
  print("Odd")
else:
  print("Even")
Problem p03469 (python)

Fixed submission:
s=input()
print("2018"+s[4:])

Buggy submission (verdict: Runtime Error):
s=int(input())
print("2018"+[:4])
Problem p03470 (python)

Fixed submission:
n=int(input())
list=[int(input()) for i in range(n)]
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
n=int(input())
list=[input() for i in range(n)]

a = []

for i in range(n):
    a.append(list.count(i))
    
print(len(set((a)))
Problem p03474 (python)

Fixed submission:
a, b = map(int, input().split())
s = input()
flg = 0
for i in range(a +b +1):
    try:
        if (0 <= int(s[i]) <= 9):
            if i == a:
                flg = 0
                break
    except:
        if i == a:
            flg = 1
        else:
            flg = 0
            break
print("Yes" if flg == 1 else "No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
flg = 0
for i in range(a +b):
    if not(0 <= int(s[i]) <= 9): 
        if s[a] == "-":
            flg = 1
        
print("Yes" if flg == 1 else "No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
flg = 0
for i in range(a +b):
    if not(0 <= s[i] <= 9): 
        if s[a] == "-":
            flg = 1
        
print("Yes" if flg == 1 else "No")
Problem p03477 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
if (A+B)<(C+D):
   print("Right")
elif (A+B)==(C+D):
   print("Balanced")
else:
   print("Left")

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
if (A+B)<(C+D):
   print("Right")
elif (A+B)==(C+D)
   print("Balanced")
else:
   print("Left")
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
import statistics
import marh
a, b = map(int,input().split())
if ((a + b) //2 ) %2 == 0:
    print((a+b)//2)
else:
    print((a+b)//2 +1)
Problem p03493 (python)

Fixed submission:
s=input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
s = list[]
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
s = int(input())
print(s.count(1))

Buggy submission (verdict: Runtime Error):
s, t, u = map(int, input().split())
x = 0
if s % 1 == 1:
  x = x + 1
if t % 1 == 1:
  x = x + 1
if u % 1 == 1:
  x = x + 1
 
print(x)

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

t = s % 100
u = s % 10
v = s % 1

if t == 1:
  x++
if u == 1:
  x++
if v == 1:
  x++

print(x)
Problem p03543 (python)

Fixed submission:
n = input()
if n[1] == n[2]:
    if n[0] == n[1] or n[2] == n[3]:
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[1] == n[2]:
    if n[0] == n[1] or n[2] == n[3]:
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[1] == n[2]:
    if n[0] == n[1] or n[2] == n[3]:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[1] == n[2]:
    if n[0] == n[1] or n[2] == n[3]:
        print('Yes')
else:
    print('No')
Problem p03605 (python)

Fixed submission:
n=input()
if "9" in n:
   print("Yes")
else: 
   print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
if "9" in n:
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
if 9 in n:
print("Yes")
else: 
print("No")
Problem p03643 (python)

Fixed submission:
n = int(input())
print("ABC{}".format(n))

Buggy submission (verdict: Runtime Error):
print("ABC{}".format(int(input()))
Problem p03694 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(b))
Problem p03796 (python)

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
print(math.factorial(n)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
print(math(factorial(n))%(10**9+7))
Problem p03826 (python)

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

Buggy submission (verdict: Runtime Error):
a, ,b, c, d = map(int, input().split())
print(max(a*b, c*d))
Problem p03852 (python)

Fixed submission:
c=input()
if c in "aiueo":
   print("vowel")
else:
   print("consonant")

Buggy submission (verdict: Runtime Error):
c=int(input())
if c in "aiueo":
   print("vowel")
else:
   print("consonant")

Buggy submission (verdict: Runtime Error):
c=int(input())
if c in  "a","i","u","e","o"
   print("vowel")
else :
   print("consonant")
Problem p04011 (python)

Fixed submission:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
ans = 0
if k <= n:
    ans +=  k*x + (n -k)*y
else:
    ans += x*n
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if k <= n:
    ans +=  k*x + (n -k)*y
else:
    ans += x*n
Problem p04029 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
    ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input()
ans=0
for i in range(1,n+1):
    ans+=i
print(ans)
Problem p03283 (python)

Fixed submission:
def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n,m,q = ina()
    tmp = [[0]*(n+1) for _ in range(n+1)]
    for _ in range(m):
        l,r = ina()
        tmp[l][r]+=1


    tmp = np.cumsum(tmp,axis=1).cumsum(axis = 0)

    for _ in range(q):
        p,q = ina()
        rick = tmp[q][q]+tmp[p-1][p-1]-tmp[p-1][q]-tmp[q][p-1]
        print(rick)
        


    
        


        


    




















if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n,m,q = ina()
    tmp = [[0]*(n+1) for _ in range(n+1)]
    for _ in range(m):
        l,r = ina()
        tmp[l][r]+=1


    tmp = np.cumsum(tmp,axis=1).cumsum(axis = 0)

    for _ in range(q):
        p,q = ina()
        rick = tmp[q][q]+tmp[p-1][p-1]-tmp[p-1][q]-tmp[q][p-1]
        print(rick)
        


    
        


        


    




















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

Fixed submission:
def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n = ini()
    tmp = ina()
    num,index = 0,0
    for i in range(n):
        if(abs(tmp[i])>num):
            num,index = abs(tmp[i]),i
    print(2*n-2)
    if(tmp[index]<=0):
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(n,1,-1):
            print(i,i-1)
    else:
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(1,n):
            print(i,i+1)


        
        
        


    
        


        


    




















if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n = ini()
    tmp = ina()
    num,index = 0,0
    for i in range(n):
        if(abs(tmp[i])>num):
            num,index = tmp[i],i
    print(2n-2)
    if(num<=0):
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(n,1,-1):
            print(i,i-1)
    else:
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(1,n):
            print(i,i+1)


        
        
        


    
        


        


    




















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

Fixed submission:
s = list(input())
ans = "Yes"
for i in range(len(s)):
  if i%2 == 0 and s[i] != "h":
    ans = "No"
  elif i%2 == 1 and s[i] != "i":
    ans = "No"
if len(s)%2 == 1:
  ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
s = list(map(input().split()))
ans = "Yes"
for i in range(len(s)):
  if i%2 == 0 and s[i] != "h":
    ans = "No"
  elif i%2 == 1 and s[i] != "i":
    ans = "No"
if len(s)%2 == 1:
  ans = "No"
print(ans)
Problem p02780 (python)

Fixed submission:
from collections import deque 
n,k = map(int,input().split())
p = list(map(int,input().split()))
q = deque()
s = 0
m = 0
ans = 0
for i in range(len(p)):
  p[i]+=1
for j in range(n):
  s+=p[j]
  q.append(p[j])
  if len(q)>k:
    s-=q.popleft()
  if len(q)==k:
    m = max(m,s)
ans = m
ans/=2
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))
s = 0
m = 0
ans = 0
for i in range(k):
  s+=p[i]
for j in range(k,n):
  s-=p[j-k]
  s+=p[j]
  if s>m:
    f = j
    m = s
for k in range(f-k+1,f+1):
  for l in range(1,p[k]+1):
    ans+=l/p[k]
print(ans)
Problem p02900 (python)

Fixed submission:
a,b = map(int,input().split())
f = [1]
while(b!=0):
  a,b=b,a%b
while a%2==0:
  f.append(2)
  a//=2
p = 3
while p*p<=a:
  if a%p==0:
    f.append(p)
    a//=p
  else:
    p+=2
if a!=1:
  f.append(a)
print(len(set(f)))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
d = []
j = 1
if a>=b:
  x = a
else:
  x = b
for i in range (1,x):
  if a%i==0 and b%i==0:
    d+=[i]
while j<len(d):
  k=j+1
  while k<len(d) and d[k]<math.sqrt(d[len(d)-1]):
    if d[k]%d[j]==0:
      d.pop(k)
      k-=1
    else:
      k+=1
  j+=1
print(len(d))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
d = []
j = 1
if a>=b:
  x = a
else:
  x = b
for i in range (1,x):
  if a%i==0 and b%i==0:
    d+=[i]
while j<len(d):
  k=j+1
  while d[k]<math.sqrt(d[len(d)-1]):
    if d[k]%d[j]==0:
      d.pop(k)
      k-=1
    else:
      k+=1
  j+=1
print(len(d))
Problem p03495 (python)

Fixed submission:
from collections import Counter
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
print(sum(sorted(Counter(a).values())[:-k]))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
c = Counter(a)
x = 0
for i in range(k):
  x+=c.most_common()[i][1]
print(n-x)
Problem p03547 (python)

Fixed submission:
x = input().split()

if x[0]<x[1]:
  print("<")
elif x[0]==x[1]:
  print("=")
elif x[0]>x[1]:
  print(">")

Buggy submission (verdict: Runtime Error):
x,y = list(map(input()))
if x>y:
  ans = ">"
elif x<y:
  ans = "<"
else:
  ans = "="
print(ans)
Problem p02553 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
print(max([a*c,a*d,b*c,b*d]))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
ans=max[a*c,a*d,b*c,b*d]
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max[a*c,a*d,b*c,b*c])
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*r*r)

Buggy submission (verdict: Runtime Error):
r = input()
print(3*r*r)
Problem p02658 (python)

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

ans = 1
if 0 in a_lis:
    ans = 0
    
else:
    for i in a_lis:
        ans *= i
        if ans > pow(10, 18):
            ans = -1
            break
        
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a_lis = list(map(int, input().split()))

ans = 1
for i in a_lis:
    if math.log(i, 10) + math.log(ans + 10) > 18:
        ans = -1
        break
    
    else:
        ans += i
        
print(ans)
Problem p03163 (python)

Fixed submission:
# メイン関数
def main():
    # 入力データ
    N, W = map(int, input().split())
    w = []
    v = []
    for i in range(N):
        wi, vi = map(int, input().split())
        w.append(wi)
        v.append(vi)

    # dpテーブルの作成
    dp = [[0] * (W+1) for i in range(N)]
    for i in range(N):
        for j in range(W + 1):
            if j - w[i] >= 0:
                dp[i][j] = max(dp[i - 1][j - w[i]] + v[i], dp[i - 1][j])
            else:
                dp[i][j] = dp[i - 1][j]

    # 解答の出力
    print(dp[-1][-1])
    return

# 実行
if __name__ == '__main__':
    main()

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


def main():
    N, W = map(int, input().split())

    w = []
    v = []
    for i in range(N):
        wi, vi = map(int, input().split())
        w.append(wi)
        v.append(vi)

    dp = [[0] * (W+1) for i in range(N)]
    for i in range(N):
        for j in range(W + 1):
            if j - w[i] >= 0:
                dp[i][j] = max(dp[i - 1][j - w[i]] + v[i], dp[i - 1][j])
            else:
                dp[i][j] = dp[i - 1][j]

    print(dp[-1][-1])
    return


if __name__ == '__main__':
    main()