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

Fixed submission:
X = int(input())
if X >= 30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import bisect
def main():
    N, Q = map(int, input().split())
    C = list(map(int, input().split()))
    E = []

    D = {C[i]: -1 for i in range(N)}
    for i in range(N):
        if D[C[i]] == -1:
            D[C[i]] = i
        else:
            E.append((D[C[i]], i, -1))
            D[C[i]] = i

    for i in range(Q):
        l, r = map(int, input().split())
        E.append((l - 1, r - 1, i))

    def f(tup):
        return tup[0]
    E.sort(key=f, reverse=True)

    ANS = [0] * Q
    y_list = []
    for e in E:
        if e[2] == -1:
            y_list.append(e[1])
            y_list.sort()
        else:
            ans = bisect.bisect_right(y_list, e[1])
            ANS[e[2]] = e[1] - e[0] + 1 - ans

    for i in range(Q):
        print(ANS[i])

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

Fixed submission:
K = int(input())
mod = K
if K == 1:
    print(1)
elif K % 2 == 0 or K % 5 == 0:
    print(-1)
elif K % 7 != 0:
    x = 10 % mod
    X = [1] * K
    S = [1] * K
    for i in range(1, K + 1):
        X[i] = (X[i - 1] * x) % mod
        S[i] = S[i - 1] + X[i]
        if S[i] % mod == 0:
            print(i + 1)
            exit()
    print(-1)
else:
    mod = K // 7
    if mod == 1:
        print(1)
    else:
        x = 10 % mod
        y = 1 % mod
        X = [y] * K
        S = [y] * K
        for i in range(1, K + 1):
            X[i] = (X[i - 1] * x) % mod
            S[i] = S[i - 1] + X[i]
            if S[i] % mod == 0:
                print(i + 1)
                exit()
        print(-1)

Buggy submission (verdict: Runtime Error):
K = int(input())
mod = K
if K % 2 == 0 or K % 5 ==0:
    print(-1)
elif K % 7 != 0:
    x = 10 % mod
    y = 1 % mod
    X = [y] * K
    S = [y] * K
    for i in range(1, K + 1):
        X[i] = (X[i - 1] * x) % mod
        S[i] = S[i - 1] + X[i]
        if S[i] % mod == 0:
            print(i + 1)
            exit()
        elif X[i] == 1 % mod:
            loop = i
            print(loop * K)
            exit()
else:
    mod = K // 7
    x = 10 % mod
    y = 1 % mod
    X = [y] * K
    S = [y] * K
    for i in range(1, K + 1):
        X[i] = (X[i - 1] * x) % mod
        S[i] = S[i - 1] + X[i]
        if S[i] % mod == 0:
            print(i + 1)
            exit()
        elif X[i] == 1 % mod:
            loop = i
            print(loop * K)
            exit()
Problem p03209 (python)

Fixed submission:
def cnt(n, x):
	if x==0:
		return 0
	elif n==0:
		return 1
	elif x<2**(n+1)-1:
		return cnt(n-1, x-1)
	elif x==2**(n+1)-1:
		return 2**n
	elif x<2**(n+2)-3:
		return cnt(n-1, 2**(n+1)-3) + 1 + cnt(n-1, x-2**(n+1)+1)
	else:
		return 2**(n+1)-1

n, x = map(int, input().split())
print(cnt(n, x))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())

done = [[False] * (x+1) for _ in range(n+1)]
memo = [[0] * (x+1) for _ in range(n+1)]
for i in range(0, n+1):
	done[i][0] = True
memo[0][1] = 1
done[0][1] = True

def cnt(n, x):
	if not done[n][x]:
		done [n][x] = True
		if x<2**(n+1)-1:
			memo[n][x] = cnt(n-1, x-1)
		elif 2**(n+1)-1 <= x < 2**(n+2)-3:
			memo[n][x] = cnt(n-1, 2**(n+1)-3) + 1 + cnt(n-1, x-2**(n+1)+1)
		else:
			memo[n][x] = cnt(n-1, 2**(n+1)-3) + 1 + cnt(n-1, x-2**(n+1))
	return memo[n][x]

print(cnt(n, x))
Problem p03805 (python)

Fixed submission:
n, m = map(int, input().split())
edge = [[False for j in range(n)] for i in range(n)]
for _ in range(m):
	a, b = map(int, input().split())
	edge[a-1][b-1] = edge[b-1][a-1] = True
