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

Fixed submission:
a, b, k = map(int, input().split())
x = range(a, b+1)

for i in sorted(set(x[:k]) | set(x[-k:])):
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))

for i in sorted(set(x[:k]) | set(x[-k:])):
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))

for i in sorted(set(map(int, x[:k] + x[-k:]))):
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))

print('\n'.join(sorted(set(map(int, x[:k] + x[-k:])))))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))

print('\n'.join(sorted(set(map(str, x[:k] + x[-k:])))))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))

print('\n'.join(map(str, x[:k] + x[-k:])))
Problem p03400 (python)

Fixed submission:
n = int(input())
d, x = map(int, input().split())
a = [int(input()) for _ in range(n)]

count = x

for i in range(n):
    ai = a[i]
    for j in range(1, d+1, ai):
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input()
d, x = map(int, input().split())
a = [int(input()) for in _ range(n)]

count = x

for i in range(n):
    ai = a[i]
    for j in range(1, d+1, ai):
        count += 1

print(count)
Problem p03449 (python)

Fixed submission:
n = int(input())
a = [list(map(int, input().split())) for _ in range(2)]
count = 0

for i in range(n):
    x = sum(a[0][:n-i]) + sum(a[1][n-i-1:])
    
    if count < x:
        count = x

print(count)

Buggy submission (verdict: Runtime Error):
n = 5
a = [ list(map(int, input().split())) for _ in range(n)]
count = 0

for i in range(n):
    x = sum(a[0][:n-i]) + sum(a[1][n-i-1:])
    
    if count < x:
        count = x

print(count)
Problem p03545 (python)

Fixed submission:
a,b,c,d = map(int, list(input()))

