Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# ARC073D - Simple Knapsack (ABC060D)
def knapsack_heavy(W: int, weight: "Array[int]", value: "Array[int]") -> int:
    lim = sum(value)
    dp = [0] + [float("inf")] * lim  # dp[i] := minimum weight at value i
    for w, v in zip(weight, value):
        for cur_v in range(lim, v - 1, -1):
            dp[cur_v] = min(dp[cur_v], dp[cur_v - v] + w)
    ret = max(v for v, w in enumerate(dp) if w <= W)
    return ret


def main():
    N, W, *A = map(int, open(0).read().split())
    weight, value = A[::2], A[1::2]
    ans = knapsack_heavy(W, weight, value)
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
# ARC073D - Simple Knapsack (ABC060D)
from itertools import accumulate


def main():
    N, W, *A = map(int, open(0).read().split())
    V, x = [[] for _ in range(4)], A[0]  # x: w1 (W1 ≤ wi ≤ w1 + 3)
    for i in range(0, 2 * N, 2):
        w, v = A[i : i + 2]
        V[w - x] += [v]
    for i in range(4):
        V[i] = tuple(accumulate([0] + sorted(V[i], reverse=1)))
    L = [len(v) for v in V]
    ans = 0
    for i in range(L[0]):
        for j in range(L[1]):
            for k in range(L[2]):
                w = i * x + j * (x + 1) + k * (x + 2)
                if w > W:
                    break
                l = min(L[3] - 1, (W - w) // (x + 3))
                v = V[0][i] + V[1][j] + V[2][k] + V[3][l]
                ans = max(ans, v)
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
# ARC073D - Simple Knapsack (ABC060D)
def knapsack_heavy(W: int, weight: "Array[int]", value: "Array[int]") -> int:
    lim = sum(value)
    dp = [0] + [float("inf")] * lim  # dp[i] := minimum weight at value i
    for w, v in zip(weight, value):
        for cur_v in range(lim, v - 1, -1):
            dp[cur_v] = min(dp[cur_v], dp[cur_v - v] + w)
    ret = max(v for v, w in enumerate(dp) if w <= W)
    return ret


def main():
    N, W, *A = map(int, open(0).read().split())
    weight, value = A[::2], A[1::2]
    ans = knapsack_heavy(W, weight, value)
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
# ARC073D - Simple Knapsack (ABC060D)
from itertools import accumulate


def main():
    N, W, *A = map(int, open(0).read().split())
    V, x = [[] for _ in range(4)], A[0]  # x: w1 (W1 ≤ wi ≤ w1 + 3)
    for i in range(0, 2 * N, 2):
        w, v = A[i : i + 2]
        V[w - x] += [v]
    for i in range(4):
        V[i] = tuple(accumulate([0] + sorted(V[i], reverse=1)))
    L = [len(v) for v in V]
    ans = 0
    for i in range(L[0]):
        for j in range(L[1]):
            for k in range(L[2]):
                w = i * x + j * (x + 1) + k * (x + 2)
                if w > W:
                    break
                l = min(L[3] - 1, (W - w) // (x + 3))
                v = V[0][i] + V[1][j] + V[2][k] + V[3][l]
                ans = max(ans, v)
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# ARC069D - Menagerie (ABC055D)
def check(a: int, b: int) -> list:
    ret, cur, prev = [], a, b
    for i in S:
        ret += [cur]
        if cur ^ (i == "o"):  # oSo or oWx
            prev, cur = cur, prev ^ 1  # both neighbors are different
        else:  # oSx or oWo
            prev, cur = cur, prev  # both are the same
    flg = cur == a and prev == b  # check the consistency of input and result
    return ret if flg else []


def main():
    global S
    N = int(input())
    S = input().rstrip()
    for a in range(2):
        for b in range(2):
            x = check(a, b)
            if x:
                ans = "".join("S" if i else "W" for i in ans)
                print(ans)
                return
    print(-1)


if __name__ == "__main__":
    main()

Fixed submission:
# ARC069D - Menagerie (ABC055D)
def check(a: str, b: str) -> str:
    ret, cur, prev = "", a, b
    for i in S:
        ret += cur
        if (cur == "S" and i == "o") or (cur == "W" and i == "x"):
            prev, cur = cur, prev
        elif (cur == "S" and i == "x") or (cur == "W" and i == "o"):
            x = "W" if prev == "S" else "S"
            prev, cur = cur, x
    flg = cur == a and prev == b
    return ret if flg else ""


def main():
    global S
    N = int(input())
    S = input().rstrip()
    for a in ("S", "W"):
        for b in ("S", "W"):
            ans = check(a, b)
            if ans:
                print(ans)
                return
    print(-1)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
# ABC053B - A to Z String
s = list(input())
while s[0] != 'A':
    s.pop(0)
while s[-1] != 'Z':
    s.pop()
print(len(s))

Fixed submission:
# ABC053B - A to Z String
s = list(input())
i = 0
while s[i] != "A":
    i += 1
j = 1
while s[-j] != "Z":
    j += 1
print(len(s) - i - j + 1)

Buggy python submission (verdict: Time Limit Exceeded):
# ABC053B - A to Z String
s = list(input())
while s[0] != 'A':
    s.pop(0)
while s[-1] != 'Z':
    s.pop()
print(len(s))

Fixed submission:
# ABC053B - A to Z String
s = list(input())
i = 0
while s[i] != "A":
    i += 1
j = 1
while s[-j] != "Z":
    j += 1
print(len(s) - i - j + 1)
Buggy python submission (verdict: Runtime Error):
# AGC009A - Multiple Array
def main():
    N, *AB = map(int, open(0).read().split())
    ans = 0
    for i, j in zip(*[iter(A[::-1])] * 2):  # decide from the last one greedily
        ans += -(i + ans) % j
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
# AGC009A - Multiple Array
import sys
input = sys.stdin.readline


def main():
    # decide from the last one
    n = int(input())
    A = tuple(tuple(map(int, input().split())) for _ in range(n))
    ans = 0
    for i, j in A[::-1]:
        if i == 0 or j == 1:
            continue
        r = (i + ans) % j
        if r != 0:
            ans += j - (i + ans) % j
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# ABC052B - Increment Decrement
def main():
    _, S = tuple(input() for _ in range(2))
    ans, x = [0], 0
    for i in S:
        x += 1 i == "I" else -1
        ans += [x]
    print(max(ans))


if __name__ == "__main__":
    main()

Fixed submission:
# ABC052B - Increment Decrement
_ = int(input())
s = input()
x = 0
lst = [0]
for i in s:
    if i == "I":
        x += 1
    else:
        x -= 1
    lst.append(x)
print(max(lst))
Buggy python submission (verdict: Runtime Error):
# AGC008A - Simple Calculator
def main():
    x, y = tuple(map(int, input().rstrip().split()))
    xs, ys = x >= 0, y >= 0
    dif = abs(abs(x) - abs(y))
    if x, y = 1000000000, 1:
        print(1000000001)
        return
    if abs(x) == abs(y):  # <-> x == y <-> y - x = 0
        if x == y:
            ans = 0
        else:
            ans = 1
    elif 0 <= x < y:
        ans = y - x
    elif 0 <= y < x:
        ans = 1 + dif
    elif x < y < 0:
        ans = y - x
    elif y < x < 0:
        ans = 1 + dif + 1  # -a -> a -> b -> -b
    elif x < 0 <= y:
        ans = dif + 1
        ans -= 1 if y == 0 else 0
    else:  # y < 0 <= x
        ans = dif + 1
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
# AGC008A - Simple Calculator
def main():
    x, y = tuple(map(int, input().rstrip().split()))
    xs, ys = x >= 0, y >= 0
    dif = abs(abs(x) - abs(y))
    if x == 1000000000 and y == 1:
        print(1000000001)
        return

    if abs(x) == abs(y):  # <-> x == y <-> y - x = 0
        if x == y:
            ans = 0
        else:
            ans = 1
    elif 0 <= x < y:
        ans = y - x
    elif 0 <= y < x:
        ans = 1 + dif
    elif x < y < 0:
        ans = y - x
    elif y < x < 0:
        ans = 1 + dif + 1  # -a -> a -> b -> -b
    elif x < 0 <= y:
        ans = dif + 1
        ans -= 1 if y == 0 else 0
    else:  # y < 0 <= x
        ans = dif + 1
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# cf16-finalA - Where's Snuke?
def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = "ABCDEFGHIJ"
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return


if __name__ == "__main__":
    main()

Fixed submission:
# cf16-finalA - Where's Snuke?
from string import ascii_uppercase


def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = ascii_uppercase
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
# cf16-finalA - Where's Snuke?
def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = "ABCDEFGHIJ"
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return
    else:
        print(A)


if __name__ == "__main__":
    main()

Fixed submission:
# cf16-finalA - Where's Snuke?
from string import ascii_uppercase


def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = ascii_uppercase
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# ABC047A - キャンディーと2人の子供 / Fighting over Candies
a, b, c = sorted(list(map(int, input().rstrip().split())))
print("Yes" if a + B == c else "No")

Fixed submission:
# ABC047A - キャンディーと2人の子供 / Fighting over Candies
a, b, c = sorted(list(map(int, input().rstrip().split())))
print("Yes" if a + b == c else "No")
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline()

s = input()
n = len(s)

total_sum = 0
# +を挿入する事象は
# sが2文字なら2通り,3文字なら4通り,n文字なら2^(n-1)通りある
for i in range(2 ** (n - 1)):
    # iは各桁に+を挿入するかどうかを決定する
    # 例えば s=12345, i=0b0111, ss=1+2+3+45
    now_sum = 0
    reg = int(s[0])
    for j in range(n - 1):
        if i & 1 << j:
            now_sum += reg
            reg = 0
        reg *= 10
        reg += int(s[j + 1])
    now_sum += reg

    total_sum += now_sum

print(total_sum)


Fixed submission:
# ARC061C - たくさんの数式 / Many Formulas (ABC045C)
from itertools import product


def main():
    s = input()
    ans = 0
    ops = tuple(product(("", "+"), repeat=len(s) - 1))
    for op in ops:
        e = ""
        for i in range(len(s) - 1):
            e += s[i] + op[i]
        e += s[-1]
        ans += eval(e)
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# keyence2019C - Exam and Wizard
def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))
    dif = sorted(i - j for i, j in zip(A, B))
    ans, shortage = 0, 0
    for i in dif:
        if i < 0:
            ans += 1
            shortage += i
        else:
            break
    for i in dif[::-1]:
        if shortage >= 0:
            print(ans)
            return
        ans += 1
        shortage += i
    print(-1)