visited = [False for _ in range(n)]
ans = 0
def dfs(v):
	visited[v] = True
	if all(x==True for x in visited):
		global ans
		ans += 1
		return
	for i in range(0, n):
		if edge[v][i]==True and visited[i]==False:
			dfs(i)
			visited[i] = False
dfs(0)
print(ans)

Buggy submission (verdict: Runtime Error):
m, n = map(int, input().split())
edge = [[False for j in range(n)] for i in range(n)]
for _ in range(m):
	a, b = map(int, input().split())
	edge[a-1][b-1] = edge[b-1][a-1] = True
visited = [False for _ in range(n)]
ans = 0
def dfs(v):
	visited[v] = True
	if all(x==True for x in visited):
		global ans
		ans += 1
		return
	for i in range(0, n):
		if edge[v][i]==True and visited[i]==False:
			dfs(i)
			visited[i] = False
			return
dfs(0)
print(ans)

Buggy submission (verdict: Runtime Error):
m, n = map(int, input().split())
edge = [[False for j in range(n)] for i in range(n)]
for _ in range(m):
	a, b = map(int, input().split())
	edge[a-1][b-1] = edge[b-1][a-1] = True
visited = [False for _ in range(n)]
ans = 0
def dfs(v):
	visited[v] = True
	if all(x==True for x in visited):
		global ans
		ans += 1
		return
	for i in range(0, n):
		if edge[v][i]==True and visited[i]==False:
			dfs(i)
			visited[i] = False
dfs(0)
print(ans)
Problem p02597 (python)

Fixed submission:
n = int(input())
c = input()

cnt = 0
i = 0
j = n-1
while i < j:
    while c[i] == 'R' and i < j:
        i += 1
    while c[j] == 'W' and i < j:
        j -= 1
    if c[i] != 'W' or c[j] != 'R':
        break
    i += 1
    j -= 1
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
from collections import deque
n = int(input())
c = deque(input())

cnt = 0
l = c.popleft()
r = c.pop()
while c:
    if l == 'R':
        l = c.popleft()
    if r == 'W':
        r = c.pop()
    if l == 'W' and r == 'R':
        cnt += 1
        l = c.popleft()
        if not c:
            break
        r = c.pop()

print(cnt)
Problem p02627 (python)

Fixed submission:
a = input()
if a.islower():
    print('a')
else:
    print('A')

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = ''

while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26

print(ans[::-1])
Problem p02629 (python)

Fixed submission:
N = int(input())
ans = ''

while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26

print(ans[::-1])

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

al = [chr(ord('a') + i) for i in range(26)]



ans = []
mod = 1
cnt = 0
while cnt >= 1:
    k = math.floor(n/26)
    ans.append(al[k % 26 - 1])

print(int(''.join(ans[::-1])))

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

al = [chr(ord('a') + i) for i in range(26)]

print(al[n % 26 - 1])

ans = []
mod = 1
cnt = 0
while cnt >= 1:
    k = math.floor(n/26)
    ans.append(al[k % 26 - 1])

print(int(''.join(ans[::-1])))
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
a, b = input().split()
a = Decimal(a)
b = Decimal(b)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
b = b * 1000
print(int(a*b/1000))

Buggy submission (verdict: Runtime Error):
a = int(a)
b = b * 1000
print(int(a*b/1000))
Problem p02707 (python)

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

ans = [0]*n
for i in a:
    ans[i-1] += 1
for i in range(n):
    print(ans[i])

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

for i in range(1, n+1):
    print(a.count(i))
    a.remove(i)
Problem p02793 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from math import gcd
cm = 1
for i in range(n):
    cm = cm*a[i]//gcd(cm, a[i])
ai = sum(pow(x, mod-2, mod) for x in a)
print(int(ai*cm%mod))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from math import gcd
ans = a[0]
for i in range(1, n):
    ans = ans*a[i]//gcd(ans, a[i])
# s = sum(pow(x, mod-2, mod) for x in a)
s = sum((1/x)%mod for x in a)
print(int(s*ans%mod))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from math import gcd
ans = a[0]
for i in range(1, n):
    ans = ans*a[i]//gcd(ans, a[i])
# s = sum(pow(x, mod-2, mod) for x in a)
s = sum(1/x for x in a)
print(int(s*ans%mod))
Problem p02557 (python)

Fixed submission:
from collections import Counter
from heapq import heappush, heappop


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

AC = Counter(A)
BC = Counter(B)
S = AC + BC

q = []
for k, v in S.items():
    heappush(q, (-v, k))

