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

Fixed submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if(m1 == m2):
    print('0')
    exit()
print('1')

Buggy submission (verdict: Runtime Error):
m1, d1 = map(int, input().split)
m2, d2 = map(int, input().split)

if(m1 == m2):
    print('0')
    exit()
print('1')
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
s = [input() for i in range(h)]
up = down = right = left = '.'
for x in range(h):
    for y in range(w):
        if(list(s[x])[y] == '#'):
            if(y != w-1):
                right = list(s[x])[y+1]
            if(x != h-1):
                down = list(s[x+1])[y]
            if(x != 0):
                up = list(s[x-1])[y]
            if(y != 0):
                left = list(s[x])[y-1]
            if(up != '#' and down != '#' and right != '#' and left != '#'):
                print("No")
                exit()
            up = down = right = left = '.'
print("Yes")

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
for x in range(h):
    for y in range(w):
        if(s[x][y] == '#'):
            up = s[max(0, x-1)][y]
            down = s[min(h-1, x+1)][y]
            right = s[x][max(0, y-1)]
            left = s[x][max(w-1,  y+1)]
            if(up == '.' and down == '.' and right == '.' and left == '.'):
                print("No")
                exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
for x in range(h):
    for y in range(w):
        if(s[x][y] == '#'):
            up = s[max(0, x-1)][y]
            down = s[min(x+1, h-1)][y]
            right = s[x][max(0, y-1)]
            left = s[x][max(y+1, w-1)]
            if(up == '.' and down == '.' and right == '.' and left == '.'):
                print("No")
                exit()
print("Yes")
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
if s == t[:-1] :
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
input_line = input().split()
a = int(input_line[0])
b = int(input_line[1])
c = int(input_line[2])
k = int(input_line[3])

def return_answer(a,b,c,k):
    answer = 0
    if a < k:
        answer += a
        count = k - a

        if b < k:
            count -= b
            answer -= count

    elif a >= k:
        answer = k

    return answer

print(return_answer(a,b,c,k))
Problem p02713 (python)

Fixed submission:
K=int(input())
def gcd(a,b):
    res=0
    while b!=0:
        res=a%b
        a=b
        b=res
    return a

ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            t=gcd(i,gcd(j,k))
            ans+=t
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)
ans=0
for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      t=gcd(i,gcd(j,k))
      ans+=t
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
def gcd(a,b):
  if b==0:
    return a
  return gcd(b,a%b)
ans=0
for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      ans+=gcd(i,gcd(j,k))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
def gcd(a,b):
  if b==0:
    return a
  return gcd(b,a%b)
ans=0
for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      ans+=gcd(i,gdc(j,k))
print(ans)
Problem p02848 (python)

Fixed submission:
A=[chr(i) for i in range(65, 65+26)]
N=int(input())
S=str(input())
T=[]
U=str()

for i in range(len(S)):
  k=(A.index(S[i])+N)%26
  T.append(A[k])
  U=U+str(T[i])
  
print(U)

Buggy submission (verdict: Runtime Error):
A=[chr(i) for i in range(65, 65+26)]
N=int(input())
S=str(input())

for i in range(len(S)):
  k=(A.index(S[i])+N)%26
  S[i]=S[k]
  
print(S)
Problem p02909 (python)

Fixed submission:
S = input()
if S == 'Sunny':
  print ('Cloudy')
elif S == 'Cloudy':
  print ('Rainy')
else:
  print ('Sunny')

Buggy submission (verdict: Runtime Error):
S = input()
if S = 'Sunny':
  print ('Cloudy')
elif S = 'Cloudy':
  print ('Rainy')
else:
  print ('Sunny')
Problem p02945 (python)

Fixed submission:
A,B = map(int,input().split())
x = A+B
y = A-B
z = A*B
print( max(x,y,z) )

Buggy submission (verdict: Runtime Error):
A,B = =map(int,input().split())
x = A+B
y = A-B
z = A*B
print( max(x,y,z) )
Problem p02957 (python)

