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

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    s = sorted(list(map(int, input().strip().split())), reverse=True)
    check = [False] * (2**N)
    now = []
    now.append([s[0], 1])
    check[0] = True
    ok = True
    for i in range(N):
        next_ = []
        tmp = 0
        for j in range(len(now)):
            hp, start = now[j]
            start = max(start, tmp)
            ok = False
            for k in range(start, 2**N):
                if s[k] < hp and not check[k]:
                    tmp = k+1
                    now[j][1] = k+1
                    check[k] = True
                    next_.append([s[k], k+1])
                    ok = True
                    break
            if not ok:
                break
        now += next_
        now = sorted(now, reverse=True)
        if not ok:
            break
    
    if ok:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
a
Problem p02952 (python)

Fixed submission:
N = input()

tmp = len(N)

if tmp == 1:
    print(int(N))
else:
    ans = 0
    for i in range(tmp):
        if i&1 == 1:
            ans += 10**(i) - 10**(i-1)
        elif i == tmp-1:
            ans += int(N) - int("9"*i)

    # if N[0] == "1" and N[1:]
    print(ans)

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

tmp = len(N)

ans = 0
for i in range(tmp):
    if i&1 == 1:
        ans += 10**(i) - 10**(i-1)
    elif i == tmp-1:
        ans += int(N[1:]) + 1

# if N[0] == "1" and N[1:]
print(ans)
Problem p02975 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = list(map(int, input().split()))
    tmp = 0
    for i in range(N):
        tmp ^= a[i]
    if tmp == 0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    zero_count = 0
    ok = False
    dic = {}
    for a in A:
        if a == 0:
            zero_count += 1
        else:
            if a in dic:
                dic[a] += 1
            else:
                dic[a] = 1
    # print(dic, zero_count)
    if len(dic) == 3:
        if zero_count == 0:
            tmp = list(dic.values())
            # print(tmp)
            if tmp[0] == tmp[1] and tmp[1] == tmp[2]:
                key = list(dic.keys())
                tmp = key[0]
                tmp ^= key[1]
                tmp ^= key[2]
                if tmp == 0:
                    print("Yes")
                    return
    if len(dic) == 1:
        if n%3 == 0:
            if zero_count == N/3:
                print("Yes")
                return
    if zero_count == N:
        print("Yes")
        return
    print("No")




if __name__ == "__main__":
    main()
Problem p03061 (python)

Fixed submission:
def gcd(a, b):
    tmp = a%b
    if tmp == 0:
        return b
    return gcd(b, tmp)

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

g_l = [1 for i in range(N)]
g_r = [1 for i in range(N)]

g_l[0] = A[0]
g_r[-1] = A[-1]

for i in range(1, N):
    g_l[i] = gcd(A[i], g_l[i-1])
    g_r[-i-1] = gcd(A[-i-1], g_r[-i])

ans = max(g_r[1], g_l[-2])
for i in range(1, N-1):
    ans = max(ans, gcd(g_l[i-1], g_r[i+1]))

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

g_l = [1 for i in range(N)]
g_r = [1 for i in range(N)]

g_l[0] = A[0]
g_r[-1] = A[-1]

for i in range(1, N):
    g_l[i] = math.gcd(A[i], g_l[i-1])
    g_r[-i-1] = math.gcd(A[-i-1], g_r[-i])

ans = max(g_r[1], g_l[-2])
for i in range(1, N-1):
    ans = max(ans, math.gcd(A[i-1], A[i+1]))

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

g_l = [1 for i in range(N)]
g_r = [1 for i in range(N)]

g_l[0] = A[0]
g_r[-1] = A[-1]

for i in range(1, N):
    g_l[i] = math.gcd(A[i], g_l[i-1])
    g_r[-i-1] = math.gcd(A[-i-1], g_r[-i])

ans = max(g_r[1], g_l[-2])
for i in range(1, N-1):
    ans = max(ans, math.gcd(A[i-1], A[i+1]))

print(ans)
Problem p03231 (python)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