ans = []
while q:
    v, k = heappop(q)
    v = -v
    if v != S[k]:
        if S[k] != 0:
            heappush(q, (-S[k], k))
    else:
        if v != 1:
            heappush(q, (-(v - 1), k))
        if v > N:
            print('No')
            exit()
        else:
            if AC[k] > 0:
                a = k
                for l in BC.keys():
                    if l != k:
                        b = l
                        break
            else:
                b = k
                for l in AC.keys():
                    if l != k:
                        a = l
                        break
            ans.append((a, b))
            S[a] -= 1
            S[b] -= 1
            AC[a] -= 1
            if not AC[a]:
                AC.pop(a)
            BC[b] -= 1
            if not BC[b]:
                BC.pop(b)

print('Yes')
ans.sort()
X = [b for a, b in ans]
print(*X)

Buggy submission (verdict: Runtime Error):
from collections import Counter

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

AC = Counter(A)
BC = Counter(B)
if N < max((AC + BC).values()):
    print('No')
    exit()

a = 0
b = 0
while a < N:
    if A[a] == B[a]:
        while A[a] == B[b] or A[b] == B[a]:
            b = (b + 1)
            if b >= N:
                raise Exception
        B[a], B[b] = B[b], B[a]
    a += 1

print('Yes')
print(*B)
Problem p02793 (python)

Fixed submission:
from fractions import gcd


MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)

lcm = A[0]

for a in A:
    lcm = (lcm * a) // gcd(lcm, a)

ans = 0
for a in A:
    ans += (lcm % MOD) * pow(a, MOD - 2, MOD)
    ans %= MOD

print(ans)

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


MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
A.sort(reversed=True)

lcm = A[0]

for a in A:
    lcm = (lcm * a) // gcd(lcm, a)

ans = 0
for a in A:
    ans += lcm // a
    ans %= MOD

print(ans)
Problem p02820 (python)

Fixed submission:
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

score = {'p': P, 'r': R, 's': S}
hand = {'r': 'p', 's': 'r', 'p': 's'}
H = [' '] * N

ans = 0
for sub in range(K):
    i = sub
    while i < N:
        c = T[i]
        if i - K >= 0 and hand[c] == H[i - K]:
            s = 0
            if i + K < N and hand[T[i + K]] == c:
                H[i] = hand[hand[c]]
            else:
                H[i] = c
        else:
            H[i] = hand[c]
            s = score[hand[c]]
        i += K
        ans += s

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
R, S, P = map(int, input().split())
score = {'r': R, 's': S, 'p': P}
T = input()
hand = {'r': 'p', 's': 'r', 'p': 's'}

history = ['a'] * (2 * N)
cnt = 0
for i, t in enumerate(T):
    l = i - K
    r = i + K
    u = hand[t]
    flag = 1

    if u == history[l]:
        u = T[r]
        flag = 0

    cnt += score[u] * flag
    history[i] = u

print(cnt)
Problem p02831 (python)

Fixed submission:
from fractions import gcd

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // gcd(x, y)


print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(A, B))
Problem p02862 (python)

Fixed submission:
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


dest = list(map(int, input().split()))

p = (2, 1)
q = (1, 2)
num_p = 0
num_q = 0

while dest[0] and dest[1]:
    if dest[0] >= dest[1]:
        dest[0] -= p[0]
        dest[1] -= p[1]
        num_p += 1
    else:
        dest[0] -= q[0]
        dest[1] -= q[1]
        num_q += 1

modFacts, invs = prepare(num_p + num_q)

if dest == [0, 0]:
    n = num_p + num_q
    r = min(num_p, num_q)
    ans = (modFacts[n] * invs[n - r] * invs[r]) % MOD
else:
    ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


X, Y = map(int, input().split())
if (X + Y) % 3 == 0:
    p = (2 * Y - X) // 3
    q = (2 * X - Y) // 3
    n = p + q
    r = min(p, q)
    modFacts, invs = prepare(n)
    ans = (modFacts[n] * invs[n - r] * invs[r]) % MOD
else:
    ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


X, Y = map(int, input().split())
if (X + Y) % 3 == 0:
    p = (2 * Y - X) // 3
    q = (2 * X - Y) // 3
    n = p + q
    r = min(p, q)
    modFacts, invs = prepare(n)
    ans = (modFacts[n] * invs[n - r] * invs[r]) % MOD
else:
    ans = 0

print(ans)
Problem p03053 (python)

Fixed submission:
from collections import deque
H, W = map(int, input().split())
grid = [list(input()) for _ in range(H)]

# d = [[2001] * W for _ in range(H)]