if __name__ == "__main__":
    main()

Fixed submission:
# AGC003B - Simplified mahjong
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, [input() for _ in range(N)]))
    ans = 0
    for i in range(N - 1):  # make pairs greedily
        ans += A[i] // 2  # pairs with same cards
        if A[i] % 2 and A[i + 1]:  # pairs with a neighbor
            ans += 1
            A[i + 1] -= 1
    ans += A[-1] // 2  # pairs with the same cards in the last one
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
"""
fast way to compute a combination using inverse factorials
O(N) to construct tables -> O(1) to compute each combination
"""
from typing import List, Tuple


def get_fact(lim: int) -> List[int]:
    """Compute a table of factorials (1-indexed)."""
    fact = [1] * (lim + 1)
    x = 1
    for i in range(1, lim + 1):
        x = (x * i) % MOD
        fact[i] = x
    return fact


def get_inv(lim: int) -> List[int]:
    """Compute a table of inverse factorials (1-indexed)."""
    inv = [1] * (lim + 1)
    inv[lim] = pow(fact[lim], MOD - 2, MOD)
    x = inv[lim]
    for i in range(lim - 1, 0, -1):
        x = (x * (i + 1)) % MOD
        inv[i] = x
    return inv


def get_fact_and_inv(lim: int) -> Tuple[List[int], List[int]]:
    """Compute tables of factorials and inverse factorials (1-indexed)."""
    fact = [0] * (lim + 1)
    fact[0] = 1
    x = 1
    for i in range(1, lim + 1):
        x = (x * i) % MOD
        fact[i] = x

    inv = [1] * (lim + 1)
    inv[-1] = pow(fact[-1], MOD - 2, MOD)
    x = inv[-1]
    for i in range(lim - 1, 0, -1):
        x = (x * (i + 1)) % MOD
        inv[i] = x
    return fact, inv


