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

Fixed submission:
N = int(input())
S = [int(input()) for _ in range(N)]
table = [False] * (200 * 200 + 1)
table[0] = True
ma = 0
for s in S:
    ma += s
    for i in range(ma, -1, -1):
        table[i+s] |= table[i]
for i in range(ma, -1, -1):
    if i % 10 != 0 and table[i]:
        print(i)
        break
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [int(input()) for _ in range(N)]
table = [False] * (100 * 100 + 1)
table[0] = True
ma = 0
for s in S:
    ma += s
    for i in range(ma, -1, -1):
        table[i+s] |= table[i]
for i in range(ma, -1, -1):
    if i % 10 != 0 and table[i]:
        print(i)
        break
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [int(input()) for _ in range(N)]
table = [False] * (100 * 100 + 1)
table[0] = True
ma = 0
for s in S:
    ma += s
    for i in range(ma, -1, -1):
        table[i+s] |= table[i]
for i in range(ma, -1, -1):
    if i % 10 != 0 and table[i]:
        print(i)
        break
Problem p03711 (python)

Fixed submission:
G = [set([1,3,5,7,8,10,12]), set([4,6,9,11]), set([2])]
def check(x, y):
  for g in G:
    if x in g and y in g:
      return True
  return False
x, y = map(int, input().split())
print("Yes" if check(x, y) else "No")

Buggy submission (verdict: Runtime Error):
G = [set([1,3,5,7,8,10,12]), set([4,6,9,11]), set([2])]
def check(x, y):
  for g in G:
    if x in g and y in g:
      return True
  return False
print("Yes" if check(x, y) else "No")
Problem p03715 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def f(H, W):
    mh = H // 2
    if mh != 0:
        yield mh*W, (H-mh)*W
    mw = W // 2
    if mw != 0:
        yield H*mw, H*(W-mw)

def solve_iter(H: int, W: int):
    for h in range(1, H):
        for s in (tuple([h*W])+s for s in f(H-h, W)):
            yield max(s) - min(s)
    for w in range(1, W):
        for s in (tuple([H*w])+s for s in f(H, W-w)):
            yield max(s) - min(s)

def solve(H: int, W: int):
    return min(solve_iter(H, W))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    print(solve(H, W))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def f(H, W):
    mh = H // 2
    mw = W // 2
    return (mh*W, (H-mh)*W), (H*mw, H*(W-mw))

def solve_iter(H: int, W: int):
    for h in range(1, H):
        for s in ((h*W,*s) for s in f(H-h, W)):
            yield max(s) - min(s)
    for w in range(1, W):
        for s in ((H*w,*s) for s in f(H, W-w)):
            yield max(s) - min(s)

def solve(H: int, W: int):
    return min(solve_iter(H, W))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    print(solve(H, W))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())
if A == B:
  print("EQUAL")
if A > B:
  print("GREATER")
if A < B:
  print("LESS")

Buggy submission (verdict: Runtime Error):
A, B = input().split()
N = max(len(A), len(B))
A, B = A.zfill(N), B.zfill(N)
if A == B:
  print("EQUAL")
if A > B:
  print("GREATER")
if A < B:
  print("LESS")

Buggy submission (verdict: Runtime Error):
A, B = input().split()
N = max(len(A), len(B))
A, B = A.zfill(N), B.zfill(B)
if A == B:
  print("EQUAL")
if A > B:
  print("GREATER")
if A < B:
  print("LESS")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A == B:
  print("EQUAL")
if A > B:
  print("GREATER")
if A < B:
  print("LESS")
Problem p03796 (python)

Fixed submission:
from functools import reduce
MOD = 1_000_000_007
print(reduce(lambda a,b: a*b%MOD, range(1, int(input())+1), 1))

Buggy submission (verdict: Runtime Error):
from functools import reduce
MOD = 1_000_000_007
print(reduce(lambda a,b: a*b%MOD, range(1, int(input()))))

Buggy submission (verdict: Runtime Error):
from functools import reduce
MOD = 1_000_000_007
print(reduce(lambda a,b: a*b%MOD, range(1, int(input()))))
Problem p03837 (python)