def bfs(q):
    res_q = deque()
    while len(q):
        x, y = q.popleft()
        for dx, dy in [(1, 0), (-1, 0), (0, 1), (0, -1)]:
            nx = x + dx
            ny = y + dy

            if (0 <= nx < H) and (0 <= ny < W) and grid[nx][ny] != '#':
                res_q.append((nx, ny))
                grid[nx][ny] = '#'
    return res_q


q = deque()
for i in range(H):
    for j in range(W):
        if grid[i][j] == '#':
            q.append((i, j))

res = 0
while len(q):
    res += 1
    q = bfs(q)

print(res - 1)

Buggy submission (verdict: Runtime Error):
import numpy as np
from collections import deque
H, W = map(int, input().split())
grid = [list(input()) for _ in range(H)]

d = np.full((H, W), 2001)


def bfs(i, j):
    q = deque()
    q.append((i, j))
    d[i][j] = 0

    while len(q):
        x, y = q.popleft()
        for dx, dy in [(1, 0), (-1, 0), (0, 1), (0, -1)]:
            nx = x + dx
            ny = y + dy

            if (0 <= nx < H) and (0 <= ny < W) and d[nx][ny] > d[x][y] + 1:
                q.append((nx, ny))
                if grid[nx][ny] == '#':
                    d[nx][ny] = 0
                else:
                    d[nx][ny] = d[x][y] + 1


for i in range(H):
    for j in range(W):
        if grid[i][j] == '#':
            bfs(i, j)
            break
    else:
        continue
    break

print(np.amax(d))
Problem p03104 (python)

Fixed submission:
from math import log2