def comb(n: int, r: int) -> int:
    """Compute nCr (n! / r!(n - r)!)."""
    return fact[n] * inv[r] * inv[n - r]


# e.g. ARC058D - いろはちゃんとマス目 / Iroha and a Grid (ABC042D)
def main():
    global MOD, fact, inv
    H, W, A, B = tuple(map(int, input().split()))
    MOD = 10 ** 9 + 7
    fact = get_fact(H + W)
    inv = get_inv(H + W)
    x, y, a = H - A - 1, W + A - 2, A - 1  # fixed variables
    ans = sum(comb(x + i, i) * comb(y - i, a) for i in range(B, W)) % MOD
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
# ARC058D - いろはちゃんとマス目 / Iroha and a Grid (ABC042D)
def comb(n: int, r: int) -> int:
    return fact[n] * inv[n - r] * inv[r]


def main():
    global fact, inv
    H, W, A, B = tuple(map(int, input().split()))
    MOD = 10 ** 9 + 7
    # table of factorials
    fact, x = [1] * (H + W + 1), 1
    for i in range(1, H + W + 1):
        x = (x * i) % MOD
        fact[i] = x
    # table of inverse factorials
    inv = [1] * (H + W + 1)
    inv[-1] = pow(fact[-1], MOD - 2, MOD)
    x = inv[-1]
    for i in range(H + W - 1, 0, -1):
        x = (x * (i + 1)) % MOD
        inv[i] = x

    ans = 0
    for i in range(B, W):
        ans += comb(i + H - A - 1, i) * comb(W - i - 1 + A - 1, A - 1)
    print(ans % MOD)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
