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

Fixed submission:
a = input()
b = input()
list1 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],
["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],
["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]
list2 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],
["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],
["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]
for i in range(len(a)):
    for j in range(26):
        if a[i] == list1[j][0]:
            list1[j][1] += 1
            break
for i in range(len(b)):
    for j in range(26):
        if b[i] == list2[j][0]:
            list2[j][1] += 1
            break
list3 = [list1[i][1] for i in range(26)]
list3.sort()
list4 = [list2[i][1] for i in range(26)]
list4.sort()
flag = True
for i in range(26):
    if int(list3[i]) != int(list4[i]):
        flag = False
if flag:print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
list1 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],
["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],
["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]
list2 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],
["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],
["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]
for i in range(len(a)):
    for j in range(26):
        if a[i] == list1[j][0]:
            list1[j][1] += 1
            break
for i in range(len(b)):
    for j in range(26):
        if b[i] == list2[j][0]:
            list2[j][1] += 1
            break
list3 = [list1[i][1] for i in range(26)]
list3.sort()
list4 = [list2[i][1] for i in range(26)]
list4.sort()
flag = True
for i in range(26):
    if list3[i] != list[4]:
        flag = False
if flag:print("Yes")
else:print("No")
Problem p03272 (python)

Fixed submission:
N,i = list(map(int,input().split()))
print(N-i+1)

Buggy submission (verdict: Runtime Error):
N.i = list(map(int,input().split()))
print(N-i+1)
Problem p03345 (python)

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

if abs(d) < 10**18:
 print (d)
else:
 print('Unfair')

Buggy submission (verdict: Runtime Error):
n = int(input())
seq = []
for i in range(n):
 k=int(input())
 seq.append(k)
i=0
count =0
while i<n:
 k=i+1
 while k<n:
     if seq[k]-seq[i]==k-i:
         count = count + 1
     k=k+1
 i=i+1

print(n-count)
Problem p03242 (python)

Fixed submission:
s = list(input())
ans = ''
for i in range(len(s)):
    if s[i] == '1':
        ans += '9'
    elif s[i] == '9':
        ans += '1'
    else:
        ans += s[i]
print(ans)

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

n = int(input())
v = list(map(int, input().split(' ')))

v1 = v[::2]
v2 = v[1::2]

counter = Counter(v1)
x1 = counter.most_common()[0][0]
counter = Counter(v2)
x2 = counter.most_common()[0][0]

x1_count = v1.count(x1)
x2_count = v2.count(x2)

n = n//2
ans = (n - x1_count) + (n - x2_count)
print(ans)
Problem p03767 (python)

Fixed submission:
import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

n = ni()

a = nil()
a.sort()
ans = 0

for i in range(n):
    ans += a[(-i*2) - 2]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

n = ni()

a = nil()

a.sort()

ans = 0

for i in range(n):
    ans += a[-2-i*n]
print(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())
print(N-i+1)
Problem p03315 (python)

Fixed submission:
s = input()
ans = 0
for n in s:
    if n == '+': ans += 1
    else: ans -= 1
print(ans)

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

s = sum([int(i) for i in n])

if int(n)%s==0:
    print('Yes')
else:
    print('No')

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

s = sum((int(i) for i in n))

if int(n)%s==0:
    print('Yes')
else:
    print('No')

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

s = sum((int(i) for i in n))

if int(n)%s==0:
    print('Yes')
else:
    print('No')
Problem p03803 (python)

Fixed submission:
#54a
a,b =map(int,input().split())
if a==b:
    print('Draw')
elif a==1 :
    print('Alice')
elif b==1:
    print('Bob') 
elif a>b:
    print('Alice')
else :
    print('Bob')

Buggy submission (verdict: Runtime Error):
#54b
n,m =map(int,input().split())
a=[input() for _ in range(n)]
b=[input() for _ in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        t = [k[j:j+m] for k in a[i:i+m]]
        if t==b:
            print('Yes')
            exit()
print('No')
Problem p03272 (python)

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

Buggy submission (verdict: Runtime Error):
x = int(input())
y = int(input())
if x == y:
    print(y)
else:
    print(y - x + 1)
Problem p03250 (python)

Fixed submission:
a, b, c = map(int, input().split())
x = a*10 + b + c
y = b*10+ c + a
z = c*10+ a + b
print(max([x, y,z]))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
x =a*10 + b
y = b*10+ c
print([x, y][if x < y])

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
x =a*10 + b
y = b*10+ c
print([x, y] if x < y)
Problem p03315 (python)

Fixed submission:
s = raw_input()
ans = 0
for i in range(0, 4):
	if s[i] == '+': ans = ans + 1
	else: ans = ans - 1

print ans

Buggy submission (verdict: Runtime Error):
s = raw_input()
ans = 0
for i in range(0, 4):
	if s[i] = '+': ans = ans + 1
	else: ans = ans - 1

print ans
Problem p03804 (python)

Fixed submission:
def judge(a, b, y, x, m):
	for i in range(0, m):
		for j in range(0, m):
			if a[y+i][x+j] != b[i][j]: return False
	return True

N, M = map(int, raw_input().split())
A = []
B = []
for i in range(0, N):
	A.append(raw_input())
for i in range(0, M):
	B.append(raw_input())

ans = 'No'
for i in range(0, N-M+1):
	for j in range(0, N-M+1):
		if judge(A, B, i, j, M):
			ans = 'Yes'
			break

print ans

Buggy submission (verdict: Runtime Error):
def judge(a, b, y, x, m):
	for i in range(0, m):
		for j in range(0, m):
			if a[y+i][x+j] != b[y][x]: return False
	return True

N, M = map(int, raw_input().split())
A = []
B = []
for i in range(0, N):
	A.append(raw_input())
for i in range(0, M):
	B.append(raw_input())

ans = 'No'
for i in range(0, N-M+1):
	for j in range(0, N-M+1):
		if judge(A, B, i, j, M):
			ans = 'Yes'
			break

print ans

Buggy submission (verdict: Runtime Error):
def judge(a, b, y, x, m):
	for i in range(0, m):
		for j in range(0, m):
			if a[y+i][x+j] != b[y+i][x+j]: return False
	return True

N, M = map(int, raw_input().split())
A = []
B = []
for i in range(0, N):
	A.append(raw_input())
for i in range(0, M):
	B.append(raw_input())

ans = 'No'
for i in range(0, N-M+1):
	for j in range(0, N-M+1):
		if judge(A, B, i, j, M):
			ans = 'Yes'
			break

print ans
Problem p03775 (python)

Fixed submission:
# -*- coding:utf-8 -*-
import math
N = int(input())
print(min(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))+1) if N%B == 0])))))

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
import math
N = int(input())
a = list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))
a.sort()
print(min(a))

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
import math
N = int(input())
print(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))).pop(0))
Problem p03265 (python)