def cntOnes(n, N):
    ret = [0] * N
    i = 0
    while (n >> i) > 0:
        t = 2 ** i
        quot = n // t
        rem = n % t
        if quot % 2 == 1:
            ret[i] = (quot // 2) * t + (rem + 1)
        else:
            ret[i] = (quot // 2) * t
        i += 1
    return ret


A, B = map(int, input().split())

if B == 0:
    print(0)
    exit()
dig = int(log2(B)) + 1
cntA = cntOnes(A - 1, dig) if A != 0 else [0] * dig
cntB = cntOnes(B, dig)

ans = 0
for i, (a, b) in enumerate(zip(cntA, cntB)):
    if (a - b) % 2 == 1:
        ans += (1 << i)

print(ans)

Buggy submission (verdict: Runtime Error):
from math import log2

def cntOnes(n, N):
    ret = [0] * N
    i = 0
    while (n >> i) > 0:
        t = 2 ** i
        quot = n // t
        rem = n % t
        if quot % 2 == 1:
            ret[i] = (quot // 2) * t + (rem + 1)
        else:
            ret[i] = (quot // 2) * t
        i += 1
    return ret


A, B = map(int, input().split())

dig = int(log2(B)) + 1
cntA = cntOnes(A - 1, dig)
cntB = cntOnes(B, dig)

ans = 0
for i, (a, b) in enumerate(zip(cntA, cntB)):
    if (a - b) % 2 == 1:
        ans += (1 << i)

print(ans)
Problem p03286 (python)

Fixed submission:
N = int(input())
ans = [0] * 40
if N == 0:
    print(0)
    exit()
else:
    while N != 0:
        i = 1 if N < 0 else 0
        k = pow(-2, i)
        while abs(N) > abs(k):
            i += 2
            k += pow(-2, i)
        ans[i] = 1
        N -= pow(-2, i)

for j in range(39, -1, -1):
    if ans[j] == 1:
        print(''.join(map(str, reversed(ans[:j + 1]))))
        exit()

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = [0] * 31
if N == 0:
    print(0)
    exit()
else:
    while N != 0:
        i = 1 if N < 0 else 0
        k = pow(-2, i)
        while abs(N) > abs(k):
            i += 2
            k += pow(-2, i)
        ans[i] = 1
        N -= pow(-2, i)

for j in range(30, -1, -1):
    if ans[j] == 1:
        print(''.join(map(str, reversed(ans[:j + 1]))))
        exit()
Problem p02598 (python)

Fixed submission:
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

def Binary_Search(N, K, A):
	#初期化
	left = 0
	right = 10 ** 9
	ans = INF
	
	while left <= right:
		mid = (left + right) // 2
		val = 0
		if mid == 0:
			return 1
		for i in range(N):
			val += int((A[i] - 1) // mid)
		if val <= K:
			ans = min(ans, mid)
			right = mid - 1
		else:
			left = mid + 1

	return ans

#処理内容
def main():
	N, K = getlist()
	A = getlist()
	ans = Binary_Search(N, K, A)
	print(ans)

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

def Binary_Search(N, K, A):
	#初期化
	left = 0
	right = 10 ** 9
	ans = INF
	
	while left <= right:
		mid = (left + right) // 2
		val = 0
		for i in range(N):
			val += int((A[i] - 1) // mid)
		if val <= K:
			ans = min(ans, mid)
			right = mid - 1
		else:
			left = mid + 1

	return ans

#処理内容
def main():
	N, K = getlist()
	A = getlist()
	ans = Binary_Search(N, K, A)
	print(ans)

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

Fixed submission:
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))


#処理内容
def main():
	N, T = getlist()
	K = []
	for i in range(N):
		A, B = getlist()
		K.append([A, B])
	DP = [[0 for i in range(T)] for j in range(N + 1)]
	for i in range(N):
		W, V = K[i][0], K[i][1]
		for j in range(T):
			if j < W:
				DP[i + 1][j] = DP[i][j]
			else:
				DP[i + 1][j] = max(DP[i][j], DP[i][j - W] + V)
	ans = DP[-1][-1]
	use = [0] * N
	Y = T - 1
	for i in range(N):
		if DP[N - i][Y] != DP[N - i - 1][Y]:
			use[N - 1 - i] = 1
			Y -= K[-1 - i][0]
	lis = []
	for i in range(N):
		if use[i] == 0:
			lis.append(K[i][1])
	lis = sorted(lis)
	if len(lis) >= 1:
		ans += lis[-1]
	print(ans)

if __name__ == '__main__':
	main()

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

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))


#処理内容
def main():
	N, T = getlist()
	K = []
	for i in range(N):
		A, B = getlist()
		K.append([A, B])
	DP = [[0 for i in range(T)] for j in range(N + 1)]
	for i in range(N):
		W, V = K[i][0], K[i][1]
		for j in range(T):
			if j < W:
				DP[i + 1][j] = DP[i][j]
			else:
				DP[i + 1][j] = max(DP[i][j], DP[i][j - W] + V)
	ans = DP[-1][-1]
	use = [0] * N
	Y = T - 1
	for i in range(N):
		if DP[N - i][Y] != DP[N - i - 1][Y]:
			use[N - 1 - i] = 1
			Y -= K[-1 - i][0]
	lis = []
	for i in range(N):
		if use[i] == 0:
			lis.append(K[i][1])
	lis = sorted(lis)
	ans += lis[-1]
	print(ans)



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

Fixed submission:
def getlist():
	return list(map(int, input().split()))

a = int(input())
s = input()

if a >= 3200:
	print(s)
else:
	print("red")

Buggy submission (verdict: Runtime Error):
def getlist():
	return list(map(int, input().split()))

a = int(input())
x = input()

if a >= 3200:
	print(s)
else:
	print("red")
Problem p03003 (python)

Fixed submission:
def getlist():
	return list(map(int, input().split()))

N, M = getlist()
S = getlist()
T = getlist()

L = [[1 for i in range(N + 1)] for j in range(M + 1)]
for i in range(1, N + 1):
	for j in range(1, M + 1):
		if S[i - 1] == T[j - 1]:
			L[j][i] = (L[j - 1][i] + L[j][i - 1]) % 1000000007
		else:
			L[j][i] = (L[j - 1][i] + L[j][i - 1] - L[j - 1][i - 1]) % 1000000007

print(L[M][N] % 1000000007)

Buggy submission (verdict: Runtime Error):
def getlist():
	return list(map(int, input().split()))

N, M = getlist()
S = getlist()
T = getlist()

L = [[1 for i in range(N + 1)] for j in range(M + 1)]
for i in range(1, N + 1):
	for j in range(1, M + 1):
		if S[i - 1] == T[j - 1]:
			L[j][i] = max(L[j - 1][i - 1] * 2, L[j - 1][i] + L[j][i - 1]) % 1000000007
		else:
			L[j][i] = (L[j - 1][i] + L[j][i - 1] - L[j - 1][i - 1])

print(L[M][N] %  % 1000000007)
Problem p03345 (python)

Fixed submission:
A, B, C, K = list(map(int, input().split()))
if K % 2 == 0:
	print(A - B)
else:
	print((A - B)  * (-1))

Buggy submission (verdict: Runtime Error):
A, B, C, K = list(map(int, input().split()))
if K % 2 == 0:
	print(A - B)
else:
	print(A - B) * (-1)