if a + b + c + d == 7:
    print('{}+{}+{}+{}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
    print('{}+{}+{}-{}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
    print('{}+{}-{}+{}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
    print('{}+{}-{}-{}=7'.format(a,b,c,d))
elif a - b + c + d == 7:    
    print('{}-{}+{}+{}=7'.format(a,b,c,d))
elif a - b + c - d == 7:       
    print('{}-{}+{}-{}=7'.format(a,b,c,d))
elif a - b - c + d == 7:     
    print('{}-{}-{}+{}=7'.format(a,b,c,d))
elif a - b - c - d == 7:    
    print('{}-{}-{}-{}=7'.format(a,b,c,d))

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

if a + b + c + d == 7:
    print('{a}+{b}+{c}+{d}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
    print('{a}+{b}+{c}-{d}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
    print('{a}+{b}-{c}+{d}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
    print('{a}+{b}-{c}-{d}=7'.format(a,b,c,d))
elif a - b + c + d == 7:    
    print('{a}-{b}+{c}+{d}=7'.format(a,b,c,d))
elif a - b + c - d == 7:       
    print('{a}-{b}+{c}-{d}=7'.format(a,b,c,d))
elif a - b - c + d == 7:     
    print('{a}-{b}-{c}+{d}=7'.format(a,b,c,d))
elif a - b - c - d == 7:    
    print('{a}-{b}-{c}-{d}=7'.format(a,b,c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, '1222'.split())

if a + b + c + d == 7:
    print('{a}+{b}+{c}+{d}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
    print('{a}+{b}+{c}-{d}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
    print('{a}+{b}-{c}+{d}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
    print('{a}+{b}-{c}-{d}=7'.format(a,b,c,d))
elif a - b + c + d == 7:    
    print('{a}-{b}+{c}+{d}=7'.format(a,b,c,d))
elif a - b + c - d == 7:       
    print('{a}-{b}+{c}-{d}=7'.format(a,b,c,d))
elif a - b - c + d == 7:     
    print('{a}-{b}-{c}+{d}=7'.format(a,b,c,d))
elif a - b - c - d == 7:    
    print('{a}-{b}-{c}-{d}=7'.format(a,b,c,d))
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

next = a[0]
count = 1

for i in range(1,n):
    if next == 2:
        print(count)
        break
    next = a[next-1]
    count += 1
else:
    print(-1)

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

next = a[0]
count = 1

for i in range(1,n):
    if next == 2:
        print(count)
        break
    next = a[next-1]
    count += 1
else:
    print(-1)
Problem p03457 (python)

Fixed submission:
def mdist(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])

n = int(input())
data = [[0, 0, 0]] + [[int(d) for d in input().split(' ')] for _ in range(n)]

for d1, d2 in zip(data[:-1], data[1:]):
    dt = d2[0] - d1[0]
    dist = mdist(d1[1:], d2[1:])
    if not ((dt >= dist) and ((dt%2)==(dist%2))):
        print('No')
        break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
def mdist(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])

n = int(input())
data = [[0, 0, 0]] + [[int(d) for d in input().split(' ')] for _ in range(n)]

for d1, d2 in enumerate(data[:-1], data[1:]):
    dt = d2[0] - d1[0]
    dist = mdist(d1[1:], d2[1:])
    if not ((dt >= dist) and ((dt%2)==(dist%2))):
        print('No')
        break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
def mdist(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])

n = int(input())
data = [[0, 0, 0]] + [[int(d) for d in input().split(' ')] for _ in range(n)]

for d1, d2 in enumerate(data[:-1], data[1:]):
    dt = d2[0] - d1[0]
    dist = mdist(d1[1:], d2[1:])
    if not ((dt >= dist) and ((dt%2)==(dist%2))):
        print('No')
        return
print('Yes')
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if (abs(b-a)<=d and abs(c-b)<=d) or abs(c-a)<=d:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split))
if abs(b-a)<=d and abs(c-b)<=d:
	print(Yes)
else:
	print(No)
Problem p03697 (python)

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

Buggy submission (verdict: Runtime Error):
S,A,B = map(int, input().split())
S=A+B
if S>=10:
	print('error')
else:
	print(S)
Problem p03264 (python)

Fixed submission:
K = int(input().strip())
num1 = K // 2
num2 = K - num1
print(num1 * num2)

Buggy submission (verdict: Runtime Error):
K = int(input.strip())
num1 = K // 2
num2 = K - num1
print(num1 * num2)
Problem p03280 (python)

Fixed submission:
A = [int(i) for i in input().split(" ")]
ans = A[0] * A[1] - (1 * A[0] + 1 * A[1] -1)

print(ans)

Buggy submission (verdict: Runtime Error):
A = [int(i) for i in input().split(" ")]
ans = A[0] * A[1] - (1 * A[0] + 1 * A[1] -1)

print(ans)
Problem p03323 (python)

Fixed submission:
S = raw_input()
L = S.split(" ")
if int(L[0]) <= 8 and int(L[1]) <= 8:
    print "Yay!"
else:
    print ":("

Buggy submission (verdict: Runtime Error):
innum = raw_input()
if int(innum[0]) <= 8 and int(innum[2]) <= 8:
    print "Yay!"
else:
    print ":("

Buggy submission (verdict: Runtime Error):
innum = raw_input()
print innum[1]
if int(innum[0]) <= 8 and int(innum[2]) <= 8:
    print "Yay!"
else:
    print ":("
Problem p03361 (python)

Fixed submission:
#ABC096 C - Grid Repainting 2
I = raw_input().split(" ")
H = int(I[0])
W = int(I[1])
A = [list(raw_input()) for i in range(H)]
ans = 0
for X in range(H):
    for Y in range(W):
        counter = 0
        if A[X][Y] == "#":
            if X != 0 and A[X][Y] == A[X - 1][Y]:
                counter += 1
            if X != H - 1 and A[X][Y] == A[X + 1][Y]:
                counter += 1
            if Y != 0 and A[X][Y] == A[X][Y - 1]:
                counter += 1
            if Y != W - 1 and A[X][Y] == A[X][Y + 1]:
                counter += 1
            if counter == 0:
                ans += 1
if ans == 0:
    print "Yes"
else:
    print "No"

Buggy submission (verdict: Runtime Error):
#ABC096 C - Grid Repainting 2
I = raw_input().split(" ")
H = int(I[0])
W = int(I[1])
A = [list(raw_input()) for i in range(W)]
ans = 0
for X in range(H):
    for Y in range(W):
        counter = 0
        if A[X][Y] == "#":
            if X != 0 and A[X][Y] == A[X - 1][Y]:
                counter += 1
            if X != H - 1 and A[X][Y] == A[X + 1][Y]:
                counter += 1
            if Y != 0 and A[X][Y] == A[X][Y - 1]:
                counter += 1
            if Y != W - 1 and A[X][Y] == A[X][Y + 1]:
                counter += 1
            if counter == 0:
                ans += 1
if ans == 0:
    print "Yes"
else:
    print "No"
Problem p03283 (python)

Fixed submission:
import numpy as np
n, m, q = input().split()
n, m, q = int(n), int(m), int(q)
s = np.zeros((501, 501))
 
for _ in range(m):
    l, r = input().split()
    l, r = int(l), int(r)
    s[l, r] += 1
    
"""
     1 2 3
    --------
1 | 1 2 3
2 | 1 0 1
"""
    
for i in range(1, n+1):
    for j in range(1, n+1):
        s[i, j] += s[i, j-1]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 1 1 2
"""
        
for j in range(1, n+1):
    for i in range(1, n+1):
        s[i, j] += s[i-1, j]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 2 4 8
"""
 
for _ in range(q):
    l, r = input().split()
    l, r = int(l), int(r)
    print(int(s[r, r] - s[r, l-1] - s[l-1, r] + s[l-1, l-1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m, q = input().split()
n, m, q = int(n), int(m), int(q)
s = np.zeros((501, 501))

for _ in range(m):
    l, r = input().split()
    l, r = int(l), int(r)
    s[l, r] += 1
    
"""
     1 2 3
    --------
1 | 1 2 3
2 | 1 0 1
"""
    
for i in range(1, n+1):
    for j in range(1, n+1):
        s[i, j] += s[i, j-1]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 1 1 2
"""
        
for j in range(1, n+1):
    for i in range(1, n+1):
        s[i, j] += s[i-1, j]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 2 4 8
"""

for _ in range(q):
    l, r = input().split()
    l, r = int(l), int(r)
    print(int(s[r, r] - s[r, l-1] - s[l-1, r] + s[l-1, l-1]))
Problem p03288 (python)

Fixed submission:
R = int(input())

if R >= 2800:
    print("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

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

if R >= 2800:
    peint("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

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

if R >= 2800:
    peint("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")
Problem p03351 (python)

Fixed submission:
A,B,C,D = map(int, input().split())

AB = abs(A-B)
BC = abs(B-C)
AC = abs(A-C) 
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
    ans = "No"
        
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

AB = abs(A-B)
BC = abs(B-C)
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
    ans = "No"
        
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

AB = abs(A-B)
BC = abs(B-C)
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
        ans = "No"
        
print(ans)
Problem p03352 (python)

Fixed submission:

n=int(input())
ans=1
for i in range(1,32):
  for j in range(2,10):
    if i**j <=n and i**j >ans:
      ans=i**j
print(ans)

Buggy submission (verdict: Runtime Error):
X = input()
X = int(X)
num=0

for i in range(X):
    i = int(i)
    num = i*i 
    if num > X:
        if ans < i:
            ans = i
print(ans)
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
count = (X - A) // B

print(X - A - B * count)

Buggy submission (verdict: Runtime Error):
from sys import setrecursionlimit
import numpy as np


setrecursionlimit(10**6)

N, M = tuple(map(int, input().split()))
Ls = np.zeros((M,), dtype=int)
Rs = np.zeros((M,), dtype=int)
Ds = np.zeros((M,), dtype=int)

for i in range(M):
    Ls[i], Rs[i], Ds[i] = tuple(map(int, input().split()))

Ls = Ls - 1
Rs = Rs - 1

adjacency_list = []
for i in range(N):
    adjacency_list.append([])

for i in range(M):
    adjacency_list[Ls[i]].append((Rs[i], Ds[i]))
    adjacency_list[Rs[i]].append((Ls[i], -Ds[i]))

visited = np.zeros(N, dtype=bool)
weights = np.zeros(N, dtype=int)
to_be_visited = []


def DFS(node_index):
    global adjacency_list, visited, weights, to_be_visited
    adjacent_node_information = adjacency_list[node_index]
    for adjacent_node_index, adjacent_edge_weight in adjacent_node_information:
        if not visited[adjacent_node_index]:
            visited[adjacent_node_index] = True
            to_be_visited.append(adjacent_node_index)
            weights[adjacent_node_index] = weights[node_index] + adjacent_edge_weight

    if len(to_be_visited) == 0:
        return 0
    else:
        DFS(to_be_visited.pop())

pointer = 0
for pointer in range(N):
    if not visited[pointer]:
        to_be_visited.append(pointer)
        DFS(pointer)

for i in range(M):
    if weights[Rs[i]] - weights[Ls[i]] != Ds[i]:
        print("No")
        exit()

print("Yes")
Problem p03449 (python)

Fixed submission:
import numpy as np

N = int(input())
upper = tuple(map(int, input().split()))
lower = tuple(map(int, input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flipud(lower))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1 - i] + upper_sum[i]
print(np.max(s))

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
upper = tuple(map(int,input().split()))
lower = tuple(map(int,input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flip(lower, 0))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1-i] + upper_sum[i]
print(np.max(s))

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
upper = tuple(map(int,input().split()))
lower = tuple(map(int,input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flip(lower, 0))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1-i] + upper_sum[i]
print(np.max(s))

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
upper = tuple(map(int,input().split()))
lower = tuple(map(int,input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flip(lower, 0))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1-i] + upper_sum[i]
print(np.max(s))
Problem p03433 (python)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n = int(input())
    a = int(input())
    if (n % 500) > a:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    c = tuple(tuple(map(int, line.split())) for line in sys.stdin.readlines())
    for i in range(101):
        b = [c[0][0] - i]
        for j in range(101):
            b.append(c[1][1] - j)
            for k in range(101):
                b.append(c[2][2] - k)
                a = (i, j, k)
                flg = False
                for l in range(3):
                    for m in range(3):
                        if a[l] + b[m] != c[l][m]:
                            flg = True
                            break
                    if flg == True:
                        break
                else:
                    print('Yes')
                    sys.exit()
    else:
        print('No')

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

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    a = tuple(tuple(e for e in map(int, input().split())) for _ in range(2))
    dp = [[None] * n] * 2
    dp[0][0] = 0
    for i in range(2):
        for j in range(n):
            if i == 0:
                dp[0][j] = dp[0][max(0, j - 1)] + a[0][j]
            else:
                dp[1][j] = max(dp[0][j], dp[1][max(0, j - 1)]) + a[1][j]
    print(dp[1][n - 1])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    a = tuple(tuple(e for e in map(int, input().split())) for _ in range(2))
    dp = [[None] * n for _ in range(2)]
    dp[0][0] = 0
    for i in range(2):
        for j in range(n):
            if i == 0:
                dp[0][j] = dp[0][max(0, j - 1)] + a[0][j]
            else:
                dp[1][j] = max(dp[0][j], dp[1][max(0, j - 1)]) + a[1][j]
    print(dp[1][n - 1])

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

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000 + 1):
        for j in range((y - 10000 * i) // 5000 + 1):
            k = n - i - j
            if 10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, k)
                sys.exit()
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000):
        for j in range((y - 10000 * i) // 5000):
            if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, k)
                sys.exit()
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000):
        for j in range((y - 10000 * i) // 5000):
            if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, k)
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def out(i, j, k):
    print(i, j, k)
    print(10000 * i + 5000 * j + 1000 * k)
    sys.exit()

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000, -1, -1):
        z = y - 10000 * i
        if i != n:
            continue
        elif z == 0:
            out(i, 0, 0)
        for j in range(z // 5000, -1, -1):
            w = z - 5000 * j
            if i + j != n:
                continue
            elif w == 0:
                out(i, j, 0)
            k = n - i - k
            if w == 1000 * k:
                out(i, j, k)
    else:
        out(-1, -1, -1)


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

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
from itertools import islice

def reachable(steps, x):
    m = len(steps)
    if m == 0:
        return x == 0
    n = sum(steps) + 1
    if n <= x:
        return False
    dp = [[False] * n for _ in range(m)]
    dp[0][steps[0]] = True
    for i, step in enumerate(islice(steps, 1, None)):
        for j in range(n):
            if dp[i][j] == True:
                dp[i + 1][j + step] = True
                if j - step >= 0:
                    dp[i + 1][j - step] = True
    return dp[-1][x]


def main():
    s = sys.stdin.readline().strip()
    x, y = map(int, sys.stdin.readline().split())

    i = s.find('T')
    if i != -1:
        x -= i
        i += 1
    else:
        i = len(s)
        x -= i

    xsteps = []
    ysteps = []
    cnt = 0
    nturns = 0
    for c in islice(s + 'T', i, None):
        if c == 'F':
            cnt += 1
            continue
        if cnt > 0:
            if nturns % 2 != 0:
                xsteps.append(cnt)
            else:
                ysteps.append(cnt)
            cnt = 0
        nturns += 1

    if reachable(xsteps, abs(x)) == True and reachable(ysteps, abs(y)) == True:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
from itertools import islice

def reachable(steps, x):
    m = len(steps)
    if m == 0:
        return x == 0
    n = sum(steps) + 1
    if n <= x:
        return False
    dp = [[False] * n for _ in range(m)]
    dp[0][steps[0]] = True
    for i, step in enumerate(islice(steps, 1, None)):
        for j in range(n):
            if dp[i][j] == True:
                if j + step < n:
                    dp[i + 1][j + step] = True
                if j - step >= 0:
                    dp[i + 1][j - step] = True
    return dp[-1][x]


def main():
    s = sys.stdin.readline().strip()
    x, y = map(int, sys.stdin.readline().split())

    i = s.find('T')
    if i > 0:
        x -= i
    else:
        i = 0

    xsteps = []
    ysteps = []
    cnt = 0
    nturns = 0
    for c in islice(s, i, None):
        if c == 'F':
            cnt += 1
            continue
        if cnt > 0:
            if nturns % 2 == 0:
                xsteps.append(cnt)
            else:
                ysteps.append(cnt)
            cnt = 0
        nturns += 1
    else:
        if cnt > 0:
            if nturns % 2 == 0:
                xsteps.append(cnt)
            else:
                ysteps.append(cnt)

    if reachable(xsteps, abs(x)) == True and reachable(ysteps, abs(y)) == True:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
amnesia@amnesia
Problem p03282 (python)

Fixed submission:
s = list(input())
k = int(input())
o = 0

while s[0] == "1" and len(s) >= 2:
    del s[0]
    o += 1

if o >= k:
    print("1")
else:
    print(s[0])

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())
o = 0

while s[0] == "1":
    del s[0]
    o += 1

if o >= k:
    print("1")
else:
    print(s[0])
Problem p03323 (python)

Fixed submission:
a,b = map(int,input().split())
if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == b:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == b:
    print("Yay!")
else:
    print(":(")
Problem p03337 (python)

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

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

Fixed submission:
a,b = map(int,input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
if a *b%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
if int(input())＊int(input())%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
if int(input())*int(input())%2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03846 (python)

Fixed submission:
import collections
import sys
l = int(input())
inputs = [int(j) for j in input().split(' ')]
cs = collections.Counter(inputs)
if l % 2 == 0:
  for v,c in cs.items():
    if v % 2 == 0 or c != 2:
      print(0)
      sys.exit()
else:
  for v,c in cs.items():
    if v % 2 != 0 or (c != 2 and v != 0):
      print(0)
      sys.exit()
print(2**int(l/2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import collections
import sys
l = int(input())
inputs = [int(j) for j in input().split(' ')]
cs = collections.Counter(inputs)
if l % 2 == 0:
  for v,c in cs.items():
    if v % 2 == 0 or c != 2:
      print(0)
      sys.exit()
else:
  for v,c in cs.items():
    if v % 2 != 0 or (c != 2 and v != 0):
      print(0)
      sys.exit()
print(2**int(l/2)%(1e9+7))
Problem p04043 (python)

Fixed submission:
l = input().split()
if l.count('5')==2 and '7' in l:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
l = input.split()
if l.count('5')==2 and '7' in l:
  print('YES')
else:
  print('NO')
Problem p03280 (python)

Fixed submission:
a, b = map(int, input().split())
print((a-1)*(b-1))
exit(0)

Buggy submission (verdict: Runtime Error):
n,m,q = map(int, input().split())
lr = [tuple(map(int, input().split())) for _ in range(m)]
pq = [tuple(map(int, input().split())) for _ in range(q)]
 
x = [[] for _ in range(n)]
for l,r in lr:
    for i in range(l):
        x[i].append(r-1)
for p,q in pq:
    ans=0
    for j in x[p-1]:
        if j<q:
            ans+=1
    print(ans)
exit(0)