def main():
    N, L, A = map(int, open(0).read().split())
    A.sort()
    print("".join(A))


if __name__ == "__main__":
    main()

Fixed submission:
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
n, l = list(map(int, input().rstrip().split()))
lst = sorted([input().rstrip() for _ in range(n)])
for i in lst:
    print(i, end="")

Buggy python submission (verdict: Runtime Error):
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
def main():
    N, L, A = map(int, open(0).read().split())
    A.sort()
    print("".join(map(str, A)))


if __name__ == "__main__":
    main()

Fixed submission:
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
n, l = list(map(int, input().rstrip().split()))
lst = sorted([input().rstrip() for _ in range(n)])
for i in lst:
    print(i, end="")
Buggy python submission (verdict: Time Limit Exceeded):
# ABC042D - いろはちゃんとマス目 / Iroha and a Grid (ARC058D)
def main():
    H, W, A, B = tuple(map(int, input().split()))
    a = H - A + 1
    MOD = 10 ** 9 + 7
    prev, cur = [0] * (W + 1), [0] * (W + 1)
    cur[0] = 1
    for i in range(1, H + 1):
        for j in range(1, W + 1):
            if i >= a and j <= B:
                continue
            cur[j] = (prev[j] + cur[j - 1]) % MOD
        if i != H:
            prev, cur = cur, [0] * (W + 1)
    print(cur[-1])


if __name__ == "__main__":
    main()

Fixed submission:
# ABC042D - いろはちゃんとマス目 / Iroha and a Grid (ARC058D)
def comb(n: int, r: int) -> int:
    return fact[n] * inv[n - r] * inv[r]


def main():
    global fact, inv
    H, W, A, B = tuple(map(int, input().split()))
    MOD = 10 ** 9 + 7
    # table of factorials
    fact, x = [1] * (H + W + 1), 1
    for i in range(1, H + W + 1):
        x = (x * i) % MOD
        fact[i] = x
    # table of inverse factorials
    inv = [1] * (H + W + 1)
    inv[-1] = pow(fact[-1], MOD - 2, MOD)
    x = inv[-1]
    for i in range(H + W - 1, 0, -1):
        x = (x * (i + 1)) % MOD
        inv[i] = x

    ans = 0
    for i in range(B, W):
        ans += comb(i + H - A - 1, i) * comb(W - i - 1 + A - 1, A - 1)
    print(ans % MOD)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
ans = 1
for i in l:
  ans *= i
if ans > 1e18:
  print(-1)