Fixed submission:
#!/usr/bin/env python3
import sys

def solve(N: int, M: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    import numpy as np    
    from scipy.sparse import csr_matrix    
    from scipy.sparse.csgraph import floyd_warshall
    omat = csr_matrix((c+c, (a+b, b+a)), shape=(N+1, N+1), dtype=np.int32)
    smat = floyd_warshall(omat)
    return ((omat-smat) > 0).sum() // 2


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int()] * (M)  # type: "List[int]"
    b = [int()] * (M)  # type: "List[int]"
    c = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    print(solve(N, M, a, b, c))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

def solve(N: int, M: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    import numpy as np    
    from scipy.sparse import csr_matrix    
    from scipy.sparse.csgraph import floyd_warshall
    omat = csr_matrix((c, (a, b)), shape=(N+1, N+1), dtype=np.int32, directed=False)
    smat = floyd_warshall(omat)
    return ((omat-smat) > 0).sum() // 2


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int()] * (M)  # type: "List[int]"
    b = [int()] * (M)  # type: "List[int]"
    c = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    print(solve(N, M, a, b, c))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
Problem p03992 (python)

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

Buggy submission (verdict: Runtime Error):
"""難しいすぎるよぅ..."""

def solve():
    R, C = list(map(int, input().split()))
    N = int(input())
    row = [[] for _ in range(R)]
    field = {}
    for _ in range(N):
        r, c, a = list(map(int, input().split()))
        r, c = r - 1, c - 1
        row[r].append((c, a))
        field[(r, c)] = a
    row = [sorted(r) for r in row]
    for rn, r in enumerate(row):
        for i, e1 in enumerate(r):
            for e2 in r[i+1:]:
                n = e2[0] - e1[0]
                print(r, e1, e2, n)
                if n > C:
                    break
                a = field.get((rn+n, e1[0]), None)
                b = field.get((rn+n, e2[0]), None)
                if a is None and b is None:
                    continue
                if a is None:
                    if e1[1] + b - e2[1] < 0:
                        return False
                elif b is None:
                    if e2[1] + a - e1[1] < 0:
                        return False
                else:
                    if e1[1] + b == e2[1] + a:
                        return False
    return True

print("Yes" if solve() else "No")
Problem p04001 (python)

Fixed submission:
from itertools import product

S = tuple(input())
N = len(S)
res = 0
for ops in product(["+", ""], repeat=N-1):
    exp = "".join([n + op for n, op in zip(S, ops+("",))]).strip("+")
    res += eval(exp)
print(res)

Buggy submission (verdict: Runtime Error):
from itertools import product
H, W, N = list(map(int, input().split()))
A = [tuple(map(int, input().split())) for _ in range(N)]
count = {}
for x, y in A:
    for xx, yy in product(range(x-1, x+2), range(y-1, y+2)):
        if not(2 <= xx <= H-1 and 2 <= yy <= W-1):
            continue
        count[(xx, yy)] = count.get((xx, yy), 0) + 1
ans = [0] * 10
for k, v in count.items():
    ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep="\n")