def main():
    N, M = map(int, input().split())
    s = input().strip()
    t = input().strip()
    if M > N:
        tmp = s
        s = t
        t = tmp
        tmp = N
        N = M
        M = tmp
    # N >= Mと仮定して良い
    gcd_ = gcd(N, M)
    len_ = N * (M//gcd_)
    tmp1 = len_ // N
    tmp2 = len_ // M
    # print(tmp1, tmp2)
    ok = True
    for i in range(0, len_, tmp1 * (tmp2//gcd(tmp1, tmp2))):
        # print(i, s[i//tmp1], t[i//tmp2])
        if s[i//tmp1] != t[i//tmp2]:
            ok = False
            break
    if ok:
        print(len_)
    else:
        print(-1)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

def main():
    N, M = map(int, input().split())
    s = input().strip()
    t = input().strip()
    if M > N:
        tmp = s
        s = t
        t = tmp
        tmp = N
        N = M
        M = tmp
    # N >= Mと仮定して良い
    gcd_ = gcd(N, M)
    len_ = N * (M//gcd_)
    st = [""] * len_
    tmp = len_ // N
    for i in range(N):
        st[i*tmp] = s[i]
    ok = True
    tmp = len_ // M
    for i in range(M):
        if st[i*tmp] == "" or st[i*tmp] == t[i]:
            st[i*tmp] = t[i]
        else:
            ok = False
            break
    # print(st)
    if ok:
        print(len_)
    else:
        print(-1)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N, M = map(int, input().split())
    s = input().strip()
    t = input().strip()
    if M > N:
        tmp = s
        s = t
        t = tmp
        tmp = N
        N = M
        M = tmp
    # N >= Mと仮定して良い
    gcd_ = math.gcd(N, M)
    len_ = N * (M//gcd_)
    st = [""] * len_
    tmp = len_ // N
    for i in range(N):
        st[i*tmp] = s[i]
    ok = True
    tmp = len_ // M
    for i in range(M):
        if st[i*tmp] == "" or st[i*tmp] == t[i]:
            st[i*tmp] = t[i]
        else:
            ok = False
            break
    # print(st)
    if ok:
        print(len_)
    else:
        print(-1)

if __name__ == "__main__":
    main()
Problem p03290 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def ceil(a, b):
    if a%b == 0:
        return a//b
    else:
        return a//b + 1

def main():
    D, G = map(int, input().split())
    G //= 100
    pc = [list(map(int, input().split())) for i in range(D)]

    ans = int(1e9)
    for i in range(2**D):
        tmp = 0
        rest = []
        count = 0
        for j in range(D):
            if i&1:# コンプリートする問題
                tmp += (j+1) * pc[j][0] + pc[j][1]//100
                count += pc[j][0]
            else:
                rest.append((j+1, pc[j][0]))
            i >>= 1
        rest = sorted(rest, reverse=True)
        rest_point = G - tmp
        if rest_point <= 0:# すでに足りている
            ans = min(ans, count)
        elif len(rest) > 0:# 不足分を補う必要がある
            plus = ceil(rest_point, rest[0][0])
            if plus < rest[0][1]:# p-1問以内ですむ
                ans = min(ans, count + plus)
        else:# すべて使っても足りない
            pass
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def ceil(a, b):
    if a%b == 0:
        return a//b
    else:
        return a//b + 1

def main():
    D, G = map(int, input().split())
    pc = [list(map(int, input().split())) for i in range(D)]

    ans = int(1e9)
    for i in range(2**D):
        tmp = 0
        rest = []
        count = 0
        for j in range(D):
            if i&1:# コンプリートする問題
                tmp += (j+1)*100 * pc[j][0] + pc[j][1]
                count += pc[j][0]
            else:
                rest.append(((j+1)*100, pc[j][0]))
            i >>= 1
        rest = sorted(rest, reverse=True)
        rest_point = G - tmp
        if rest_point < 0:
            continue
        tmp = ceil(rest_point, rest[0][0])
        if tmp <= rest[0][1]:
            ans = min(ans, count + tmp)
            # print(rest_point, count, tmp)
    print(ans)

if __name__ == "__main__":
    main()
Problem p03379 (python)

Fixed submission:
def main():
    N = int(input())
    x = list(map(int, input().split()))
    x = sorted([(x[i], i) for i in range(N)])
    ans = [0] * N
    for i in range(N//2):
        ans[x[i][1]] = x[N//2][0]
    for i in range(N//2, N):
        ans[x[i][1]] = x[N//2 - 1][0]
    for i in range(N):
        print(ans[i])

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    x = sorted([(int(input()), i) for i in range(N)])
    ans = [0] * N
    for i in range(N//2):
        ans[x[i][1]] = x[N//2][0]
    for i in range(N//2, N):
        ans[x[i][1]] = x[N//2 - 1][0]
    for i in range(N):
        print(ans[i])

if __name__ == "__main__":
    main()
Problem p03427 (python)

Fixed submission:
def main():
    N = input().strip()
    all_nine = True
    for i in range(1, len(N)):
        if N[i] != "9":
            all_nine = False
    ans = int(N[0]) + 9 * (len(N) - 1)
    if all_nine:
        print(ans)
    else:
        print(ans - 1)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = input().strip()
    ans = 0
    count = 0
    for i in range(len(N)):
        if N[i] != "9":
            break
        count += 1
    if count == len(N):
        print(9*count)
    elif count == len(N)-1:
        print(9*count+int(N[-2])-1)
    else:
        print(9*(len(N)-1)+int(N[count])-1)

if __name__ == "__main__":
    main()
Problem p03524 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
  s = input().strip()
  t = "abc"
  count = [0, 0, 0]
  for i in range(len(s)):
    for j in range(3):
      if s[i] == t[j]:
        count[j] += 1
  m = min(count)
  jud = count[0] - m
  jud = max(jud, count[1] - m)
  jud = max(jud, count[2] - m)
  
  if jud <= 1:
    print("YES")
  else:
    print("NO")
    
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.redline

def main():
  s = input().strip()
  t = "abc"
  count = [0, 0, 0]
  for i in range(len(s)):
    for j in range(3):
      if s[i] == t[j]:
        count[j] += 1
  m = min(count)
  jud = count[0] - m
  jud = max(jud, count[1] - m)
  jud = max(jud, count[2] - m)
  
  if jud <= 1:
    print("YES")
  else:
    print("NO")
    
if __name__ == "__main__":
  main()
Problem p03557 (python)

Fixed submission:
import sys
import bisect
input = sys.stdin.readline

def main():
    N = int(input())
    a = sorted(list(map(int, input().split())))
    b = sorted(list(map(int, input().split())))
    c = sorted(list(map(int, input().split())))

    ans = 0
    for i in range(N):
        tmp = bisect.bisect_right(a, b[i]-1)
        tmp *= N - bisect.bisect_left(c, b[i]+1)
        ans += tmp
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import bisect
input = sys.stdin.readline

def main():
    N = int(input())
    a = list(map(int, input().split()))
    b = sorted(list(map(int, input().split())))
    c = list(map(int, input().split()))

    sum_c = [0] * (max(max(c), b[-1]) + 2)
    for i in range(N):
        sum_c[c[i]] += 1
    
    for i in range(len(sum_c)-2, -1, -1):
        sum_c[i] += sum_c[i+1]
    
    count = [0] * N
    for i in range(N):
        count[i] = sum_c[b[i]+1]
    for i in range(N-2, -1, -1):
        count[i] += count[i+1]
    # print(count)
    ans = 0
    for i in range(N):
        a_ = a[i]
        b_i = bisect.bisect_left(b, a_+1)
        if b_i < N:
            # print("{}より大きくて最小のbは{}でcount[{}] := {}".format(a_, b[b_i], b_i, count[b_i]))
            ans += count[b_i]
    print(ans)

if __name__ == "__main__":
    main()
Problem p03607 (python)

Fixed submission:
import sys
import bisect
input = sys.stdin.readline

def main():
    N = int(input())
    a = [int(input()) for i in range(N)]

    nums = []

    for i in a:
        if len(nums) > 0:
            if i <= nums[-1]:
                ind = bisect.bisect_left(nums, i)
                if nums[ind] == i:
                    nums.pop(ind)
                else:
                    bisect.insort(nums, i)
            else:
                nums.append(i)
        else:
            nums.append(i)
    
    print(len(nums))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = [int(input()) for i in range(N)]

    check = [False] * (max(a) + 1)

    for i in a:
        check[i] = not(check[i])
    
    ans = 0
    for c in check:
        if c:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = [int(input()) for i in range(N)]

    check = [False] * (int(1e5) + 1)

    for i in a:
        check[i] = not(check[i])
    
    ans = 0
    for c in check:
        if c:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()
Problem p03612 (python)

Fixed submission:
# import sys
# input = sys.stdin.readline

def main():
    N = int(input())
    p = list(map(int, input().split())) + [N+1]

    ans = 0
    i = 1
    for i in range(N):
        if i+1 == p[i]:
            tmp = p[i]
            p[i] = p[i+1]
            p[i+1] = tmp
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# import sys
# input = sys.stdin.readline

def main():
    N = int(input())
    p = list(map(int, input().split()))

    ans = 0
    i = 0
    # while i < N:
    for i in range(N):
        if i+1 == p[i]:
            tmp = p[i]
            p[i] = p[i+1]
            p[i+1] = tmp
            ans += 1
            # i += 1
        # i += 1
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    p = list(map(int, input().split()))

    ans = 0
    i = 0
    # while i < N:
    for i in range(N):
        if i+1 == p[i]:
            tmp = p[i]
            p[i] = p[i+1]
            p[i+1] = tmp
            ans += 1
            # i += 1
        # i += 1
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    p = list(map(int, input().split()))

    ans = 0
    i = 0
    while i < N:
        if i+1 == p[i]:
            tmp = p[i]
            p[i] = p[i+1]
            p[i+1] = tmp
            ans += 1
            i += 1
        i += 1
    print(ans)

if __name__ == "__main__":
    main()
Problem p03720 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    
    count = [0] * N

    for i in range(M):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1
    
    for i in range(N):
        print(count[i])


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#include <stdio.h>

int main(void){
    int i, a, b, N, M, count[50];

    scanf("%d %d", &N, &M);

    for(i=0; i<M; i++){
        scanf("%d %d", &a, &b);
        count[a-1] += 1;
        count[b-1] += 1;
    }

    for (i = 0; i < N; i++)
    {
        printf("%d\n", count[i]);
    }
    

    return 0;
}
Problem p03732 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for i in range(N)]

    base_w = wv[0][0]
    dic = {wv[0][0]:[], wv[0][0]+1:[], wv[0][0]+2:[], wv[0][0]+3:[]}
    for i in range(N):
        w, v = wv[i]
        dic[w].append(v)
    
    wv = sorted(list(dic.items()))
    tmp = [None for i in range(4)]
    for i in range(4):
        num, l = wv[i]
        l = sorted(l, reverse=True)
        for j in range(1, len(l)):
            l[j] += l[j-1]
        tmp[i] = [0] + l

    # for i in range(4):
    #     print(tmp[i][:10])

    ans = 0
    for i in range(len(tmp[0])):
        for j in range(len(tmp[1])):
            for k in range(len(tmp[2])):
                for l in range(len(tmp[3])):
                    weight = base_w * i + (base_w + 1) * j + (base_w + 2) * k + (base_w + 3) * l
                    if weight <= W:
                        val = tmp[0][i] + tmp[1][j] + tmp[2][k] + tmp[3][l]
                        if ans < val:
                            ans = val
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline

def main():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for i in range(N)]

    base_w = wv[0][0]
    dic = {wv[0][0]:[], wv[0][0]+1:[], wv[0][0]+2:[], wv[0][0]+3:[]}
    for i in range(N):
        w, v = wv[i]
        dic[w].append(v)
    
    wv = list(dic.items())
    tmp = [[0] for i in range(4)]
    for i in range(4):
        num, l = wv[i]
        l = sorted(l, reverse=True)
        for j in range(1, len(l)):
            l[j] += l[j-1]
        tmp[i] += l


    ans = 0
    for i in range(len(tmp[0])):
        now_w = base_w * i
        # if now_w > W:
        #     break
        for j in range(len(tmp[1])):
            now_w1 = now_w + (base_w + 1) * j
            # if now_w > W:
            #     break
            for k in range(len(tmp[2])):
                now_w2 = now_w1 + (base_w + 2) * k
                # if now_w > W:
                #     break
                for l in range(len(tmp[3])):
                    now_w3 = now_w2 + (base_w + 3) * l
                    if now_w3 > W:
                        break
                    else:
                        val = tmp[0][i] + tmp[1][j] + tmp[2][k] + tmp[3][l]
                        if ans < val:
                            ans = val
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline

def main():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for i in range(N)]

    MAX_ = (wv[0][0] + 3) * N

    dp = np.zeros((N+1, min(W, MAX_) + 1), dtype=int)

    for i in range(1, N+1):
        w, v = wv[i-1]
        dp[i] = dp[i-1]
        dp[i, w:] = np.maximum(dp[i, w:], dp[i, :-w] + v)
    # print(dp)
    print(dp[-1][-1])
    


if __name__ == "__main__":
    main()
Problem p03998 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    a = input().strip() + "w"
    b = input().strip() + "w"
    c = input().strip() + "w"

    i, j, k = 0, 0, 0
    now = "a"
    while True:
        # print(now, i, j, k)
        if now == "a":
            now = a[i]
            i += 1
            if now == "w":
                win = "a"
                break
        elif now == "b":
            now = b[j]
            j += 1
            if now == "w":
                win = "b"
                break
        else:
            now = c[k]
            k += 1
            if now == "w":
                win = "c"
                break

    if win == "a":
        print("A")
    elif win == "b":
        print("B")
    else:
        print("C")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    sa = input().strip()
    sb = input().strip()
    sc = input().strip()
    
    rest_a = 0
    rest_b = 0
    rest_c = 0
    rest_a += 1
    next_ = sa[0]
    while True:
        if next_ == "a":
            if rest_a == len(sa) - 1:
                print("A")
                break
            else:
                next_ = sa[rest_a]
                rest_a += 1
        elif next_ == "b":
            if rest_b == len(sb) - 1:
                print("B")
                break
            else:
                next_ = sb[rest_b]
                rest_b += 1
        elif next_ == "c":
            if rest_c == len(sc) - 1:
                print("C")
                break
            else:
                next_ = sc[rest_c]
                rest_c += 1

if __name__ == "__main__":
    main()
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
S_len = len(S)
 
if S_len+1 == len(T) and S == T[:S_len:1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
int main() {
	string s,t;
	cin>>s>>t;
	for(char c='a';c<='z';c++)
		if(s+c==t) puts("Yes"),exit(0);
	puts("No"); 
	return 0;
}
Problem p02718 (python)

Fixed submission:
N, M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
S = sum(A)
if A[M-1] >= S / (4*M):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
 N, M = map(int,input().split())
 A = list(map(int,input().split()))
 S = sum(A)
 cnt = 0
 for a in A:
    if a >= S / (4*M):
      cnt += 1
 if cnt >= M:
  print("Yes")
 else:
  print("No")
Problem p03167 (python)

Fixed submission:
n , m = map(int , input().split())
dp = []
for i in range(n + 1):
    dp.append([])
    for j in range(m + 1):
        dp[i].append(0)
arr = []
for i in range(n):
    arr.append(input())
dp[1][1] = 1
for i in range(1,n + 1):
    for j in range(1,m + 1):
        if arr[i - 1][j - 1] == '#' or (i == 1 and j == 1):
            continue
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
print(dp[n][m] % 1000000007)

Buggy submission (verdict: Runtime Error):
n , m = map(int , input().split())
dp = []
for i in range(n + 1):
    dp.append([])
    for j in range(m + 1):
        dp[i].append(0)
arr = []
for i in range(n):
    arr.append(input())
dp[1][1] = 1
for i in range(1,n + 1):
    for j in range(1,m + 1):
        if arr[i - 1][j - 1] == '#' or (i == 1 and j == 1):
            continue
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
print(dp[n][m] % 1000000007
Problem p03200 (python)

Fixed submission:
s = input()
 
n = len(s)
 
ans = 0
 
cunt = 0
 
for i in range(n):
    if s[i] == "B":
        cunt += 1
    else:
        ans += cunt
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
 
n = len(s)
 
ans = 0
 
cunt = 0
 
for i in range(n):
    if s[i] == "B":
        cnt += 1
    else:
        ans += cunt
print(ans)
Problem p03567 (python)

Fixed submission:
S = input()
if "AC" in S:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
odd_cand = 1
ans = 1
for i in A:
    if i%2==0:
        odd_cand *= 2
    ans *= 3
 
print(ans - odd_cand)
Problem p03633 (python)

Fixed submission:
from fractions import gcd

N = int(input())
T = [int(input()) for i in range(N)]
_lcm = 1
for T_i in T:
    _lcm = _lcm * T_i // gcd(_lcm, T_i)

print(_lcm)

Buggy submission (verdict: Runtime Error):
import fraction

N = int(input())
T = [int(input()) for i in range(N)]
_lcm = 1
for T_i in T:
    _lcm = _lcm * T_i // fraction.gcd(_lcm, T_i)

print(_lcm)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
T = [int(input()) for i in range(N)]
_lcm = 1
for T_i in T:
    _lcm = _lcm * T_i // math.gcd(_lcm, T_i)

print(_lcm)
Problem p03280 (python)

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

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

print((S-1)*(T-1))
Problem p02681 (python)

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

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

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

T_=slice(T[:-1])

if (S==T_):
    print("Yes")
elif:
    print("No")