Fixed submission:
A,B=map(int, input().split())
if (A+B)%2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A+B%2 = 0:
  K=(A+B)/2
  print(K)
else:
  print('impossible')

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A+B%2 = 0:
  K=(A+B)/2
  print(K)
else:
  print('impossible')
Problem p02687 (python)

Fixed submission:
S = input()
if S == 'ABC':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
x = int(input())
for a in range(-200,201):
	for b in range(-200,201):
    	if a**5 - b**5 == x:
        	print(a,b,sep= ' ')
          	exit()
Problem p02681 (python)

Fixed submission:
S = input()
T = input()[:-1]

if S == T:
    print("Yes")
else:
    print("No")

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

if A > K:
    print(K)
elif A+B >= K:
    print(A)
else:
    print(A - (K-(A+B)))
Problem p02681 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if(len(S)+1==len(T)):
  print("Yes")
else():
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if(len(S)+1==len(T)):
	print("Yes")
else():
	print("No")

Buggy submission (verdict: Runtime Error):
LenS = len(input())
LenT = len(input())
if(LenS+1==LenT):
	print("Yes")
else():
	print("No")
Problem p02801 (python)

Fixed submission:
print(chr(ord(input())+1))

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

H, W = list(map(int, input().split()))
S = []
for _ in range(H):
    S.append(input())

ret = 0
for i in range(H):
    for j in range(W):
        s = S[i][j]
        queue = deque([(i,j,0)])
        footprint = [(i,j)]
        if s == '#':
            continue
        while True:
            x, y, d = queue.popleft()
            for p in [(x-1, y), (x, y-1), (x, y+1), (x+1, y)]:
                if p[0] >= 0 and p[0] < H and p[1] >=0 and p[1] < W and p not in footprint and S[p[0]][p[1]] != '#':
                        queue.append((p[0], p[1], d+1))
                        footprint.append(p)

            if len(queue) == 0:
                break
        if d > ret:
            ret = d

print(ret)
Problem p02690 (python)

Fixed submission:
x = int(input())


for i in range(-1000,1000):
    s = x + pow(i,5)
    t = pow(s,0.2)
    if(t.imag == 0):
        t = int(t)
        if(pow(t,5) == s):
            print(t,i)
            exit()

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

t = int(x**0.2)

for i in range(x):
    t2 = t + i
    d = x - t2 ** 5
    if(d.imag == 0):
        b = int(d**0.2)
        if(b**5 == d):
            print(t2,-d)
            exit()
    t2 = t - i
    d = x - t2 ** 5
    if(d.imag == 0):
        b = int(d**0.2)
        if(b**5 == d):
            print(t2,-d)
            exit()

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

for i in range(x):
    s = x - i**5
    t = int(s ** 0.2)
    if(s == t**5):
        print(i,-t)
        exit()
Problem p02697 (python)

Fixed submission:
n,m = map(int,input().split())
if(n % 2 == 0):
    d = n // 2 - 1
    c = 0
    i = 1
    while(d > 0):
        print(i,i+d)
        d -= 2
        i += 1
        c += 1
        if(c == m):exit()
    d = n // 2 - 2
    i = n // 2 + 1
    while(d > 0):
        print(i,i+d)
        d -= 2
        i += 1
        c += 1
        if(c == m):exit()


else:
    for i in range(m):
        print(i+1,n-i)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
if(n % 2 == 0):
    d = n // 2 - 1
    c = 0
    i = 1
    while(d >= 0):
        print(i,i+d)
        d -= 2
        i += 1
        c += 1
        if(c == m):exit()
    d = n // 2 - 2
    i = n // 2 + 1
    while(d >= 0):
        print(i,i+d)
        d -= 2
        i += 1
        c += 1
        if(c == m):exit()


else:
    raise ValueError("error!")
    for i in range(m):
        print(i+1,n-i)
Problem p02714 (python)

Fixed submission:
n = int(input())
s = input()
d = [0,0,0]
for i in s:
    if(i == 'R'):d[0] += 1
    elif(i == 'G'):d[1] += 1
    elif(i == 'B'):d[2] += 1