Problem p04048 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == 0:
        return 0
    if y % x == 0:
        return 2 * (y // x) * x - x
    return 2 * (y // x) * x + f(y % x, x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == 0:
        return 0
    if x == y:
        return x
    x, y = min(x, y), max(x, y)
    return 2 * x + f(x, y - x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == y:
        return x
    x, y = min(x, y), max(x, y)
    return 2 * (y // x) * x + f(x, y % x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)

Buggy submission (verdict: Runtime Error):
def f(x, y):
    if x == y:
        return x
    x, y = min(x, y), max(x, y)
    return 2 * x + f(x, y - x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)
Problem p03126 (python)

Fixed submission:
import sys

n,m=map(int,input().split())
ans=[0]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[k[j]]+=1

for i in ans:
    if i==n:
        output+=1

print(output)

Buggy submission (verdict: Runtime Error):
import sys

n,m=map(int,input().split())
ans=[]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[j]+=1

for i in ans:
    if ans[i]==n:
        output+=1

print(output)

Buggy submission (verdict: Runtime Error):
import sys

n,m=map(int,input().split())
ans=[0]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[j]+=1

for i in ans:
    if ans[i]==n:
        output+=1

print(output)
Problem p03238 (python)

Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    
    print(a + b)

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

if n == 1:
    print("Hello World")
else:
    a, b = map(int, input().split())
    print(a + b)
Problem p03423 (python)

Fixed submission:
n = int(input())

print(n // 3)

Buggy submission (verdict: Runtime Error):
h, w, d = map(int, input().split())

a = [list(map(int, input().split())) for i in range(h)]

dic = [0] * (h * w)

for i in range(h):
    for j in range(w):
        dic[a[i][j] - 1] = i, j

s = [[0] * (h * w // d + 1) for i in range(d)]

for i in range(d):
    for j in range(1, h * w // d + 1):
        b = i + d * (j - 1)
        c = i + d * j

        if c >= len(dic):
            break
        
        y, x = dic[b]
        ny, nx = dic[c]
        s[i][j] = s[i][j - 1] + abs(ny - y) + abs(nx - x)

q = int(input())

for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    print(s[l % d][r // d] - s[l % d][l // d])
Problem p03651 (python)

Fixed submission:
import fractions
import functools
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = functools.reduce(fractions.gcd, a)

if max(a) >= k and k % g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
import math
import functools
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = functools.reduce(math.gcd, a)

if max(a) >= k and k % g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Problem p02618 (python)

Fixed submission:


def main():

    for i in range(365):
        print(10)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

def main():
    d = int(input())
    c = [-1] + list(map(int,input().split()))
    s = [0] * (d+1)
    last = [-1] + [0] * d
    for i in range(1,d+1):
        s[i] = [0] + list(map(int,input().split()))

    for i in range(1,d+1):
        mx = max(s[i])
        mx_ind = s.index(mx)
        print(mx_ind)



if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import random

def main():
    d = int(input())
    for i in range(d):
        random.randint()
        print(random.randint(1,27))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import random

def main():
    d = int(d)
    for _ in range(d):
        input()
    for i in range(d):
        random.randint()
        print(random.ranint(1,27))


if __name__ == '__main__':
    main()
Problem p02684 (python)

Fixed submission:

def main():
    n,k = map(int,input().split())
    dests =[0 for _ in range(n)]
    telepos = list(map(int,input().split()))
    for i,t in enumerate(telepos):
        dests[i] = t-1
    print(solve(dests,k))




def solve(dests,k,here = 0):
    here = 0
    telepo_times = 0
    cycle_start = -1
    cycle_end = -1
    cycle_length = -1
    visited = dict()
    visited2 = []


    #循環検出！同じ町にいつ戻ってくるのか
    while telepo_times < k:
        #print("現在地は",here)
        if here in visited:
            cycle_start = visited[here]
            #print(cycle_start,"でループが始まった")
            cycle_end = telepo_times - 1
            #print(cycle_end,"でループが終わった")
            cycle_length = cycle_end - cycle_start + 1
            #print("サイクルの長さは",cycle_length,"だ")
            break
        #ids[here] = telepo_times

        visited[here] = telepo_times
        visited2.append(here)
        telepo_times += 1
        here = dests[here]
    if cycle_length == -1:
        return here + 1

    cycle_index = (k-cycle_start) % cycle_length
    return visited2[cycle_start + cycle_index] + 1




    #telepo_times = 0
    #while telepo_times < (k - cycle_start)%cycle_length:
    #    telepo_times += 1
    #    here = dests[here]







if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

def main():
    n,k = map(int,input().split())
    dests =[0 for _ in range(n)]
    telepos = list(map(int,input().split()))
    for i,t in enumerate(telepos):
        dests[i] = t-1
    print(dfs(dests,k))




def solve(dests,k,here = 0):
    here = 0
    telepo_times = 0
    cycle_start = -1
    cycle_end = -1
    cycle_length = -1
    visited = []
    ids = dict()


    #循環検出！同じ町にいつ戻ってくるのか
    while telepo_times < k:
        #print("現在地は",here)
        if here in visited:
            cycle_start = ids[here]
            #print(cycle_start,"でループが始まった")
            cycle_end = telepo_times - 1
            #print(cycle_end,"でループが終わった")
            cycle_length = cycle_end - cycle_start + 1
            #print("サイクルの長さは",cycle_length,"だ")
            break
        ids[here] = telepo_times

        visited.append(here)
        telepo_times += 1
        here = dests[here]
    if cycle_length == -1:
        return here + 1

    cycle_index = (k-cycle_start) % cycle_length
    return visited[cycle_start + cycle_index] + 1




    #telepo_times = 0
    #while telepo_times < (k - cycle_start)%cycle_length:
    #    telepo_times += 1
    #    here = dests[here]







if __name__ == '__main__':
    main()
Problem p02696 (python)

Fixed submission:
#import matplotlib.pyplot as plt

def main():
    a,b,n = map(int,input().split())
    x = min(b-1,n)



    print(int(a*x/b) - a * int(x/b))


    #plt.plot(list(range(len(right))),right,label="test")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from itertools import combinations_with_replacement


n,m,q = map(int,input().split())
num_lst = []
for i in range(q):
    num_lst.append(list(map(int,input().split())))
l = list(range(1,m+1))
A = list(combinations_with_replacement(l,n))

mx = 0
for now_A in A:
    score = 0
    for nums in num_lst:
        a,b,c,d = nums
        if now_A[b-1] - now_A[a-1] == c:
            score += d
    mx = max(mx,score)
print(mx)

Buggy submission (verdict: Runtime Error):
#import matplotlib.pyplot as plt

def main():
    a,b,n = map(int,input().split())
    mx = 0
    for x in range(1,min(a+1,n+1)):
        left = ia*x/b//1
        right = a * x/b//1
        #print("x=",x,"floor(Ax/B)=",int(a*x//b),"A*floor(x/B)=",a * int(x // b),"answer=",left-right)
        #right.append(a * int(x/b))

        mx = max(left-right,mx)
    print(mx)


    #plt.plot(list(range(len(right))),right,label="test")


if __name__ == '__main__':
    main()
Problem p02705 (python)

Fixed submission:
print(2 * int(input()) *3.14159265359 )

Buggy submission (verdict: Runtime Error):
print(2 * r *3.14159265359 )

Buggy submission (verdict: Runtime Error):
print(2 * r *3.14159265359 )
Problem p02801 (python)

Fixed submission:
c = input()

print(chr(ord(c)+1))

Buggy submission (verdict: Runtime Error):
    c = input()
    print(chr(ord(c)+1))

Buggy submission (verdict: Runtime Error):
c = input()
print(chr(ord("")+1))
Problem p02806 (python)

Fixed submission:


def main():
    n = int(input())
    s = [0] * n
    t = [0] * n
    all_time_count = 0

    for i in range(n):
        s[i],t[i] = input().split()
        t[i] = int(t[i])
        all_time_count += t[i]
    x = input()
    time_count = 0
    for i in range(n):
        time_count += t[i]
        if s[i] == x:
            break
    print(all_time_count - time_count)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n =int(input())
s=[""]*n
t=[0]*n
for i in range(n):
  s[i],t[i] =[s,int(t) for s,t in input().split()]
r = [0] * (n+1)  
for i in range(1,n+1):
  r[i] = r[i-1] + t[i-1]
x=input()
ind = s.index(x)
print(r[n] - r[ind])
Problem p02818 (python)

Fixed submission:

a,b,k=map(int,input().split())

a1=max(a-k,0)
k=max(k-a,0)
b=max(b-k,0)
print(a1,b)

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

a=max(a-k,0)
k=max(k-a,0)
b=max(b-k,0)
print(a,b)
Problem p02843 (python)

Fixed submission:
x = int(input())

num = x // 100



dp = ["?"] * (x+1)
dp[0] = "1"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "0"
    elif i in (100,101,102,103,104,105):
        dp[i] = "1"
    else:
        if "1" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "1"
        else:
            dp[i] = "0"

            
print(dp[x])

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

num = x // 100



dp = ["?"] * x
dp[0] = "Yes"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "No"
    elif i in (100,101,102,103,104,105):
        dp[i] = "Yes"
    else:
        if "Yes" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "Yes"
        else:
            dp[i] = "No"

            
print(dp[x])
Problem p03251 (python)

Fixed submission:

def main():
    N,M,X,Y = map(int,input().split())
    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    ok = False
    for z in range(X+1,Y+1):
        if z > max(x_s) and z <= min(y_s):
            ok = True
            break

    print("No War" if ok else "War")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

def main():
    N,M,X,Y = map(int,input().split())

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(-101,101):
        #print(z)
        if x_max < z and y_min >= z and X < z and x <= Y:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()
Problem p03262 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(reduce(gcd,diffs))





if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(reduce(gcd,diffs))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from numpy import gcd

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(gcd.reduce(diffs))





if __name__ == '__main__':
    main()
Problem p03316 (python)

Fixed submission:
n=int(input())
s=sum([i for i in map(int,str(n))])
if n % s == 0:
  print("Yes")
else:
  print("No")

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

sm = sum([int(c) for c in s])
if s%sm == 0:
  print("Yes")
else:
  print("No")
Problem p03337 (python)

Fixed submission:
def main():
    a,b = map(int,input().split())
    print(max(a+b,a-b,a*b))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print(max(max(a+b,a-b),a*B))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print(max(a+b,a-b,a*b))
Problem p03633 (python)

Fixed submission:
from functools import reduce
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a


#最小公倍数
def lcm(a,b):
  return b//gcd(a,b) * a


if __name__ == "__main__":
    n = int(input())
    lst = []
    for i in range(n):
        lst.append(int(input()))
    print(reduce(lcm,lst))

Buggy submission (verdict: Runtime Error):
from functools import reduce
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a


#最小公倍数
def lcm(a,b):
  return a * b//gcd(a,b) a


if __name__ == "__main__":
    n = int(input())
    lst = []
    for i in range(n):
        lst.append(int(input()))
    print(reduce(lcm,lst))
Problem p03657 (python)

Fixed submission:
a,b = map(int,input().split())
     
if a % 3 == 0 or b % 3 == 0 or (a+b)%3 == 0:
      print("Possible")
else:
      print("Impossible")

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

if a % 3 == 0 or b % 3 == 0 or (a+b)%3 == 0:
  print("Possible")
else:
  print("Impossible")
Problem p03673 (python)

Fixed submission:

from collections import  deque
n = int(input())
lst = list(input().split())
reverse = False
b = deque()
for a in lst:
	if reverse:
		b.appendleft(a)
	else:
		b.append(a)
	reverse = not reverse

answer =[]
if reverse:
	while b:
		answer.append(b.pop())
else:
	while b:
		answer.append(b.popleft())

print(" ".join(answer))

Buggy submission (verdict: Runtime Error):

from collections import  deque
n = int(input())
lst = list(map(int,input().split()))
reverse = False
b = deque()
for a in lst:
	if reverse:
		b.appendleft(a)
	else:
		b.append(a)
	reverse = not reverse

answer =[]
if reverse:
	while b:
		answer.append(b.pop())
else:
	while b:
		answer.append(b.popleft())

print(" ".join(answer))
Problem p03693 (python)

Fixed submission:
rgb = int(input().replace(" ",""))
     
if rgb % 4 == 0:
      print("YES")
else:
      print("NO")

Buggy submission (verdict: Runtime Error):
    rgb = int(input().replace(" ",""))
     
    if rgb % 4 == 0:
      print("YES")
    else:
      print("NO")

Buggy submission (verdict: Runtime Error):
rgb = int(input().replace(" ","").)

if rgb % 4 == 0:
  print("YES")
else:
  print("NO")
Problem p03697 (python)

Fixed submission:

a,b= map(int,input().split())
print(a+b if a+b<10 else "error")

Buggy submission (verdict: Runtime Error):
a,b= map(int,inpit()split())
print(a+b if a+b<10 else "error")