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

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))
f = [0] * n
r = [0] * n
for i in range(n):
    if i == 0:
        f[i] = a[i]
        r[-i-1] = a[-i-1]
    else:
        f[i] = fractions.gcd(f[i-1], a[i])
        r[-i-1] = fractions.gcd(r[-i], a[-i-1])
f.insert(0, 0)
r.append(0)
ans = 0
for i in range(len(f) - 1):
    ans = max(ans, fractions.gcd(f[i], r[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))
b = [0] * 3
c = [0] * 3
for i in range(len(a)):
    if i == 0:
        b[i] = a[i]
        c[-i-1] = a[-i-1]
    else:
        b[i] = fractions.gcd(a[i], b[i-1])
        c[-i-1] = fractions.gcd(a[-i-1], c[-i])
b.insert(0, 0)
c.append(0)
m_gcd = 0
print(b, c)
for i in range(len(b)-2):
    m_gcd = max(fractions.gcd(c[i+1], b[i]), m_gcd)
print(m_gcd)

Buggy submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))
b = [0] * 3
c = [0] * 3
for i in range(len(a)):
    if i == 0:
        b[i] = a[i]
        c[-i-1] = a[-i-1]
    else:
        b[i] = fractions.gcd(a[i], b[i-1])
        c[-i-1] = fractions.gcd(a[-i-1], c[-i])
b.insert(0, 0)
c.append(0)
m_gcd = 0
for i in range(len(b)-1):
    m_gcd = max(fractions.gcd(c[i+1], b[i]), m_gcd)
print(m_gcd)
Problem p03150 (python)

Fixed submission:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    s = list(str(input().rstrip('\n')))
    for i in range(len(s)):
        for j in range(i + 1, len(s)):
            if "".join(s[:i + 1] + s[j:]) == "keyence":
                print("YES")
                exit()
    print("NO")


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    d = collections.deque(list("keyence"))
    s = str(input().rstrip('\n'))
    for i in range(len(s)):
        if len(p) == 0:
            break
        else:
            p = d.popleft()
            if p != s[i]:
                d.appendleft(p)
    print("YES" if len(d) == 0 else "NO")


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    d = collections.deque(list("keyence"))
    s = str(input().rstrip('\n'))
    for i in range(len(s)):
        p = d.popleft()
        if p != s[i]:
            d.appendleft(p)
    print("YES" if len(d) == 0 else "NO")


if __name__ == '__main__':
    solve()
Problem p03164 (python)

Fixed submission:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, w = list(map(int, readline().split()))
    wv = [list(map(int, readline().split())) for _ in range(n)]
    dp = [10 ** 10] * (10 ** 3 * n + 1)
    dp[0] = 0
    max_v = 0
    for ww, vv in wv:
        for i in range(max_v, -1, -1):
            dp[i+vv] = min(dp[i+vv], dp[i] + ww)
            max_v = max(max_v, i+vv)
    mt = 0
    for i in range(len(dp)):
        if dp[i] <= w:
            mt = max(mt, i)
    print(mt)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, w = list(map(int, readline().split()))
    wv = [list(map(int, readline().split())) for _ in range(n)]
    dp = [0] * (w + 1)
    for ww, vv in wv:
        for i in range(w-ww+1, -1, -1):
            if i + ww <= w:
                dp[i+ww] = max(dp[i+ww], dp[i] + vv)
    print(dp[-1])


if __name__ == '__main__':
    solve()
Problem p03213 (python)