c = d[0] * d[1] * d[2]

for i in range(n):
    for j in range(i+1,n):
        k = 2 * j - i
        if(k >= n):continue
        if(s[i] == s[j]):continue
        if(s[j] == s[k]):continue
        if(s[i] == s[k]):continue
        c -= 1

print(c)

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

r = [0] * n
g = [0] * n
b = [0] * n
dc = {'R':[0]*n,'G':[0]*n,'B':[0]*n}
for i in range(n-1)[::-1]:
    dc['R'][i] = dc['R'][i + 1]
    dc['G'][i] = dc['G'][i + 1]
    dc['B'][i] = dc['B'][i + 1]
    dc[s[i+1]][i] += 1
# print(dc['R'])
# print(dc['G'])
# print(dc['B'])
dcc = {('R','G'):'B',('R','B'):'G',('B','G'):'R',('G','R'):'B',('B','R'):'G',('G','B'):'R'}
if(n <= 3):print(0)
else:
    c = 0
    for i in range(n):
        for j in range(i+1,n):
            if(s[i] == s[j]):continue
            d = j - i
            c += dc[dcc[(s[i],s[j])]][j]
            k = j + d
            if(k < n):
                if(s[k] == dcc[(s[i],s[j])]):c -= 1
print(c)

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

r = [0] * n
g = [0] * n
b = [0] * n
dc = {'R':[0]*n,'G':[0]*n,'B':[0]*n}
for i in range(n-1):
    dc['R'][i] = dc['R'][i + 1]
    dc['G'][i] = dc['G'][i + 1]
    dc['B'][i] = dc['B'][i + 1]
    dc[s[i]] += 1
# print(r)
# print(g)
# print(b)
dcc = {('R','G'):'B',('R','B'):'G',('B','G'):'R',('G','R'):'B',('B','R'):'G',('G','B'):'R'}
if(n <= 3):print(0)
else:
    c = 0
    for i in range(n):
        for j in range(i+1,n):
            if(s[i] == s[j]):continue
            d = j - i
            c += dc[dcc[(s[i],s[j])]][j]
            k = j + d
            if(k < n):
                if(s[k] == dcc[(s[i],s[j])]):c -= 1
print(c)

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

r = [0] * n
g = [0] * n
b = [0] * n
dc = {'R':[0]*n,'G':[0]*n,'B':[0]*n}
for i in range(n):
    dc['R'][i] = s[i+1:].count('R')
    dc['G'][i] = s[i+1:].count('G')
    dc['B'][i] = s[i+1:].count('B')
# print(r)
# print(g)
# print(b)
dcc = {('R','G'):'B',('R','B'):'G',('B','G'):'R',('G','R'):'B',('B','R'):'G',('G','B'):'R'}
if(n <= 3):print(0)
else:
    c = 0
    for i in range(n):
        for j in range(i+1,n):
            if(s[i] == s[j]):continue
            d = j - i
            c += dc[dcc[(s[i],s[j])]][j]
            k = j + d
            if(k < n):
                if(s[k] == dcc[(s[i],s[j])]):c -= 1
print(c)
Problem p02886 (python)

Fixed submission:
n = int(input())

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

s = 0

for i in range(n):
    for j in range(i+1,n):
        s += d[i] * d[j]
print(s)

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

d = map(int,input().split())

s = 0

for i in range(n):
    for j in range(i,n):
        s += d[i] * d[j]
print(s)
Problem p02975 (python)

Fixed submission:
n = int(input())

a = list(map(int,input().split()))
a.sort()
d = {}
for i in range(n):
    if(a[i] not in d):d[a[i]] = 1
    else:d[a[i]] += 1
if(len(d) == 1):
    if(a[0] == 0):
        print('Yes')
        exit()