Fixed submission:
x1,y1,x2,y2 = map(int,input().split())
h = abs(x2-x1)
v = abs(y2-y1)
if x1 > x2:
  if y1 > y2: print(x2+v,y2-h,x1+v,y1-h)
  else:         print(x2-v,y2-h,x1-v,y1-h)
else:
  if y2 > y1: print(x2-v,y2+h,x1-v,y1+h)
  else:         print(x2+v,y2+h,x1+v,y1+h)

Buggy submission (verdict: Runtime Error):
x1,y1,x2,y2 = map(int,int(input().split())
h = max(abs(x2-x1),abs(y2-y1))
v = min(abs(x2-x1),abs(y2-y1))
if x1 > x2:
  if y1 > y2: print(x2+h,y2-v,x1+h,y1-v)
  else:print(x2-v,y2-h,x1-v,y1-h)
else:
  if y1 > y2: print(x2+v,y2+h,x1+v,y1+h)
  else:print(x2-h,y2+v,x1-h,y1+v)
Problem p03745 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]

count = 1
state = 'none'
b = [a[0]]

for i in range(1,n):
    if state=='none':
        before=b.pop()
        now = a[i]
        if before<now:
            b.append(now)
            state='incr'
        elif before>now:
            b.append(now)
            state='decr'
        else:
            b.append(now)
    elif state=='incr':
        before=b.pop()
        now = a[i]
        if before<=now:
            b.append(now)
        else:
            b=[now]
            state='none'
            count+=1
    elif state=='decr':
        before=b.pop()
        now = a[i]
        if before>=now:
            b.append(now)
        else:
            b=[now]
            state='none'
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

count = 1
state = 'none'
b = [a[0]]

for i in range(1,n):
    if state=='none':
        before=b.pop()
        now = a[i]
        if before<now:
            b.append(now)
            state='incr'
        elif before>now:
            b.append(now)
            state='decr'
        else:
            b.append(now)
    elif state=='incr':
        before=b.pop()
        now = a[i]
        if before<=now:
            b.append(now)
        else:
            b=[now]
            state='none'
            count+=1
    elif state=='decr':
        before=b.pop()
        now = a[i]
        if before=>now:
            b.append(now)
        else:
            b=[now]
            state='none'
            count+=1
