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

Fixed submission:
#
# abc047 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5 4 2
2 1 1
3 3 4"""
        output = """9"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5 4 3
2 1 1
3 3 4
1 4 2"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """10 10 5
1 6 1
4 1 3
6 9 4
9 4 2
3 1 3"""
        output = """64"""
        self.assertIO(input, output)


def resolve():
    W, H, N = map(int, input().split())
    a = []
    ox = 0
    oy = 0
    for _ in range(N):
        a.append(list(map(int, input().split())))
    for i in range(N):
        if a[i][2] == 1:
            ox = max(a[i][0], ox)
        elif a[i][2] == 2:
            W = min(a[i][0], W)
        elif a[i][2] == 3:
            oy = max(a[i][1], oy)
        elif a[i][2] == 4:
            H = min(a[i][1], H)
    print(max(W-ox, 0)*max(H-oy, 0))


if __name__ == "__main__":
    # unittest.main()
    resolve()

Buggy submission (verdict: Runtime Error):
#
# abc047 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5 4 2
2 1 1
3 3 4"""
        output = """9"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5 4 3
2 1 1
3 3 4
1 4 2"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """10 10 5
1 6 1
4 1 3
6 9 4
9 4 2
3 1 3"""
        output = """64"""
        self.assertIO(input, output)


def resolve():
    W, H, N = map(int, input().split())
    a = []
    ox = 0
    oy = 0
    for _ in range(N):
        a.append(list(map(int, input().split())))
    for i in range(N):
        if a[i][2] == 1:
            ox = max(a[i][0], ox)
        elif a[i][2] == 2:
            W = min(a[i][0], W)
        elif a[i][2] == 3:
            oy = max(a[i][1], oy)
        elif a[i][2] == 4:
            H = min(a[i][1], H)
    print(max((W-ox))*max((H-oy), 0))


if __name__ == "__main__":
    # unittest.main()
    resolve()
Problem p02681 (python)

Fixed submission:
a = input()
b = input()
if a == b[0:-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if a == b[0:-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print(b[0:-1])
if a == b[0:-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if a == b[0:-1]:
    print('Yes')
else:
    print('No')
Problem p02742 (python)

Fixed submission:
a,b = (int(x) for x in input().split())

            
if a == 1 or b == 1:
    print(1)
elif a > b:#b対象
    anb1 = int(b * b) 
    anb2 = (int((a-b) * b))
    if (anb1 % 2) == 0:#偶数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
elif a < b:#a対象            
    anb1 = int(a * a)
    anb2 = int((b-a) * a)
    if (anb1 % 2) == 0:#偶数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
elif a == b:
    if a % 2 == 0:
        print(int(a / 2) * a)
    else:
        print(int((a * a) / 2) + 1)

Buggy submission (verdict: Runtime Error):
a,b = (long(x) for x in input().split())
if a > b:#b対象
    anb1 = long(b * b) 
    anb2 = (long((a-b) * b))
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(long(anb1/2) + long(anb2/2))
        else:#奇数
            print(long(anb1/2) + long(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(long(anb1/2 + 1) + long(anb2/2))
        else:#奇数
            print(long(anb1/2 + 1) + long(anb2/2))
            
elif a < b:#a対象            
    anb1 = long(a * a )
    anb2 = long((b-a) * a)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(long(anb1/2) + long(anb2/2))
        else:#奇数
            print(long(anb1/2) + long(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(long(anb1/2 + 1) + long(anb2/2))
        else:#奇数
            print(long(anb1/2 + 1) + long(anb2/2))
elif a == b:
    if a % 2 == 0:
        print(long(a / 2) * a)
    else:
        print(long((a * a) / 2) + 1)
Problem p02554 (python)

Fixed submission:
n=int(input())
mod=10**9+7
print((pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod))%mod)

Buggy submission (verdict: Runtime Error):
n=int(input())
mod=10**9+7
print((pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod)%mod)
Problem p02576 (python)

Fixed submission:
import os
import sys
from io import BytesIO, IOBase
from math import ceil
def main():
    n,x,t=map(int,input().split())
    print(ceil(n/x)*t)
# region fastio
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
n,x,t=map(int,input().split())
    print(ceil(n/x)*t)
Problem p02657 (python)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print(a * b)
Problem p02681 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
print("Yes" s == t[:-1] else 'No')
Problem p02700 (python)

Fixed submission:
import math
a, b, c, d = map(int, input().split())
if math.ceil(c / b) <= math.ceil(a / d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
if math.ceil(c / b) =< math.ceil(a / d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
if math(c / b) < math(a / d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while 1:
    c -= b
    if(c <= 0):
        print("Yes")
        break
    a -= d:
    if(a <= 0):
        print("No")
        break

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while 1:
    c -= b
    if(a <= 0):
        print("Yes")
        break
    a -= d:
    if(d <= 0):
        print("No")
        break
Problem p02778 (python)

Fixed submission:
str = input()
ans = ""
for i in range(len(str)):
  ans += "x"
print(ans)

Buggy submission (verdict: Runtime Error):
str = input()
for i in range(len(str)):
  str[i] = "x"
print(str)
Problem p02969 (python)

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

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

Buggy submission (verdict: Runtime Error):
r = int(input())
print(3 * a**2)
Problem p03109 (python)

Fixed submission:
a, b, c = input().split("/")
print("TBD" if int(b) > 4 else "Heisei")

Buggy submission (verdict: Runtime Error):
a, b, c = input().split("/")
print("TBD" if b > 4 else "Heisei")
Problem p03288 (python)

Fixed submission:
a = int(input())
print("AGC" if a >= 2800 else "ARC" if a >= 1200 else "ABC")

Buggy submission (verdict: Runtime Error):
r = int(intput())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")
Problem p03415 (python)

Fixed submission:
a = [input() for x in range(3)]
print(a[0][0] + a[1][1] + a[2][2])

Buggy submission (verdict: Runtime Error):
a = [input() for x in 3]
print(a[0][0] + a[1][1] + a[2][2])
Problem p03447 (python)

Fixed submission:
a, b, c = [int(input()) for x in range(3)]
print((a - b) % c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print((a - b) % c)
Problem p03610 (python)

Fixed submission:
s = input()
print(s[::2])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[::2]
Problem p03777 (python)

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

Buggy submission (verdict: Runtime Error):
a, t = input().split()
print("H" if a == "H" and b =="H" or a == "D" and b == "D" else "D")
Problem p03796 (python)

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

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
print(math.factrial(n) % (10**9 + 7))

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
print(math.factorial(a) /( 10**9 + 7))
Problem p03943 (python)

Fixed submission:
a = list(map(int, input().split()))
a = sorted(a)
print('Yes' if a[0] + a[1] == a[2] else 'No')

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split())).sorted()
print('Yes' if a[0] + a[1] == a[2] else 'No')
Problem p02642 (python)

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

MAX = 10 ** 6

A.sort()
s = set()
ans = N
for i in range(N):
    a = A[i]
    if a in s:
        ans -= 1
        continue
    if i < N - 1 and A[i + 1] == a:
        ans -= 1
    n = MAX // a
    for i in range(1, n + 1):
        s.add(a * i)
print(ans)

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

S = sorted(A)

ans = 0
if S[0] == S[1]:
    for i in range(1, N):
        j = 0
        if S[j] == 0:
            j += 1
            if i <= j:
                ans += 1
                break
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
else:
    ans = 1
    for i in range(1, N):
        j = 0
        if S[j] == 0:
            j += 1
            if i <= j:
                ans += 1
                break
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
print(ans)

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

S = sorted(A)

ans = 0
if S[0] == S[1]:
    for i in range(1, N):
        j = 0
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
else:
    ans = 1
    for i in range(1, N):
        j = 0
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
print(ans)

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

S = sorted(A)
print(S)

ans = 0
if S[0] == S[1]:
    for i in range(1, N):
        j = 0
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
else:
    ans = 1
    for i in range(1, N):
        j = 0
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
print(ans)

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

S = sorted(set(A))

ans = 0
n = len(S)
if n == 1:
    ans = 0
else:
    ans = 1
    for i in range(1, N):
        j = 0
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
print(ans)
Problem p02642 (python)

Fixed submission:
n = int(input())
A = sorted(list(map(int, input().split())))
M = 10**6 + 1
L = [0]*M
for a in A:
    L[a] += 1
    if L[a] == 1:
        # k>=2として k*aは全て不適
        for i in range(2*a, M, a):
            L[i] += 2
# flagの数が答え
print(L.count(1))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())))
M = 10**6 + 1
L = [0]*M
ans = 0
for a in A:
    L[a] += 1
    if L[a] == 1:
        # k>=2として k*aは全て不適
        for i in range(2*a, M+1, a):
            L[i] += 2
# flagの数が答え
print(L.count(1))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())))
M = 2 * 10**5 + 1
L = [0]*M
ans = 0
for a in A:
    L[a] += 1
    if L[a] == 1:
        # k>=2として k*aは全て不適
        for i in range(2*a, M, a):
            L[i] += 2
# flagの数が答え
print(L.count(1))
Problem p02690 (python)

Fixed submission:
D = {}
k = 130
x = int(input())
for i in range(-k, k+1):
    D[i] = i**5
for i in range(-k, k+1):
    for j in range(-k, k+1):
        if D[i]-D[j] == x:
            print(i,j)
            exit()

Buggy submission (verdict: Runtime Error):
import numpy as np
x = int(input())
k = 10000
a = np.arange(-k, k)[:, np.newaxis]
b = np.arange(-k, k)
 
res = a**5 - b**5  == x
res.nonzero()
ans = (np.argwhere(res) - k )[0]
print(ans[0],ans[1])
Problem p02696 (python)

Fixed submission:
a, b, n = map(int, input().split())
def cal(x):
    return (a*x)//b - a*(x//b)
print(cal(min(b-1,n)))

Buggy submission (verdict: Runtime Error):
def cal(i):
    return floor(a*i/b)-a*floor(i/b)
from  math import floor
a, b, n = map(int, input().split())
if b-1<n:
    ans = cal(b-1)
print(max(cal(ans), cal(0),cal(n)))
Problem p02719 (python)

Fixed submission:
n,k=map(int,input().split())
if n >= k:
    print(min(n%k,k-n%k))
elif n == 0:
    print(n)
else:
    print(min(n,k-n))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
print(min(n%k,k-n%k) if n >= k else min(n,n%k,n-k%n))
Problem p02760 (python)

Fixed submission:
import itertools
def main():
    A=[list(map(int,input().split())) for _ in range(3)]
    n=int(input())
    B=list(int(input()) for _ in range(n))
    B=sorted(B)
    C=itertools.combinations(B,3)
    if n<3:
        print('No')
        return
    
    ans=[]
    ans.append(sorted(A[0]))
    ans.append(sorted(A[1]))
    ans.append(sorted(A[2]))
    ans.append(sorted([a[0] for a in A]))
    ans.append(sorted([a[1] for a in A]))
    ans.append(sorted([a[2] for a in A]))
    ans.append(sorted([A[0][0],A[1][1],A[2][2]]))
    ans.append(sorted([A[0][2],A[1][1],A[2][0]]))
    for c in C:
        if list(c) in ans:
            print('Yes')
            return
    print('No')
    
main()

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

# Aには [1, 2, 3, 4, 5, 6, 7, 8, 9] の形で格納.
for _ in range(3):
    A += [int(i) for i in input().split()]

# 印をつけた数字をBに残しておく.
n=int(input())
for _ in range(n):
    b = int(input())
    for i, a in enumerate(A):
        if b == a:
            B[i] = 1

#ビンゴの可能性がある組を作っておく.
C = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
flag = 0

# Bで1と記録が残っていれば真
for a,b,c in C:
    if B[a-1] and B[b-1] and B[c-1]:
        flag = 1
print('Yes' if Chk else 'No')
Problem p03061 (python)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
L = [0]*n
R = [0]*n
for i in range(n-1):
    R [i+1] = gcd(R[i], A[i])
    L[i+1] = gcd(L[i], A[-i-1])
print(max(gcd(R[i], L[-i-1]) for i in range(n)))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
L = [0]*n
R = [0]*n
def left(i):
    if L[i]:
        return L[i]
    if i < 1:
        return 0
    L[i] = gcd(left(i-1), A[i-1])
    return L[i]
def right(i):
    if R[i]:
        return R[i]
    if i+1 > n-1:
        return 0
    R[i] = gcd(right(i+1), A[i+1])
    return R[i]
ans = 0
for i in range(n):
    g = gcd(left(i), right(i))
    if ans < g:
        ans = g
print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
def left(i):
    if i < 1:
        return 0
    return gcd(left(i-1), A[i-1])
def right(i):
    if i+1 > n-1:
        return 0
    # ここA[i+1]じゃなくてA[i]
    return gcd(right(i+1), A[i]) 
ans = 0
for i in range(n):
    ans = max(ans, gcd(left(i), right(i)))
print(ans)

Buggy submission (verdict: Runtime Error):
sys.setrecursionlimit(1000000)
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
def left(i):
    if i < 1:
        return 0
    return gcd(left(i-1), A[i-1])
def right(i):
    if i+1 > n-1:
        return 0
    return gcd(right(i+1), A[i+1])
ans = 0
for i in range(n):
    ans = max(ans, gcd(left(i), right(i)))
print(ans)

Buggy submission (verdict: Runtime Error):
sys.setrecursionlimit(1000000)
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
def left(i):
    if i < 1:
        return 0
    return gcd(left(i-1), A[i-1])
def right(i):
    if i+1 > n-1:
        return 0
    return gcd(right(i+1), A[i+1])
ans = 0
for i in range(n):
    print(i, gcd(left(i), right(i)))
    ans = max(ans, gcd(left(i), right(i)))
print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
def left(i):
    if i < 1:
        return 0
    return gcd(left(i-1), A[i-1])
def right(i):
    if i+1 > n-1:
        return 0
    return gcd(right(i+1), A[i+1])
ans = 0
for i in range(n):
    ans = max(ans, gcd(left(i), right(i)))
print(ans)
Problem p03086 (python)

Fixed submission:
s=input()
L=[]
c=0
for i in range(len(s)):
    if s[i] in "ACGT":
        c+=1
        L.append(c)
    else:
        L.append(c)
        c=0
print(max(L))

Buggy submission (verdict: Runtime Error):
s=input()
L=[]
c=0
for i in range(len(s)):
    if s[i] in "ACGT":
        c+=1
    else:
        L.append(c)
        c=0
print(max(L))
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
s=list(input() for _ in range(h))
flag=1
for i in range(h):
    for j in range(w):
        check=0
        if s[i][j]=="#":
            if i!=0 and s[i-1][j]=="#":check +=1
            if i!=h-1 and s[i+1][j]=="#":check += 1
            if j!=0 and s[i][j-1]=="#":check += 1
            if j!=w-1 and s[i][j+1]=="#":check += 1
            if check==0:flag=0
print("Yes" if flag else "No")

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
#枠を大きめに確保してout of rangeを避ける!
grid = ["."*(w+2)]
for _ in range(h):
    grid.append("." + input() + ".")
grid += ["."*(w+2)]

for i in range(1,h+1):
    for j in range(1,w+1):
        if grid[i][j]=="#":
            if not (grid[i][j-i]=="#" or grid[i][j+1]=="#"or \
                grid[i-1][j]=="#" or grid[i+1][j]=="#"):
                    print("No")
                    exit()
print("Yes")
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(input())
print((n-1)*(m-1))
Problem p03266 (python)

Fixed submission:
l = list(map(int, input().split()))
N = int(l[0])
K = int(l[1])
R1 = N // K
R2 = (N - (K // 2))// K + 1
if K % 2 == 1:
  print(R1**3)
else:
  print(R1**3 + R2**3)

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
N = int(l[0])
K = int(l[1])
R1 = (N // K)
R2 = (N // (K // 2))
if K % 2 == 1:
  print(R1**3)
else:
  print(R2**3 - R2 * 5 - 3)
Problem p03280 (python)

Fixed submission:
l = list(map(int, input().split()))
print((l[0] - 1 ) * (l[1] - 1))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print("{} {}".format((A - 1) * (B - 1)))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print("{} {}".format((A - 1)(B - 1)))

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

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print("{} {}".format((A - 1)(B - 1)))
Problem p02613 (python)

Fixed submission:
##B
N = int(input())
S = list(input() for i in range(N))
a=0
b=0
c=0
d=0
for i in S:
    if i =="AC":
        a +=1
    elif i =="WA":
        b +=1
    elif i =="TLE":
        c +=1
    elif i =="RE":
        d +=1
print("AC x "+ str(a))
print("WA x "+ str(b))
print("TLE x "+ str(c))
print("RE x "+ str(d))

Buggy submission (verdict: Runtime Error):
##B
N = int(input())
S = list(input() for i in range(N))
a=0
b=0
c=0
d=0
for i in S:
    if i =="AC":
        a +=1
    elif i =="WA":
        b +=1
    elif i =="TLE":
        c +=1
    elif i =="RE":
        d +=1
print("AC x "+ str(a))
print("WA x "+ str(b))
print("TLE x "+ str(c))
print("RE x "+ str(d))
AC x 3
WA x 1
TLE x 2
RE x 0
Problem p02641 (python)

Fixed submission:
##C
X,N = map(int,input().split())
P = list(map(int,input().split()))
i=0
j = 0
while X+i<=101:
    if X+i not in P:
        ans1 = X+i
        break
    i += 1
while X-j>=-1:
    if X-j not in P:
        ans2 = X-j
        break
    j += 1
if ans1-X>=X-ans2:
    print(ans2)
else:
    print(ans1)

Buggy submission (verdict: Runtime Error):
##C
X,N = map(int,input().split())
P = list(map(int,input().split()))
i=0

while X+i<=100:
    if X+i not in P:
        ans1 = X+i
        break
    i += 1
while X-i>=-100:
    if X-i not in P:
        ans2 = X-i
        break
    i += 1
if ans1-X>=X-ans2:
    print(ans2)
else:
    print(ans1)

Buggy submission (verdict: Runtime Error):
##C
X,N = map(int,input().split())
P = list(map(int,input().split()))
i=0

while X+i<=100:
    if X+i not in P:
        ans1 = X+i
        break
    i += 1
while X-i>=0:
    if X-i not in P:
        ans2 = X-i
        break
    i += 1
if ans1-X>=X-ans2:
    print(ans2)
else:
    print(ans1)
Problem p02658 (python)

Fixed submission:
##169

##B
N = int(input())
A = list(map(int,input().split()))
ans = 1
i=0
if 0 in A:
  print(0)
else:
  while N > i:
    if ans <= 10**18:
        ans *= A[i]
        i += 1
    else:
        ans = -1
        break
  
  if ans > 10**18:
        print(-1)
  else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ans = 0
i=0
if A in 0:
  print(0)
else:
  while N > i:
  	if ans > 10**18:
    	print(-1)
        exit()
    else:
      ans *= A[i]
      i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ans = 0

if A in 0:
  print(0)
else:
  while N > i:
  	if ans > 10**18:
    	print(-1)
        exit()
    else:
      ans *= A[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N ＝　int(input())
A ＝　list(map(int,input().split()))

ans ＝　1
if A in 0:
  print(0)
else:
  while N > i:
    if ans <= 10**18:
      ans *= A[i]
    else:
      print(-1)
      exit()
print(ans)