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

Fixed submission:

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

a = int(n*(n-1)/2)
b = int(m*(m-1)/2)

print(a+b)

Buggy submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input().split()))
b = a.copy()
b = set(b)
b = list(b)
c = []
ans = []

for i in range(len(b)):
    c.append(a.count(b[i]))
print(b)
print(c)
d = []
for i in range(len(b)):
    num = 0
    for j in range(len(b)):
        if i == j:
            num += int(((c[j]-1)*(c[j]-2))/2)
        else:
            num += int(((c[j])*(c[j]-1))/2)
    d.append(num)
print(d)

for i in range(n):
    for j in range(len(b)):
        if a[i] == b[j]:
            print(d[j])
Problem p02847 (python)

Fixed submission:

s = input()
d = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

print(d[s])

Buggy submission (verdict: Runtime Error):

s = input()
d = {"SUN":0,"MO":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

print(d[s])
Problem p02897 (python)

Fixed submission:
n = int(input())
 
count = 0
 
for i in range(n):
    if i % 2 != 0:
        count += 1
    else:
        pass
 
print(1-float(count/n))

Buggy submission (verdict: Runtime Error):

n = int(input())

count = 0

for i in range(n):
    if i / 0:
        count += 1
    else:
        pass

print(count/n)
Problem p02970 (python)

Fixed submission:

n,d = map(int,input().split())
ans = 0
dis = 2*d +1

if (n % dis) == 0:
	ans = int(n / dis)
else:
	ans = int((n // dis)+1)

print(ans)

Buggy submission (verdict: Runtime Error):

n,d = map(int,input().split())
ans = 0
dis = 2*d +1

if (n % d) == 0:
	ans = int(n / dis)
else:
	ans = int()(n // dis)+1)

print(ans)
Problem p03077 (python)

Fixed submission:

n = int(input())
l = []
for _ in range(5):
    l.append(int(input()))

x = min(l)

if n % x == 0:
    print(n // x + 4)
else:
    print(n // x + 5)

Buggy submission (verdict: Runtime Error):

n = int(input())
l = [int(input()) for i in range(n)]

x = min(l)
print((int(n/x)+1) + 4)
Problem p03208 (python)

Fixed submission:

n,k = map(int,input().split())
h = [int(input()) for _ in range(n)]
h.sort()

t = []

for i in range(n-k+1):
    t.append(h[i+k-1]-h[i])
print(min(t))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000000)
INF=10**9
n,a,b,c=map(int,input().split())
l=[int(input()) for i in range(n)]
def dfs(i,x,y,z):
    if i==n:
        if min(x,y,z)>0:
            return abs(x-a)+abs(y-b)+abs(z-c)-30
        else:
            return INF
    ans=dfs(i+1,x,y,z)
    ant=dfs(i+1,x+l[i],y,z)+10
    anu=dfs(i+1,x,y+l[i],z)+10
    anv=dfs(i+1,x,y,z+l[i])+10
    return min(ans,ant,anu,anv)
print(dfs(0,0,0,0))
Problem p03242 (python)

Fixed submission:

n = input()
ans = ""

for i in range(len(n)):
    if n[i] == "1":
        ans += "9"
    else:
        ans += "1"
print(int(ans))

Buggy submission (verdict: Runtime Error):

n = input()
ans = ""

for i in range(n):
    if n[i] == 1:
        ans += "9"
    else:
        ans += "1"
print(int(ans))
Problem p03272 (python)

Fixed submission:

n,i = map(int,input().split())
print((n-i)+1)

Buggy submission (verdict: Runtime Error):

n,i = map(int(input().split()))
print((n-i)+1)
Problem p03631 (python)

Fixed submission:

n = input()

if n[0] == n[-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

n = input()

if n(0) == n(-1):
    print("Yes")
else:
    print("No")
Problem p03834 (python)

Fixed submission:

a,b,c = input().split(",")
print(a + " " + b + " " + c)

Buggy submission (verdict: Runtime Error):

l = list(map(int,input().split()))

count = 0

for x in range(l[0] + 1):
    for y in range(l[0] + 1):
        for z in range(l[0] + 1):
            if x + y + z == l[1]:
                count += 1
                print(x,y,z)

print(count)
Problem p03986 (python)

Fixed submission:

X = str(input())
ans = []
for x in X:
    if x == 'S':
        ans.append(x)
    else:
        if len(ans) != 0:
            if ans[-1] == 'S':
                ans.pop()
            else:
                ans.append(x)
        else:
            ans.append(x)
print(len(ans))

Buggy submission (verdict: Runtime Error):
X = input()
ans = []
for x in X:
    if x == "S":
        ans.append(x)
        else:
            if len(ans) != 0:
                if ans [-1] == "S":
                    ans.pop()
                else:
                    ans.append(x)
            else:
                ans.append(x)
print(len(ans))
Problem p02707 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0] * (n+1)

for a in A:
    B[a] += 1

print('\n'.join(map(str, B[1:])))

Buggy submission (verdict: Runtime Error):
N = input()
A = input().split()

for i in range(int(N-1)):
  print(A.count(str(i+1)))
Problem p02693 (python)

Fixed submission:
K = int(input())
A,B = map(int,input().split())







Awari = -(-A // K)



if B >= Awari*K:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
import math
import itertools

N,M,Q = map(int,input().split())
a =[0] * Q
b =[0] * Q
c =[0] * Q
d =[0] * Q
for i in range(Q):
    a[i] , b[i] , c[i] , d[i] = map(int,input().split())





def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



All =[0] * M
for i in range(M):
    All[i] = i+1

#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。



#M個のうちからN個取り出す順列
ans = 0
#for A in itertools.combinations(All, N):
for A in itertools.product(All, repeat=N):
    
    
    #点数計算
    #print(A)
    wa = 0
    for i in range(Q):
        #print(wa) 
        kari = A[b[i]-1] - A[a[i]-1]
        if kari == c[i]:
            wa = wa + d[i] 
    if ans < wa:
        ans = wa
    #print(ans) 
    #print(wa) 


print(ans)
Problem p02695 (python)

Fixed submission:
import math
import itertools

N,M,Q = map(int,input().split())
a =[0] * Q
b =[0] * Q
c =[0] * Q
d =[0] * Q
for i in range(Q):
    a[i] , b[i] , c[i] , d[i] = map(int,input().split())




Al =[0] * M
for i in range(M):
    Al[i] = i+1


#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
All = list(itertools.combinations_with_replacement(Al, N))


#M個のうちからN個取り出す順列
ans = 0
#for A in itertools.combinations(All, N):
for A in All:
    #点数計算
    #print(A)
    wa = 0
    for i in range(Q):
        #print(wa) 
        kari = A[b[i]-1] - A[a[i]-1]
        if kari == c[i]:
            wa = wa + d[i] 
    if ans < wa:
        ans = wa
    #print(ans) 
    #print(wa) 


print(ans)

Buggy submission (verdict: Runtime Error):
import math
import itertools

N,M,Q = map(int,input().split())
a =[0] * Q
b =[0] * Q
c =[0] * Q
d =[0] * Q
for i in range(Q):
    a[i] , b[i] , c[i] , d[i] = map(int,input().split())





def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



All =[0] * M
for i in range(M):
    All[i] = i+1

#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。



#M個のうちからN個取り出す順列
ans = 0
for A in itertools.product(All, N):
    #点数計算
    print(A)
    wa = 0
    for i in range(Q):
        print(wa) 
        kari = A[b[i]-1] - A[a[i]-1]
        if kari == c[i]:
            wa = wa + d[i] 
    if ans < wa:
        ans = wa
    #print(ans) 
    #print(wa) 


print(ans)
Problem p02847 (python)

Fixed submission:
S = input()

if S =="SUN":
    print(7)
elif S =="MON":
    print(6)
elif S =="TUE":
    print(5)
elif S =="WED":
    print(4)
elif S =="THU":
    print(3)
elif S =="FRI":
    print(2)
else:
    print(1)

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

#値段の算出する関数
def nedan(N,A,B):
    Nmozi = str(N)
    lengs = len(Nmozi)
    ans = A * N  + B * lengs
    return ans


#Nの値を二分法で計算する。
MAX = 1000000000
MIN = 0

for i in range(500):
    CENTER = MIN + (MAX-MIN)//2
    if MAX - MIN < 0.5:
        break
#MAXとMINが同じになったら終了する。
    if nedan(CENTER,A,B) <= X:
        MIN = CENTER
    else:
        MAX = CENTER



if nedan(MAX,A,B) <= X:
    ANS = MAX
else:
    ANS = MIN

print(ANS)

Buggy submission (verdict: Runtime Error):

N= input()
S= input()


N = int(N)
Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -65#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    LAST  = chr(LAST+65)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)
Problem p03188 (python)

Fixed submission:
K  = int(input())
n = 0
n1 = 0
n2 = 0
n3 = 0
n4 = 0
n5 = 0


#Kが500以下の場合、斜め作戦にする
if K <= 499:
   n = K
   mat = [[0 for n1 in range(K)] for n2 in range(K)]
   for n1 in range(K):
      for n2 in range(K-n1):
         mat[n1][n1+n2] = n2+1
   for n1 in range(K):
      for n2 in range(n1):
         mat[n1][n2] = K+n2-n1+1

#Kが500以上の場合、斜めに1マスずつしのびこませる   
else:
   n = 500
   mat = [[0 for n1 in range(500)] for n2 in range(500)]
   for n1 in range(500):
      for n2 in range(500-n1):
         mat[n1][n1+n2] = n2+1
   for n1 in range(500):
      for n2 in range(n1):
         mat[n1][n2] = 500+n2-n1+1

   #Kが500以上の場合のギザギザ部分
   for n2 in range(K-500):
      for n1 in range(250):
          kari = n1*2+n2
          if kari >= 500:
             kari = kari-500
          mat[n1*2][kari] = n2+501


#行列の出力かんがえとく 
print(n)

if K <= 500:
   out = ""
   for n1 in range(K):
      out = ""   
      for n2 in range(K):
         out = out + " " + str(mat[n1][n2])
      print(out)
   
#Kが500以上の場合、斜めに1マスずつしのびこませる   
else:
   out = ""
   for n1 in range(500):
       out = ""   
       for n2 in range(500):
          out = out + " " + str(mat[n1][n2])
       print(out)

Buggy submission (verdict: Runtime Error):
K  = int(input())
n = 0
n1 = 0
n2 = 0
n3 = 0
n4 = 0
n5 = 0


#Kが500以下の場合、斜め作戦にする
if K <= 500:
   n = K
   mat = [[0 for n1 in range(K)] for n2 in range(K)]
   for n1 in range(K):
      for n2 in range(K-n1):
         mat[n1][n1+n2] = n2+1
   for n1 in range(K):
      for n2 in range(n1):
         mat[n1][n2] = K+n2-n1+1

#Kが500以上の場合、斜めに1マスずつしのびこませる   
else:
   n = 500
   mat = [[0 for n1 in range(500)] for n2 in range(500)]
   for n1 in range(500):
      for n2 in range(500-n1):
         mat[n1][n1+n2] = n2+1
   for n1 in range(500):
      for n2 in range(n1):
         mat[n1][n2] = 500+n2-n1+1










#行列の出力かんがえとく 
print(n)

if K <= 500:
out = ""
for n1 in range(K):
   out = ""   
   for n2 in range(K):
      out = out + " " + str(mat[n1][n2])
   print(out)
#Kが500以上の場合、斜めに1マスずつしのびこませる   
else:
out = ""
for n1 in range(500):
   out = ""   
   for n2 in range(500):
      out = out + " " + str(mat[n1][n2])
   print(out)

Buggy submission (verdict: Runtime Error):
K  = int(input())
n = 0
n1 = 0
n2 = 0
n3 = 0
n4 = 0
n5 = 0


#Kが500以下の場合、斜め作戦にする
if K <= 500:
   n = K
   mat = [[0 for n1 in range(K)] for n2 in range(K)]
   for n1 in range(K):
      for n2 in range(K-n1):
         mat[n1][n1+n2] = n2+1
   for n1 in range(K):
      for n2 in range(n1):
         mat[n1][n2] = K+n2-n1+1

#Kが500以上の場合、斜めに1マスずつしのびこませる   
else:
   n = 500
   mat = [[0 for n1 in range(500)] for n2 in range(500)]
   for n1 in range(500):
      for n2 in range(500-n1):
         mat[n1][n1+n2] = n2+1
   for n1 in range(500):
      for n2 in range(n1):
         mat[n1][n2] = 500+n2-n1+1










#行列の出力かんがえとく 
print(n)
out = ""
for n1 in range(K):
   out = ""   
   for n2 in range(K):
      out = out + " " + str(mat[n1][n2])
   print(out)
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2==0:
  print (0.5)
else:
  print (1-((n//2)/n))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(0.5)
elif:
  print ((n//2)/n)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print 0.5
elif:
  print ((n//2)/n)
Problem p02693 (python)

Fixed submission:
K = int(input())
A,B = map(int,input().split())
i=1
while i<=B:
  if K*i>=A and K*i<=B:
    print("OK")
    break
  else:
    i += 1
if i == B+1:
  print("NG")

Buggy submission (verdict: Runtime Error):
A,B,N = map(int,input().split())
x = min(N, B-1)
a = A*x//B - A*(x//B)
print(a)

Buggy submission (verdict: Runtime Error):
A,B,N = map(int,input().split())
x = 0
a = 0
while x <= B-1:
  if x%B != 0 and a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)

Buggy submission (verdict: Runtime Error):
A,B,N = map(int,input().split())
x = N
a = 0
while x>999*N//1000:
  if x%B != 0 and a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)
Problem p02711 (python)

Fixed submission:
N = input()
# N = N[0]
# N = np.array(list(map(int, input().split())))
# print(N, K)
# print(N)
 
if (N[0] == "7") or (N[1] == "7") or (N[2] == "7"):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys, os, time, math
import numpy as np
import pandas as pd

 
# print("Start")
N = list(map(str, input().split()))
N = N[0]
# N = np.array(list(map(int, input().split())))
# print(N, K)
# print(N)
 
if (N[0] == "7") or (N[1] == "7") or (N[2] == "7"):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys, os, time, math
import numpy as np
import pandas as pd

import sys, os, time, math
import numpy as np
import pandas as pd
 
 
# print("Start")
N = list(map(str, input().split()))
N = N[0]
# N = np.array(list(map(int, input().split())))
# print(N, K)
# print(N)
 
if (N[0] == "7") or (N[1] == "7") or (N[2] == "7"):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys, os, time, math
import numpy as np
import pandas as pd

import sys, os, time, math
import numpy as np
import pandas as pd
 
 
# print("Start")
N = list(map(str, input().split()))
# N = np.array(list(map(int, input().split())))
# print(N, K)
# print(N)
 
if (N[0][0] == "7") or (N[0][1] == "7") or (N[0][2] == "7"):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys, os, time, math
import numpy as np
import pandas as pd


print("Start")
N = list(map(str, input().split()))
# N = np.array(list(map(int, input().split())))
# print(N, K)
print(N)

if (N[0][0] == "7") or (N[0][1] == "7") or (N[0][2] == "7"):
    print("Yes")
else:
    print("No")
Problem p03036 (python)

Fixed submission:
r, D, x = list(map(int, input().split()))
for i in range(10):
  x = r*x-D
  print(x)

Buggy submission (verdict: Runtime Error):
r, d, x = list(map(int, input().split()))
for i in range(10):
  x = r*x-D
  print(x)

Buggy submission (verdict: Runtime Error):
r, d, x = map(int, input().split())
for i in range(10):
  x = r*x-D
  print(x)
Problem p03242 (python)

Fixed submission:
word1 = list(input())
word2 = ""
for c in word1:
    if c == "9":
        word2 += "1"
    elif c == "1":
        word2 += "9"
    else:
        word2 += c
print(word2)

Buggy submission (verdict: Runtime Error):
word1 = list(input())
word2 = ""
for c in word1:
    if c == "9":
        word2 += "1"
    else if c == "1":
        word2 += "9"
    else:
        word2 += c
print(word2)

Buggy submission (verdict: Runtime Error):
word1 = input()
word2 = ""
for c in word1:
    if c == "9":
        word2 += "1"
    else if c == "1":
        word2 += "9"
    else:
        word2 += c
print(word2)
Problem p02688 (python)

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

susuke = [1] * N

for i in range(K):
  di = int(input())
  ai = map(int, input().split())
  for j in ai:
    susuke[j - 1] = 0
    
print(sum(susuke))

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

susuke = [1] * N

for i in range(K):
  di = int(input())
  ai = map(int, input().split())
  for j in range(ai):
    susuke[j - 1] = 0
    
print(sum(susuke))

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

susuke = [1] * N

for i in range(K):
  di = int(input())
  ai = map(int, input().split())
  for j in range(ai):
    susuke[j - 1] = 0
    
print(sum(susuke))
Problem p02711 (python)

Fixed submission:
N = input()
if '7' in N:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if '7' in N:
  print("Yes")
else:
  print("No")
Problem p02689 (python)

Fixed submission:
import collections
num_list = [int(i) for i in input().split()]
height_list = [int(i) for i in input().split()]
way_list = list(list(map(int, input().split())) for i in range(num_list[1]))

tower_list = [i for i in range(1, num_list[0]+1)]
gd_dict = dict(zip(tower_list, ['good' for i in range((len(tower_list)))]))

def change_to_bad(target_list):
    if height_list[target_list[0]-1] > height_list[target_list[1]-1]:
        gd_dict[target_list[1]] = 'bad'
    elif height_list[target_list[0]-1] == height_list[target_list[1]-1]:
        gd_dict[target_list[0]] = 'bad'
        gd_dict[target_list[1]] = 'bad'
    else:
        gd_dict[target_list[0]] = 'bad'

for i in way_list:
    change_to_bad(i)

good_val = collections.Counter(gd_dict.values())['good']

print(good_val)

Buggy submission (verdict: Runtime Error):
import collections
num_list = [int(i) for i in input().split()]
height_list = [int(i) for i in input().split()]
way_list = list(list(map(int, input().split())) for i in range(num_list[1]))

tower_list = [i for i in range(1, num_list[0]+1)]
gd_dict = dict(zip(tower_list, ['good' for i in range(10**5)]))

def change_to_bad(target_list):
    if height_list[target_list[0]] > height_list[target_list[1]]:
        gd_dict[target_list[1]] = 'bad'
    elif height_list[target_list[0]] == height_list[target_list[1]]:
        gd_dict[target_list[0]] = 'bad'
        gd_dict[target_list[1]] = 'bad'
    else:
        gd_dict[target_list[0]] = 'bad'

for i in way_list:
    change_to_bad(i)

good_val = collections.Counter(gd_dict.values())['good']

good_val
Problem p02836 (python)

Fixed submission:
words = input()

if len(words)%2 == 0:
    slice_cnt = len(words)//2
    words_cut = [words[:slice_cnt], words[slice_cnt:][::-1]]
    
    set_list = list(map(len, [set([words_cut[0][i], words_cut[1][i]]) for i in range(slice_cnt)]))
    print(set_list.count(2))
    
else:
    slice_cnt = (len(words) -1)//2
    words_cut = [words[:slice_cnt], words[slice_cnt+1:][::-1]]
    
    set_list = list(map(len, [set([words_cut[0][i], words_cut[1][i]]) for i in range(slice_cnt)]))
    print(set_list.count(2))

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

if len(words)%2 == 0:
    slice_cnt = len(words)//2
    words_cut = [words[:slice_cnt], words[slice_cnt:][::-1]]
    
    set_list = [*map(len, [set([words_cut[0][i], words_cut[1][i]]) for i in range(slice_cnt)])]
    print(set_list.count(2))
    
else:
    slice_cnt = (len(words) -1)//2
    words_cut = [words[:slice_cnt], words[slice_cnt+1:][::-1]]
    
    set_list = [*map(len, [set([words_cut[0][i], words_cut[1][i]]) for i in range(slice_cnt)])]
    print(set_list.count(2))
Problem p02879 (python)

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

if (1 <= number[0] <= 9) and (1 <= number[1] <= 9):
    print(number[0] * number[1])
else:
    print(-1)

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

if (1 <= number[0] <= 9) and (1 <= number[1] <= 9):
    print(a*b)
else:
    print(-1)
Problem p02916 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = sum(b)
for i in range(n-1):
    if a[i+1] - a[i] == 1:
        add = a[i]
        ans += c[add-1]
    else:
        pass
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = sum(b)
for i in range(n-1):
    if a[i+1] - a[i] == 1:
        add = a[i-1]
        ans += c[add]
    else:
        pass
print(ans)
Problem p02682 (python)

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

ans = 0
if(k <= a):
    print(k)
elif(k <= a + b):
    print(a)
else:
    ans = k - (a + b)
    print(a - ans)

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

ans = 0
if(k <= a):
    print(k)
elif(k <= a + b):
    print(a)
else:
    ans = k - (a + b)
        print(a - ans)
Problem p02693 (python)

Fixed submission:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
    if i%k==0:
        print("OK")
        break
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
import math
a,b,n=map(int,input().split())
ma=-1
ans=a*n
print(math.floor(ans/b))
Problem p02777 (python)

Fixed submission:
s,t=input().split(' ')
a,b=map(int,input().split())
u=input()
if u==s:
    a=a-1
if u==t:
    b=b-1
print(str(a)+' '+str(b))

Buggy submission (verdict: Runtime Error):
s,t=input().split(' ')
a,b=map(int,input().split())
u=input()
if u==s:
  a=a-1
if u==t:
  b=b-1
print(a+' '+b)

Buggy submission (verdict: Runtime Error):
s,t=input().split()
a,b=map(int,iinput().split())
u=input()
if u==s:
  a=a-1
if u==t:
  b=b-1
print(a+' '+b)

Buggy submission (verdict: Runtime Error):

s,t=input().split()
a,b=map(int,iinput().split())
u=input()
if u==s:
  a=a-1
if u==t:
  b=b-1
print(a,b)
Problem p02779 (python)

Fixed submission:
#from collections import Counter
n=int(input())
arr=list(map(int,input().split()))
di={}
for i in arr:
  if i in di:
    print("NO")
    break
  else:
    di[i]=1
else:
  print("YES")

Buggy submission (verdict: Runtime Error):
from collections import Counter

n=int(input())

arr=list(map(int,input().split()))

cc=Counter(arr)
for k,v in cc.items():
  if v>1:
    print("NO")
    break
else:
print("NO")
Problem p02781 (python)

Fixed submission:
N = int(input())
K = int(input())

strN = str(N)
maxD = len(strN)

dp = [[[0]*(K+1) for j in range(2)] for i in range(maxD+1)]
dp[0][0][0] = 1
for d, Nd in enumerate(strN):
    Nd = int(Nd)
    for isLeN in range(2):
        for m in range(K+1):
            x = 0
            if not isLeN and x > Nd: continue
            isLeN2 = isLeN or x < Nd
            dp[d+1][isLeN2][m] += dp[d][isLeN][m]
            for x in range(1, 10):
                if not isLeN and x > Nd: continue
                isLeN2 = isLeN or x < Nd
                m2 = m+1
                if m2 > K: continue
                dp[d+1][isLeN2][m2] += dp[d][isLeN][m]
#    print(d+1, Nd, dp[d+1])

#print(dp[-1])
print(dp[-1][0][K]+dp[-1][1][K])

Buggy submission (verdict: Runtime Error):
n=int(input())
k=int(input())
count=0
for i in range(10**(k-1),n+1):
  s=str(i)
  n=len(s)
  if n-s.count('0')==k:
    count+=1
print(count)
Problem p02829 (python)

Fixed submission:
A=int(input())
B=int(input())
if A+B==3:
  print(3)
elif A+B==4:
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N=int(input())
A,B=map(str,input().split())
S=[]
for i in range(N)
    S.append(A[i])
    S.append(B[i])
print(S)
Problem p02879 (python)

Fixed submission:
A,B=map(int,input().split())
 
if ( A < 10 and B < 10 ):
  print ( A * B )
else:
  print ( -1 )

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

if ( A < 10 and B < 10 ):
  print ( A * B )
else:
  print ( -1 ):
Problem p02897 (python)

Fixed submission:
N=int(input())
if N%2==0:
  print(1/2)
else:
  print(((N-1)/2+1)/N)

Buggy submission (verdict: Runtime Error):
N=input()
if N%2=0:
  print(1/2)
else:
  print(((N-1)/2+1)/N)
Problem p02933 (python)

Fixed submission:
a = int ( input() )
s = input()
 
if a >= 3200 :
  print( s )
else:
  print( 'red' )

Buggy submission (verdict: Runtime Error):
a = input(int())
s = input()
 
if a >= 3200 :
  print( s )
else:
  print( 'red' )

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

if a >= 3200 :
  print( 'red' )
else:
  print( s )