print(count)
Problem p03315 (python)

Fixed submission:
s = raw_input()
n = 0
for c in s:
  if c == '+':
    n += 1
  else:
    n -= 1
print n

Buggy submission (verdict: Runtime Error):
def cal(n):
  ans = 0
  while n != 0:
    ans += n % 10
    n /= 10
  return ans

n = int(raw_input())
if n % cal(n) == 0:
  print "Yes"
else:
  print "No"
Problem p03327 (python)

Fixed submission:
if int(raw_input()) >= 1000:
  print 'ABD'
else:
  print 'ABC'

Buggy submission (verdict: Runtime Error):
if int(raw_iniput()) >= 1000:
  print 'ABD'
else:
  print 'ABC'
Problem p03315 (python)

Fixed submission:
kazu = 0
S = input()
for s in S:
    if s=='+':
        kazu += 1
    else:
        kazu -= 1
        
print(kazu)

Buggy submission (verdict: Runtime Error):
count = 0
N,K = map(int,input().split( ))
J = list(map(int,input().split( )))
for i,j in zip(range(N),J):
    if j==1:
        s = i
        t = N-1-i
for _ in range(N+N):
    if s<=0:
        break
    else:
        s -= K-1
        count += 1

for _ in range(N+N):
    if t<=0:
        break
    else:
        t -= K-1
        count += 1
        
if N<=K:
    count = 1
print(count)
Problem p03327 (python)

Fixed submission:
x = int(input())

if x > 999:
    print('ABD')
    
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split( )))
z = x[1]-x[0]
t = 0
for s in range(z+2):
    t += s
    
print(t-x[1])
Problem p03272 (python)

Fixed submission:
n, i = list(map(int, input().split()))
print(n - i + 1 )

Buggy submission (verdict: Runtime Error):
N, i = list(map(int, input().split()))
print(n + 1 - i)

Buggy submission (verdict: Runtime Error):
N , i = list(map(int, input().split()))
print(n + 1 - i)

Buggy submission (verdict: Runtime Error):
N , i = list(map(int, input().split()))
print(n + 1 -i)

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())
print(N - i + 1)
Problem p03250 (python)

Fixed submission:
array = list(map(int, input().strip().split()))
array.sort(reverse = True)
A = 10 * array[0] + array[1] + array[2]
print(A)

Buggy submission (verdict: Runtime Error):

array = list(map(int, input().strip().split()))
#array.sort(reverse = True)
N = array[0]
M = array[1]
X = array[2]
Y = array[3]

xarray = list(map(int, input().strip().split()))
xarray.sort(reverse = True)
##print(xarray)
xmax = xarray[0]

yarray = list(map(int, input().strip().split()))
yarray.sort()
##print(yarray)
ymin = yarray[0]
if (ymin > xmax):
    if((abs(ymin) - abs(xmax)) >= 1):
        print("No War")
    else:
        print("War")
else:
    print("War")

##print(array)
Problem p03250 (python)

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

ans=l[0]+l[1]+10*l[2]

print(ans)

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

ans=l[0]+l[1]+10*l[2]

print(ans)
Problem p03315 (python)

Fixed submission:
l=list(input())
c=4
for i in l:
    if i=="-":
        c-=2

print(c)

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

c=0
for i in tmp:
    c+=int(i)

if N%c==0:
    print("Yes")
else:
    print("No")
Problem p03250 (python)

Fixed submission:
input_data = [int(i) for i in input().split(" ")]

ans = 0
for k1, v1 in enumerate(input_data):
    for k2, v2 in enumerate(input_data):
        for k3, v3 in enumerate(input_data):
            if k1 == k2 or k2 == k3 or k3 == k1:
                continue
            kou1 = int(str(v1) + str(v2))
            kou2 = v3
            if ans < kou1 + kou2:
                ans = kou1 + v3
print(ans)

Buggy submission (verdict: Runtime Error):

s = input()
t = input()

[globals().update({'s': s.translate(str.maketrans({s[i]: t[i], t[i]: s[i]}))}) for i in range(len(s))]

print("Yes" if s == t else "No")

Buggy submission (verdict: Runtime Error):
n, m, x, y = [int(i) for i in input().split(" ")]
x_range = [int(i) for i in input().split(" ")]
y_range = [int(i) for i in input().split(" ")]
war = True
for z in range(x, y):
    if x < z <= y and max(x_range) < z <= min(y_range[:m]):
        war = False