elif(n%3 == 0):
    if(len(d) == 2):
        if(0 in d):
            if(d[0] == n // 3):
                print('Yes')
                exit()
    elif(len(d) == 3):
        k = list(d.keys())
        if(k[0]^k[1]^k[2] == 0):
            if(d[k[0]] == n // 3 and d[k[1]] == n // 3 and d[k[2]] == n // 3):
                print('Yes')
                exit()
print('No')

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

a = list(map(int,input().split()))
a.sort()
d = {}
for i in range(n):
    if(a[i] not in d):d[a[i]] = 1
    else:d[a[i]] += 1
if(len(d) == 1):
    if(a[0] == 0):
        print('Yes')
        exit()
elif(len(d)%3 == 0):
    if(len(d) == 2):
        if(0 in d):
            if(d[0] == n // 3):
                print('Yes')
                exit()
    elif(len(d) == 3):
        k = d.keys()
        if(k[0]^k[1]^k[2] == 0):
            if(d[k[0]] == n // 3 and d[k[1]] == n // 3 and d[k[2]] == n // 3):
                print('Yes')
                exit()
print('No')
Problem p03035 (python)

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

if(a <= 5):
    print(0)
elif(a <= 12):
    print(b//2)
else:
    print(b)

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

if(a <= 5):
    print(0)
elif(a < 12):
    print(b//2):
else:
    print(b)
Problem p03060 (python)

Fixed submission:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

s = 0
for i in range(n):
    s += max(0,v[i]-c[i])
print(s)

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

s = 0
for i in range(n):
    s += max(0,v-c)
print(s)
Problem p03109 (python)

Fixed submission:
s = int(''.join(input().split('/')))
if(s <= 20190430):print('Heisei')
else:print('TBD')

Buggy submission (verdict: Runtime Error):
s = int(''.join(input.split('/')))
if(s <= 20190430):print('Heisei')
else:print('TBD')
Problem p03150 (python)

Fixed submission:
s = input()
t = 'keyence'
if(s[:7] == t or s[-7:] == t):
    print('YES')
else:
    for i in range(7):
        if(s[:i+1] == t[:i+1] and s[-7+i+1:] == t[-7+i+1:]):
            print('YES')
            exit()
    print('NO')

Buggy submission (verdict: Runtime Error):
s = input()
o = ""
c = 'keyence'
j = 0
l = []
for i in range(len(s)):
    if(s[i] == c[j]):
        j += 1
        l.append(i)
c = 0
l.append(len(s))
for i in range(len(l) - 1):
    if(l[i+1]-l[i] > 1):c += 1
if(c > 1 or len(l) != 8):print('NO')
else:print('YES')
Problem p03196 (python)

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


ans = 1
if(n==1):print(p)
else:

	for i in range(2,int(p**(1./n))+1):
		while(p%(i**n)==0):
			ans*=i
			p//=i**n
	print(ans)

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


ans = 1


for i in range(2,min(int(p**(1./n))+1,int(sqrt(p))+1)):
	while(p%(i**n)==0):
		ans*=i
		p//=i**n
print(ans)
Problem p03231 (python)

Fixed submission:
def gcd(m,n):
    while (m % n != 0):
        n,m = m%n,n
    return(n)

def lcm(m,n):
    return(m * n // gcd(m,n))

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

s = input()
t = input()


g = gcd(m,n)

if(g in [n,m]):
    print(-1)
else:
    x = lcm(m,n)
    a = x // n
    b = x // m
    for i in range(n//b):
        ai = b * i
        bi = a * i
        if(s[ai] != t[bi]):
            print(-1)
            exit()
    print(lcm(m,n))

Buggy submission (verdict: Runtime Error):
def gcd(m,n):
    while (m % n != 0):
        n,m = m%n,n
    return(n)

def lcm(m,n):
    return(m * n // gcd(m,n))

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

s = input()
t = input()


g = gcd(m,n)

if(g in [n,m]):
    print(-1)
else:
    x = lcm(m,n)
    a = x // n
    b = x // m
    for i in range(x//n):
        ai = 1 + a * i
        bi = 1 + b * i
        if(s[ai] != t[bi]):
            print(-1)
            exit()
    print(lcm(m,n))
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
if(k-1 < len(s)):
    for i in range(k):
        if(s[i] != '1'):break
    else:
        print(1)
        exit()
for i in s:
    if(i != '1'):
        print(i)
        exit()

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
if(s[k-1] == '1'):
    print(1)
    exit()
for i in s:
    if(i != '1'):
        print(i)
        exit()
Problem p03289 (python)

Fixed submission:
A=list(input())
n=len(A)
if(A[0]!="A"):print("WA")
elif(A.count("C")!=1):print("WA")
elif(A.index("C")<2 or A.index("C")>n-2):print("WA")
else:
  A.pop(A.index("C"))
  A.pop(0)
  S="".join(A)
  if(S.islower()):print("AC")
  else:print("WA")

Buggy submission (verdict: Runtime Error):
A=list(input())
n=len(A)
if(A[0]!="A"):print("WA")
elif(A.count("C")!=1):print("WA")
elif(A.index("C")<2 or A.index("C")>n-2):print("WA")
else:
  A.pop(A.index("C"))
  A.pop(0)
  if(A.islower()):print("AC")
  else:print("WA")
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if(a>8 or b>8):print(":(")
else:print("Yay!")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>8 or b>8):print(":(")
else:print("Yay!")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>8 or b>8):print(":(")
else:print("Yay!")
Problem p03352 (python)

Fixed submission:
a=int(input())
if(a<4):print(1)
else:
  ma=1
  for i in range(1,int(a**0.5)+1):
    for j in range(2,1000):
      x=i**j
      if(x>a):break
      ma=max(ma,x)
  print(ma)

Buggy submission (verdict: Runtime Error):
a=int(input())
if(a<4):print(1)
else:
  ma=1
  for i in range(1,int(sqrt(a))):
    for j in range(2,1000):
      x=i**j
      if(x>a):break
      ma=max(ma,x)
  print(ma)
Problem p03369 (python)

Fixed submission:
s=input()
v=700
for i in range(3):
  S=s[i]
  if(S=="o"):v+=100
print(v)

Buggy submission (verdict: Runtime Error):
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
      
      	int v = 700;
      	for(int i = 0; i < S.length(); i++){
        if(S.charAt(i) == 'o'){
        	v += 100;
        }
      }
      
      System.out.println(v);
    }
}
Problem p03469 (python)

Fixed submission:
a,b,c=map(str,input().split("/"))
print("2018/"+b+"/"+c)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split("/"))
print("2018/"+string(b)+"/"+string(c))

Buggy submission (verdict: Runtime Error):
a,b,c=map(string,input().split("/"))
print("2018/"+b+"/"+c)
Problem p03485 (python)

Fixed submission:
import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print((math.ceil((a+b)/2))
Problem p03486 (python)

Fixed submission:
import sys

a=input()
b=input()
c=[]
d=[]
for i in range(len(a)):
    c.append(a[i])
for i in range(len(b)):
    d.append(b[i])
c.sort()
d.sort()
d.reverse()
for i in range(min([len(a),len(b)])):
    if(c[i]<d[i]):
        print("Yes")
        sys.exit()
if(len(a)<len(b)):
    if(a==b[0:len(a)]):
        print("Yes")
        sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
import sys

a=input()
b=input()
c=[]
d=[]
for i in range(len(a)):
    c.append(a[i])
for i in range(len(b)):
    d.append(b[i])
c.sort()
d.reverse()
for i in range(len(a)):
    if(c[i]<d[i]):
        print("Yes")
        sys.exit()
if(len(a)<len(b)):
    if(a==b[0:len(a)]):
        print("Yes")
        sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
import sys

a=input()
b=input()
"""
if(len(a)>len(b)):
    print("Yes")
    sys.exit()
elif(len(a)<len(b)):
    print("No")
    sys.exit()
else:
"""
c=[]
d=[]
for i in range(len(a)):
    c.append(a[i])
for i in range(len(b)):
    d.append(b[i])
c.sort()
d.reverse()
for i in range(len(a)):
    if(c[i]<d[i]):
        print("Yes")
        sys.exit()
print("No")
Problem p03493 (python)

Fixed submission:
s=input()
num=0
if (s[0]=="1"):
  num+=1
if (s[1]=="1"):
  num+=1
if (s[2]=="1"):
  num+=1
print(num)

Buggy submission (verdict: Runtime Error):
s=input()
num=0
if (s[0]==1):
  num++
if (s[1]==1):
  num++
if (s[2]==1):
  num++
print(num)
Problem p03495 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
kind=[]
count=1
for i in range(len(a)-1):
  if(a[i]==a[i+1]):count+=1
  else:
    kind.append(count)
    count=1
kind.append(count)
kind.sort()
change=0
for i in range(k):
  if(len(kind)!=0):change+=kind.pop()
print(n-change)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
kind=[]
count=1
for i in range(len(a)-1):
  if(a[i]==a[i+1]):count+=1
  else:
    kind.append(count)
    count=1
kind.append(count)
kind.sort()
change=0
for i in range(k):change+=kind.pop()
print(n-change)
Problem p03501 (python)

Fixed submission:
N,A,B=map(int,input().split())
if ((N*A)>B):
  print(B)
else:
  print(N*A)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
if ((N*A)>B):
  print(B)
elif:
  print(N*A)
Problem p03555 (python)

Fixed submission:
A=input()
B=input()
if(A[0]==B[2] and A[1]==B[1] and A[2]==B[0]):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A=input()
B=input()
if(A[0]==B[2]&&A[1]==B[1]&&A[2]=B[0]):
  print("YES")
else:
  print("NO")
Problem p03557 (python)

Fixed submission:
import bisect
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
b.sort()
c.sort()
#print(a)
#print(b)
#print(c)
pat=0
ikeep=-1
for i in range(n):
  x=b[i]
  if(x!=ikeep):
    ikeep=x
  else:
    pat+=paty*patz
    continue
  paty=bisect.bisect_left(a,x)
  patz=n-bisect.bisect_right(c,x)
  #print(paty,patz)
  pat+=paty*patz
print(pat)

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()))
a.sort()
b.sort()
c.sort()
b.reverse()
c.reverse()
pat=0
keepi,keepj=-1,-1
for x in range(n):
  i=a[x]
  if(i!=keepi):
    keepi=i
    patj=0
  else:
    pat+=patj
    continue
  for y in range(n):
    j=b[y]
    if(j!=keepj):
        keepj=j
    else:
        patj+=patk
        continue
    if(j<=i):break
    br=0
    for k in range(n):
      if(c[k]<=j):
        #print(i,j,c[k],k)
        patk=k
        br=1
        break
    if(br==0):patk=n
    patj+=patk
  pat+=patj
print(pat)
Problem p03574 (python)

Fixed submission:
h,w=map(int,input().split())
lis=[]
outp=[[0 for i in range(w)] for j in range(h)]
outs=[""]*h
for i in range(h):
    lis.append(input())
for i in range(h):
    for j in range(w):
        if(lis[i][j]=="#"):
            for k in range(-1,2):
                for l in range(-1,2):
                    if(i+k>=0 and i+k<h and j+l>=0 and j+l<w):
                        outp[i+k][j+l]+=1
for i in range(h):
    for j in range(w):
        if(lis[i][j]=="#"):
            outs[i]+="#"
        else:
            outs[i]+=str(outp[i][j])
for i in range(h):
    print(outs[i])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lis=[]
outp=[[0 for i in range(w)] for j in range(h)]
outs=[""]*h
for i in range(h):
    lis.append(input())
for i in range(h):
    for j in range(w):
        if(lis[i][j]=="#"):
            for k in range(-1,2):
                for l in range(-1,2):
                    if(i+k>=0 and i+k<w and j+l>=0 and j+l<h):
                        outp[i+k][j+l]+=1
for i in range(h):
    for j in range(w):
        if(lis[i][j]=="#"):
            outs[i]+="#"
        else:
            outs[i]+=str(outp[i][j])
for i in range(h):
    print(outs[i])