Fixed submission:
def slove():
    import sys
    import collections
    input = sys.stdin.readline

    n = int(input().rstrip('\n'))
    ls = []

    for i in range(1, n + 1):
        t = i
        for j in range(2, int(t ** 0.5) + 1):
            while True:
                if t % j == 0:
                    t //= j
                    ls.append(j)
                else:
                    break
        if t > 1:
            ls.append(t)

    ls = collections.Counter(ls)
    ls2 = []

    for k, v in ls.items():
        if v >= 74:
            ls2.append(75)
        if v >= 24:
            ls2.append(25)
        if v >= 14:
            ls2.append(15)
        if v >= 4:
            ls2.append(5)
        if v >= 2:
            ls2.append(3)

    ls2 = collections.Counter(ls2)
    cnt = 0
    cnt += (ls2[75])
    cnt += (ls2[25] * max(ls2[3]-1, 0))
    cnt += (ls2[15] * max(ls2[5]-1, 0))
    cnt += (ls2[5] * max(ls2[5]-1, 0) * max(ls2[3]-2, 0) // 2)
    print(cnt)


if __name__ == '__main__':
    slove()

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

    n = int(input().rstrip('\n'))
    ls = []

    for i in range(1, n + 1):
        t = i
        for j in range(2, int(t ** 0.5) + 1):
            while True:
                if t % j == 0:
                    t //= j
                    ls.append(j)
                else:
                    break
        if t > 1:
            ls.append(t)

    ls = collections.Counter(ls)
    ls2 = []

    for k, v in ls.items():
        if v >= 74:
            ls2.append(75)
        if v >= 24:
            ls2.append(25)
        if v >= 14:
            ls2.append(15)
        if v >= 4:
            ls2.append(5)
        if v >= 2:
            ls2.append(3)

    ls2 = collections.Counter(ls2)
    cnt = 0s2[3]-1, 0))
    cnt += (ls2[15] * max(ls2[5]-1, 0))
    cnt += (ls2[5] * max(ls2[5]-1, 0) * max(ls2[3]-2, 0) // 2)
    print(cnt)


if __name__ == '__main__':
    slove()
Problem p03231 (python)

Fixed submission:
import fractions
n, m = map(int, input().split())
s = input()
t = input()
gcd = fractions.gcd(n, m)
lcm = n * m // gcd
o = lcm // gcd
for i in range(gcd):
    if s[i * lcm // m] != t[i * lcm // n]:
        print(-1)
        exit()
print(lcm)

Buggy submission (verdict: Runtime Error):
import fractions
n, m = map(int, input().split())
s = input()
t = input()
lcm = n * m // fractions.gcd(n, m)
sl = [""] * lcm
for i in range(len(s)):
    temp = i * lcm // n
    sl[temp] = s[i]
for i in range(len(t)):
    temp = i * lcm // m
    if sl[temp] != "" and sl[temp] != t[i]:
        print(-1)
        exit()
print(lcm)
Problem p03241 (python)

Fixed submission:
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    md = 1
    for i in range(1, int(m ** 0.5) + 1):
        if m % i == 0:
            if n <= m // i:
                md = max(md, i)
            if n <= i:
                md = max(md, m // i)
    print(md)


if __name__ == '__main__':
    slove()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    md = 1
    for i in range(1, (m // n + 1) ** 0.5 + 1):
        if m % i == 0:
            md = max(md, i)
    print(md)


if __name__ == '__main__':
    slove()
Problem p03244 (python)

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
o = []
e = []
for i, va in enumerate(v):
    if i % 2 == 0:
        o.append(va)
    else:
        e.append(va)
import collections
o = collections.Counter(o).most_common()
e = collections.Counter(e).most_common()
if o[0][0] == e[0][0]:
    if len(o) == 1 and len(e) == 1:
        print(min(o[0][1], e[0][1]))
    elif len(o) == 1:
        print(n - o[0][1] - e[1][1])
    elif len(e) == 1:
        print(n - o[1][1] - e[0][1])
    else:
        print(n - o[0][1] - max(o[1][1], e[1][1]))
else:
    print(n - o[0][1] - e[0][1])

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
o = []
e = []
for i, va in enumerate(v):
    if i % 2 == 0:
        o.append(va)
    else:
        e.append(va)
import collections
o = collections.Counter(o).most_common()
e = collections.Counter(e).most_common()
if o[0][0] == e[0][0]:
    if len(o) == 1 and len(e) == 1:
        print(min(o[0][1], e[0][1]))
    elif len(o) == 1:
        print(n - o[0][1] - e[1][1])
    elif len(e) == 1:
        print(n - o[1][1] - e[0][1])
    else:
        print(n - o[0][1] - max(n[1][1], e[1][1]))
else:
    print(n - o[0][1] - e[0][1])
Problem p03266 (python)

Fixed submission:
n, k = map(int, input().split())
mod0 = []
mod2 = []
for i in range(1, n + 1):
    if i % k == 0:
        mod0.append(i)
    elif k % 2 == 0 and i % k == k // 2:
        mod2.append(i)
print(len(mod0) * len(mod0) * len(mod0) + len(mod2) * len(mod2) * len(mod2))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
mod0 = []
mod2 = []
for i in range(1, n + 1):
    if i % k == 0:d i % k == k // 2:
        mod2.append(i)
print(len(mod0) * len(mod0) * len(mod0) + len(mod2) * len(mod2) * len(mod2))
Problem p03311 (python)

Fixed submission:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    b = []
    for i, v in enumerate(a):
        b.append(v - (i + 1))
    b.sort()
    t = b[len(b) // 2]
    s = 0
    for i, v in enumerate(a):
        s += abs(v - (t + (i + 1)))
    print(s)


if __name__ == '__main__':
    slove()

Buggy submission (verdict: Runtime Error):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    for i in range(n):
        a[i] -= i + 1
    a.sort()
    t1 = 0
    t2 = 0
        t2 += abs(a[i] - a[n//2 - 1])
    print(min(t1, t2))


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    b = []
    for i, v in enumerate(a):
        b.append(v - (i + 1))
    b.sort()
    t = b[len(b) // 2]
    s = 0
    for i, v in enumerate(a):
        s += abs(v - (t + (i + 1)))
    print(s)


if __name__ == '__main__':
Problem p03362 (python)

Fixed submission:
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    ls = [True] * 100001
    ls[0] = False
    ls[1] = False
    p = collections.deque()
    for i in range(2, 100000):
        if ls[i]:
            p.append(i)
            for j in range(i, 100000, i):
                if ls[j]:
                    ls[j] = False
    ans = []
    while True:
        if len(ans) == n:
            break
        else:
            pv = p.popleft()
            if pv % 5 == 1:
                ans.append(pv)
    print(*ans)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    ls = [True] * 100001
    ls[0] = False
    ls[1] = False
    p = collections.deque()
    for i in range(2, 100000):
        if ls[i]:
            p.append(i)
            for j in range(i, 100000, i):
                if ls[j]:
                    ls[j] = False
    ans = []
    while True:
        if len(ans) == n:
            break
        else:
            if pv % 5 == 1:
                ans.append(pv)
    print(ans)


if __name__ == '__main__':
    solve()
Problem p03412 (python)

Fixed submission:
import sys
import bisect

readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))


def f(md):
    pos = n - 1
    res = 0
    for av in a:
        while True:
            if pos != -1 and av + b[pos] >= md:
                pos -= 1
            else:
                res += pos + 1
                break
    return res


def solve():
    dp = [0] * 31
    for i in range(28, -1, -1):
        md = pow(2, i + 1)
        for j in range(n-1, -1, -1):
            b[j] %= md
            a[j] %= md
        a.sort()
        b.sort()
        res1, res2, res3 = f(md // 2), f(md // 2 * 2), f(md // 2 * 3)
        dp[i] += (n - (res1 + res3 - res2)) % 2
    t = 0
    for i in range(31):
        t += pow(2, i) * (dp[i] % 2)
    print(t)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys

readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))


def f(md, pos):
    res = 0
    fpos = -2
    for av in a:
        while True:
            if pos != -1 and av + b[pos] >= md:
                pos -= 1
            else:
                if fpos == -2:
                    fpos = pos
                res += pos + 1
                break
    return res, fpos


def solve():
    dp = [0] * 31
    for i in range(28, -1, -1):
        md = pow(2, i + 1)
        for j in range(n-1, -1, -1):
            b[j] %= md
            a[j] %= md
        a.sort()
        b.sort()
        pos = n - 1
    for i in range(31):
        t += pow(2, i) * dp[i]
    print(t)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    b = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    aa = []
    bb = []
    for i in range(n):
        if a[i][1] % 2 != 0:
            aa.append(a[i][0])
        if b[i][1] % 2 != 0:
            bb.append(b[i][0])
    t = 0
    for av in aa:
        for bv in bb:
            t = t ^ (av + bv)
    print(t)


if __name__ == '__main__':
    slove()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    b = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    aa = []
    bb = []
    for i in range(n):
        if a[i][1] % 2 != 0:
            aa.append(a[i][0])
        if b[i][1] % 2 != 0:
            bb.append(b[i][0])
    t = 0
    for av in a:
        for bv in b:
            t = t ^ (av + bv)
    print(t)


if __name__ == '__main__':
    slove()
Problem p03436 (python)

Fixed submission:
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    h, w = list(map(int, input().rstrip('\n').split()))
    s = []
    b_cnt = 0
    for i in range(h):
        st = list(str(input().rstrip('\n')))
        s.append(st)
        b_cnt += st.count("#")

    ql = [[0, 0, 0]]
    ql = collections.deque(ql)
    fq = collections.defaultdict(int)
    fq[0, 0] = 1
    m_cost = 10 ** 10
    while True:
        if len(ql) != 0:
            cost, x, y = ql.popleft()
            if x == h - 1 and y == w - 1:
                m_cost = min(m_cost, cost)
            for x, y in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]:
                if 0 <= x < h and 0 <= y < w:
                    if (x, y) not in fq and s[x][y] == ".":
                        ql.append([cost+1, x, y])
                        fq[x, y] += 1
        else:
            break
    if m_cost == 10 ** 10:
        print(-1)
    else:
        print(h * w - b_cnt - m_cost - 1)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    h, w = list(map(int, input().rstrip('\n').split()))
    s = [list(str(input().rstrip('\n'))) for _ in range(h)]
    ql = [[0, 0, 0]]
    ql = collections.deque(ql)
    fq = collections.defaultdict(list)
    fq[0, 0]
    mt = 10 ** 10
    while True:
        if len(ql) != 0:
            cost, xv, yv = ql.popleft()
            if xv == h - 1 and yv == w - 1:
                mt = min(mt, cost)
            for xv, yv in [[xv + 1, yv], [xv - 1, yv], [xv, yv + 1], [xv, yv - 1]]:
                if 0 <= xv < h and 0 <= yv < w:
                    if (xv, yv) not in fq and s[xv, yv] != "#":
                        ql.append([cost + 1, xv, yv])
                        fq[xv, yv]
        else:
            break
    if mt == 10 ** 10:
        print(-1)
    else:
        cnt = 0
        for i in range(h):
            cnt += s[i].count("#")
        print(h * w - cnt - (mt + 1))


if __name__ == '__main__':
    solve()
Problem p03503 (python)

Fixed submission:
import sys
import itertools


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    f = [list(map(int, readline().split())) for _ in range(n)]
    p = [list(map(int, readline().split())) for _ in range(n)]
    mt = - (10 ** 10)
    for it in itertools.product([True, False], repeat=10):
        if sum(it) != 0:
            ls = [0] * n
            for i, iv in enumerate(it):
                for j in range(n):
                    ls[j] += 1 if f[j][i] == 1 and iv else 0
            t = 0
            for i in range(n):
                t += p[i][ls[i]]
            mt = max(mt, t)
    print(mt)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import itertools


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    f = [list(map(int, readline().split())) for _ in range(n)]
    p = [list(map(int, readline().split())) for _ in range(n)]
    mt = - (10 ** 10)
    for it in itertools.product([True, False], repeat=10):
        if sum(it) != 0:
            ls = [0] * n(n):
                    ls[j] += 1 if f[j][i] == 1 and iv else 0
            t = 0
            for i in range(n):
                t += p[i][ls[i]]
            mt = max(mt, t)
    print(mt)


if __name__ == '__main__':
    solve()
Problem p03544 (python)

Fixed submission:
n = int(input())
cnt = 1
l = [2, 1]
if n == 0:
    print(2)
elif n == 1:
    print(1)
else:
    while True:
        cnt += 1
        l.append(l[len(l)-1] + l[len(l)-2])
        if cnt == n:
            print(l[len(l) - 1])
            exit()

Buggy submission (verdict: Runtime Error):
l = [2, 1]
for i in range(2, int(input()) + 1)
    l.append(l[i-1] + l[i-2])
print(l[-1])
Problem p03673 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ls = []
for i in range(0, n, 2):
    ls.append(a[-i-1])
for i in range(0 if n % 2 == 0 else 1, n, 2):
    ls.append(a[i])
print(*ls)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
lsa = []
lsb = []
for i in range(0, n, 2):
    lsa.append(a[-i-1])
for i in range(0 if n % 2 == 0 else 1, n, 2):
    lsb.append(a[i])
print(*lsa, *lsb)
Problem p03696 (python)

Fixed submission:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    t = s
    while True:
        l_len = len(s)
        while True:
            s = s.replace("()", "")
            if len(s) == l_len:
                break
            else:
                l_len = len(s)
        if len(s) == 0:
            print(t)
            exit()
        else:
            if s[0] == ")":
                s = "".join((list("(") + list(s)))
                t = "".join((list("(") + list(t)))
            else:
                s = "".join((list(s)) + list(")"))
                t = "".join((list(t)) + list(")"))


if __name__ == '__main__':
    slove()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    t = s
    while True:
        l_len = len(s)
        while True
            s = s.replace("()", "")
            if len(s) == l_len:
                break
            else:
                l_len = len(s)
        if len(s) == 0:
            print(t)
            exit()
        else:
            if s[0] == ")":
                s = "".join((list("(") + list(s)))
                t = "".join((list("(") + list(t)))
            else:
                s = "".join((list(s)) + list(")"))
                t = "".join((list(t)) + list(")"))


if __name__ == '__main__':
    slove()
Problem p03721 (python)

Fixed submission:
n, k = map(int, input().split())
ab = [list(map(int, input().split()))for _ in range(n)]
ab.sort()
cnt = 0
for a, b in ab:
    cnt += b
    if cnt >= k:
        print(a)
        exit()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    ab = sorted([ist(map(int, input().rstrip('\n').split())) for _ in range(n)])
    t = 0
    for a, b in ab:
        t += b
        if t >= k:
            print(a)
            exit()


if __name__ == '__main__':
    slove()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    ab = [ist(map(int, input().rstrip('\n').split()))]
    ab.sort()
    t = 0
    mt = 0
    for a, b in ab:
        t += b
        if t >= k:
            print(a)
            exit()


if __name__ == '__main__':
    slove()
Problem p03909 (python)

Fixed submission:
def slove():
    import sys
    input = sys.stdin.readline
    d = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    h, w = list(map(int, input().rstrip('\n').split()))
    for i in range(h):
        s = list(map(str, input().rstrip('\n').split()))
        for j in range(w):
            if s[j] == "snuke":
                print(d[j] + str(i+1))
                exit()


if __name__ == '__main__':
    slove()

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    d = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
    h, w = list(map(int, input().rstrip('\n').split()))
    for i in range(h):
        s = list(map(str, input().rstrip('\n').split()))
        for j in range(w):
            if s[j] == "snuke":
                print(d[j] + str(i+1))
                exit()


if __name__ == '__main__':
    slove()
Problem p04033 (python)

Fixed submission:
a, b = map(int, input().split())
if a * b <= 0:
    print("Zero")
elif a > 0 and b > 0:
    print("Positive")
else:
    if (abs(a - b) + 1) % 2 == 0 :
        print("Positive")
    else:
        print("Negative")

Buggy submission (verdict: Runtime Error):
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    lr = [list(map(int, input().rstrip('\n').split())) for _ in range(m)]
    a = [0] * (n + 2)
    for l, r in lr:
        a[l] += 1
        a[r + 1] -= 1
    t = 0
    cnt = 0
    for i in range(1, n + 1):
        t += a[i]
        if t == m:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()
Problem p03302 (python)

Fixed submission:
N = input().split(" ")
a = int(N[0])
b = int(N[1])
if a + b== 15:
    print('+')
elif a * b== 15:
    print('*')
else:
    print('x')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a + b == 15:
    print('+')
elif a * b == 15:
    print('*')
else:
    print('x')