print("War" if war else "No War")

Buggy submission (verdict: Runtime Error):
input_data = [int(i) for i in input().split(" ")]

ans = 0
for k1, v1 in enumerate(input_data):
    for k2, v2 in enumerate(input_data):
        for k3, v3 in enumerate(input_data):
            if k1 == k2 or k2 == k3 or k3 == k1:
                continue
            kou1 = int(f"{v1}{v2}")
            if ans < kou1 + v3:
                ans = kou1 + v3
print(ans)
Problem p03315 (python)

Fixed submission:
S=list(input())

A=0
for i in range(4):
    if S[i]=="+":
        A=A+1
    elif S[i]=="-":
        A=A-1
    
print(A)

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

A=0
for i in range(N):
    if S[i]=="+":
        A=A+1
    elif S[i]=="-":
        A=A-1
    else:
        pass

print(A)

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

A=0
for i in range(N):
    if S[i]=="+":
        A=A+1
    elif S[i]=="-":
        A=A-1
    else:
        pass

print(A)

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

A=0
for i in range(N):
    if S[i]=="+":
        A=A+1
    elif S[i]=="-":
        A=A-1
    else:
        pass

print(A)

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

A=0
for i in range(N):
    if S[i]=="+":
        A=A+1
    else:
        A=A-1

print(A)
Problem p03315 (python)

Fixed submission:
s = input()
c = 0
for i in s:
    if i == "+":
        c += 1
    else:
        c -= 1
print(c)

Buggy submission (verdict: Runtime Error):
s = input()
c = 0
for i in s:
    if i == +:
        c += 1
    else:
        c -= 1
print(c)
Problem p03775 (python)

Fixed submission:
import math
n = int(input())
ans = []
for i in range(1, int(math.sqrt(n))+2):
    if n % i == 0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

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

i = 2
table = []
while i * i <= n:
    while n % i == 0:
        n //= i
        table.append(i)
    i += 1
if n > 1:
    table.append(n)

temp = []
for i in range(len(table)):
    temp += list(itertools.permutations(table, i))
ans = []
for i in temp:
    s = 1
    for j in i:
        s *= j
    a, b = s, n2//s
    ans.append(max(len(str(a)), len(str(b))))
print(min(ans))
Problem p03804 (python)

Fixed submission:
N, M = map(int, input().split())
A_list = []
B_list = []
for _ in range(N):
    A_list.append(list(input()))
for _ in range(M):
    B_list.append(list(input()))
    

whole_flag = 0
for i in range(N-M+1):
    for j in range(N-M+1):
        flag = 0
        for k in range(M):
            if B_list[k] == A_list[i+k][j:j+M]:
                flag += 1
            else:
                pass
        if flag == M:
            whole_flag += 1
            
if whole_flag == 0:
    print("No")
else:
    print("Yes")

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

for _ in range(N):
    A_list.append(list(input()))
for _ in range(M):
    B_list.append(list(input()))
  
match_list =[]
for i in range(N-M+1):
    for j in range(N-M+1):
        if B_list[0] == A_list[i][j:(j+M)]:
            match_list.append([i, j])
        else:
            pass

whole_flag = 0
for k in match_list:
    flag =0
    for l in range(M):
        if A_list[k[0]+l][k[1]:k[1]+M] ==B_list[k[0]+l]:
            flag += 1
        else:
            break
            
    if flag == M:
        print("Yes")
        whole_flag += 1
        
if whole_flag == 0:
    print("No")

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

for _ in range(N):
    A_list.append(list(input()))
for _ in range(M):
    B_list.append(list(input()))
  
match_list =[]
for i in range(N-M+1):
    for j in range(N-M+1):
        if B_list[0] == A_list[i][j:(j+M)]:
            match_list.append([i, j])
        else:
            pass

flag =0
for k in match_list:
    flag =0
    for l in range(M):
        if A_list[k[0]+l][k[1]:k[1]+M] ==B_list[k[0]+l]:
            flag += 1
        else:
            break
    
    if flag == M:
        print("Yes")
        break
    
    if flag == M:
        print("Yes")
        break

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

for _ in range(N):
    A_list.append(list(input()))
for _ in range(M):
    B_list.append(list(input()))
  
match_list =[]
for i in range(N-M+1):
    for j in range(N-M+1):
        if B_list[0] == A_list[i][j:(j+M)]:
            match_list.append([i, j])
        else:
            pass