else:
  print(ans)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
ans = 1
for i in l:
  if i == 0:
    ans = 0

for i in l:
  ans *= i
  if ans > 1e18 or ans == 0:
    break
if ans > 1e18:    
  print(-1)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
k = input()
a = input()
b = input()

b = (b / k) * k

if a <= b :
    print("OK")
else:
    print("NG")



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

x = a//k
y = b//k

if y - x == 0:
    if a%k == 0:
        print('OK')
    else:
        print('NG')
else:
    print('OK')
Buggy python submission (verdict: Runtime Error):
#A
S = input()
T = input()
Slist = list(S)
Tlist = list(T)
count = 0
for k in range len(Slist):
    if Slist[k] == Tlist[k]:
        count += 1
if count == len(Slist):
    print('Yes')
else:
    print('No')

Fixed submission:
#A
S = input()
T = input()
Slist = list(S)
Tlist = list(T)
count = 0
for k in range (len(Slist)):
    if Slist[k] == Tlist[k]:
        count += 1
if count == len(Slist):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
Xs = input()
Xlist = Xs.split(' ')
anslist = []
for P in range(int(Xlist[0]),int(Xlist[N - 1])+1):
    ans = 0
    for i in range(len(Xlist)):
        ans = ans + (int(Xlist[i]) - P)**2
    anslist.append(ans)
print(min(anslist))

Fixed submission:
N = int(input())
Xs = input()
Xlist = Xs.split(' ')
Xlist.sort()
anslist = []
if len(set(Xlist)) != 1:
    for P in range(int(Xlist[0]),int(Xlist[N - 1])+1):
        ans = 0
        for i in range(len(Xlist)):
            ans = ans + (int(Xlist[i]) - P)**2
        anslist.append(ans)
    print(min(anslist))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
Ai = input()
Ai = Ai.split(' ')
ans = 'APPROVED'
for moji in Ai:
    if moji % 2 != 0:
        pass
    else:
        if (moji % 3 == 0) or (moji % 5 == 0):
            pass
        else:
            ans = 'DENIED'
            break
print(ans)


Fixed submission:
N = int(input())
Ai = input()
Ai = Ai.split(' ')
ans = 'APPROVED'
for moji in Ai:
    moji = int(moji)
    if moji % 2 != 0:
        pass
    else:
        if (moji % 3 == 0) or (moji % 5 == 0):
            pass
        else:
            ans = 'DENIED'
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
list1 = input()
list1 = list1.split(' ')
S = list1[0]
T = list1[1]
lenS = int(list1[2])
lenT = int(list1[3])
select = list1[4]
if select == S:
    lenS -= 1
else:
    lenT -= 1
print(lenS,lenT)

Fixed submission:
list1 = input()
list2 = input()
list3 = input()
nlist1 = list1.split(' ')
nlist2 = list2.split(' ')
S = nlist1[0]
T = nlist1[1]
lenS = int(nlist2[0])
lenT = int(nlist2[1])
select = list3
if select == S:
    lenS -= 1
elif select == T:
    lenT -= 1
print(lenS,lenT)

Buggy python submission (verdict: Runtime Error):
list1 = input()
list1 = list1.split(' ')
S = list1[0]
T = list1[1]
lenS = int(list1[2])
lenT = int(list1[3])
select = list1[4]
if select == S:
    lenS -= 1
else:
    lenT -= 1
print(lenS,lenT)

Fixed submission:
list1 = input()
list2 = input()
list3 = input()
nlist1 = list1.split(' ')
nlist2 = list2.split(' ')
S = nlist1[0]
T = nlist1[1]
lenS = int(nlist2[0])
lenT = int(nlist2[1])
select = list3
if select == S:
    lenS -= 1
elif select == T:
    lenT -= 1
print(lenS,lenT)

Buggy python submission (verdict: Runtime Error):
list1 = input()
list1 = list1.split(' ')
S = list1[0]
T = list1[1]
lenS = int(list1[2])
lenT = int(list1[3])
select = list1[4]
if select == S:
    lenS -= 1
else:
    lenT -= 1
print(lenS,lenT)