flag =0
for k in match_list:
    flag =0
    for l in range(M):
        print(A_list[k[0]+l][k[1]:k[1]+M])
        print(B_list[k[0]+l])
        
        if A_list[k[0]+l][k[1]:k[1]+M] ==B_list[k[0]+l]:
            flag += 1
        else:
            break
    
    if flag == M:
        print("Yes")
        break
Problem p03250 (python)

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

max = max([a, b, c])
print(max * 10 + a + b + c - max)

Buggy submission (verdict: Runtime Error):

Copy
S = input()
T = input()
 
S_list = []
T_list = []
alpha = "abcdefghijklmnopqrstuvwxyz"
 
for i in alpha:
    SS = S.count(i)
    TT = T.count(i)
    if SS and TT> 0:
        S_list.append(SS)
        T_list.append(TT)
 
if sorted(S_list) != sorted(T_list):
    print('No')
else:
    print('Yes')
Problem p03252 (python)

Fixed submission:
S = input()
T = input()

S_list = []
T_list = []
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in alpha:
    SS = S.count(i)
    TT = T.count(i)
    if SS > 0:
        S_list.append(SS)
    if TT > 0:
        T_list.append(TT)

if sorted(S_list) != sorted(T_list):
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):

----:---F1  *scratch*      All L1     (Fundamental)-----------------------------
Loading subst-jis...done
S = input()
T = input()

S_list = []
T_list = []
print(S_list)
print(T_list)
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in alpha:
    SS = S.count(i)
    TT = T.count(i)
    if SS and TT > 0:
        S_list.append(SS)
        T_list.append(TT)

if sorted(S_list) != sorted(T_list):
    print('No')
else:
    print('Yes')
Problem p03345 (python)

Fixed submission:
A,B,C,K=map(int,input().split());print((A-B)*(-1)**K)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
ans = A - B
if abs(ans) > 10**18: ans = "Unfair"
print(ans)
Problem p03745 (python)

Fixed submission:
import numpy as np

n = int(input())
a = list(map(int,input().split()))

cnt = 1
direct = 0
temp = a[0]
for i in range(1,n):
    dif = a[i] - temp
    if dif != 0:
        if direct == 0:
            direct = np.sign(dif)
            
        elif np.sign(a[i] - temp) != direct:
            cnt+=1
            direct = 0
    temp = a[i]
print(cnt)

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

flg = int(a[1]>a[0])
skp = 1
cnt = 1
temp = a[0]
for i in range(1,n):
    dif = a[i] - temp
    direct = int(dif>0)
    if dif != 0:
        if skp:
            flg = direct
            skp = 0
            
        elif direct != flg and skp==0:
            flg = direct
            cnt+=1
            skp = 1
    temp = a[i]
print(cnt)

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

n = int(input())
a = list(map(int,input().split()))

flg = np.sign(a[1] - a[0])
skp = 1
cnt = 1
temp = a[0]
for i in range(1,n):
    dif = a[i] - temp
    direct = np.sign(dif)
    if dif != 0:
        if skp:
            flg = direct
            skp = 0
            continue
            
        elif direct != flg:
            flg = direct
            cnt+=1
            skp = 1
    temp = a[i]
print(cnt)

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

n = int(input())
a = list(map(int,input().split()))

flg = np.sign(a[1] - a[0])
skp = 1
cnt = 1
temp = a[0]
for i in range(1,n):
    dif = a[i] - temp
    direct = np.sign(dif)
    if dif != 0:
        if skp:
            flg = direct
            skp = 0
            
        elif direct != flg:
            flg = direct
            cnt+=1
            skp = 1
    temp = a[i]
print(cnt)
Problem p03242 (python)

Fixed submission:

def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=raw_input()
num1="".join(map(replace,num))
print(int(num1))

Buggy submission (verdict: Runtime Error):
import sys

def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=sys.argv[1]
num1="".join(map(replace,num))
print(int(num1))

Buggy submission (verdict: Runtime Error):
import sys

def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=sys.argv[1]
num1="".join(map(replace,num))
print(num1)

Buggy submission (verdict: Runtime Error):
import sys

def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=sys.argv[1]
num1="".join(map(replace,num))
print(num1)
Problem p03242 (python)

Fixed submission:
N=int(input())
print(1110-N)

Buggy submission (verdict: Runtime Error):
N=int(input())
	print(1110-N)
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 p03307 (python)

Fixed submission:
N=int(input())
if N%2==1:
	print(2*N)
else:
	print(N)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==1:
print(2*N)
else:
print(N)