Fixed submission:
list1 = input()
list2 = input()
list3 = input()
nlist1 = list1.split(' ')
nlist2 = list2.split(' ')
S = nlist1[0]
T = nlist1[1]
lenS = int(nlist2[0])
lenT = int(nlist2[1])
select = list3
if select == S:
    lenS -= 1
elif select == T:
    lenT -= 1
print(lenS,lenT)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
inputA = input()
listA = inputA.split(' ')
count = 0
for num in listA:
    k = listA.count(num)
    if k != 1:
        print('NO')
        break
    else:
        count += 1
if count == N:
    print('YES')

Fixed submission:
N = int(input())
inputA = input()
listA = inputA.split(' ')
listA.sort()
output = 'YES'
for i in range (len(listA) - 1):
    if listA[i] == listA[i + 1]:
        output = 'NO'
print(output)

Buggy python submission (verdict: Time Limit Exceeded):
N = input()
inp = input()
listA = inp.split(' ')
count = 0
for moji in listA:
    youso = listA.count(moji)
    if youso == 1:
        count += 1
    else:
        print('NO')
        break
if count == len(listA):
    print('YES')

Fixed submission:
N = int(input())
inputA = input()
listA = inputA.split(' ')
listA.sort()
output = 'YES'
for i in range (len(listA) - 1):
    if listA[i] == listA[i + 1]:
        output = 'NO'
print(output)

Buggy python submission (verdict: Runtime Error):
N = input()
inp = input()
listA = inp.split(' ')
count = 0
for moji in lintA:
  youso = listA.count(moji)
  if youso == 1:
    count += 1
  else:
    print('NO')
    break
if count == len(listA):
  print('YES')

Fixed submission:
N = int(input())
inputA = input()
listA = inputA.split(' ')
listA.sort()
output = 'YES'
for i in range (len(listA) - 1):
    if listA[i] == listA[i + 1]:
        output = 'NO'
print(output)

Buggy python submission (verdict: Time Limit Exceeded):
N = input()
inp = input()
listA = inp.split(' ')
out = 'YES'
for k in listA:
    count = 0
    for j in listA:
        if k == j:
            count += 1
            if count >= 2:
                out = 'NO'
                break
print(out)

Fixed submission:
N = int(input())
inputA = input()
listA = inputA.split(' ')
listA.sort()
output = 'YES'
for i in range (len(listA) - 1):
    if listA[i] == listA[i + 1]:
        output = 'NO'
print(output)

Buggy python submission (verdict: Runtime Error):
N = input()
inp = input()
listA = inp.split(' ')
out = YES
for k in listA:
  count = 0
  for j in listA:
    if k == j:
      count += 1
      if count >= 2:
        out = NO
        break
print(out)
  

Fixed submission:
N = int(input())
inputA = input()
listA = inputA.split(' ')
listA.sort()
output = 'YES'
for i in range (len(listA) - 1):
    if listA[i] == listA[i + 1]:
        output = 'NO'
print(output)
Buggy python submission (verdict: Runtime Error):
inp = input()
a, b = input().split()
a = int(a)
b = float(b)
b100 = int(b*100)
ans100 = a * b100
ans = a/100
print(ans)

Fixed submission:
from math import floor
inp = input()
a, b = inp.split()
b += '00000001'
a = int(a)
b = float(b)
b100 = int(b * 100)
ans100 = a * b100
ans = ans100 // 100
print(ans)
Buggy python submission (verdict: Runtime Error):
r = int(input())
p = 22/7
print(2*pi*r)

Fixed submission:
r = int(input())
pi = 22/7
print(2*pi*r)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x = 1:
    print(0)
elif x = 0:
    print(1)


Fixed submission:
x = int(input())
if x == 1:
    print(0)
elif x == 0:
    print(1)

Buggy python submission (verdict: Runtime Error):
x = int(input())
if x != 1:
  return 0
elif x != 0:
  return 1


Fixed submission:
x = int(input())
if x == 1:
    print(0)
elif x == 0:
    print(1)

Buggy python submission (verdict: Runtime Error):
x=int(input())
if(x==1):
  print(0)
 elif(x==0):
  print(1)

Fixed submission:
x=int(input())
if(x==1):
  print(0)
elif(x==0):
  print(1)