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

Fixed submission:
# https://www.hamayanhamayan.com/entry/2020/04/26/232032
s = input()[::-1] # 入力文字列を逆順でsに格納

counts = [0] * 2019
counts[0] = 1

num, d = 0, 1

for char in s:
    num += int(char) * d
    num %= 2019
    d *= 10
    d%= 2019
    counts[num] += 1

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2

print(ans) # 答えの出力

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    # si = tuple(int(c) for c in s)  # integers of one digit
    # ms = {2019 * x for x in range(10 ** 200000 - 1 // 2019)}
    ans = 0
    lg = len(si)
    # to slice till the last letter, +1 is needed.
    for i in range(lg + 1):
        for j in range(i + 4, lg + 1):
            j2 = j
            # 2019 = 673 * 3
            # if sum(si[i:j2]) % 3 != 0:
            #     continue
            if int(s[i:j2]) % 2019 == 0:
                ans += 1

    return ans


if __name__ == '__main__':
    print(main())
Problem p02708 (python)

Fixed submission:
def main():
    mod = 1000000007
    n, k = (int(x) for x in input().split())
    l = (i for i in range(n + 1))  # おまけの小さい部分，でも大事

    # 累積和を計算しておく，前からと後ろから。
    former = 0
    acm = tuple((former:= former + i) for i in range(n + 1))
    former = 0
    acm_rev = tuple((former:= former + i) for i in range(n, -1, -1))

    ans = 0
    # 選ぶ数の数で分ける。でかい部分は無視して，
    # 最小値と最大値が分かれば取りうる値も分かる。
    for j in range(k-1, n + 1):
        ans += acm_rev[j] - acm[j] + 1
        ans %= mod
    return ans


if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
def main():
    mod = 1000000007
    n, k = (int(x) for x in input().split())
    l = (i for i in range(n + 1))  # おまけの小さい部分，でも大事

    # 累積和を計算しておく，前からと後ろから。
    former = 0
    acm = tuple((former:= former + i) for i in range(n + 1))
    former = 0
    acm_rev = tuple((former:= former + i) for i in range(n, -1, -1))

    ans = 0
    # 選ぶ数の数で分ける。でかい部分は無視して，
    # 最小値と最大値が分かれば取りうる値も分かる。
    for j in range(k-1, n + 1):
        ans += acm_rev[j] - acm[j] + 1
        ans %= mod
    return ans


if __name__ == '__main__':
    print(main())
Problem p02715 (python)

Fixed submission:
# YouTube解説
MOD = 1000000007
n, k = [int(x) for x in input().split()]
d = [pow(k // i, n, MOD) for i in range(1, k + 1)]
d.insert(0, 0)

for i in range(k, 0, -1):  # 大きいほうから
    for j in range(i * 2, k + 1, i):  # iの倍数
        # d[6] = d'[6] - d[12] - d[18] ...
        d[i] -= d[j]
        d[i] %= MOD
ans = 0
for i, item in enumerate(d):
    ans += i * item
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
# YouTube解説
MOD = 1000000007
n, k = [int(x) for x in input().split()]
d = [0] * (k + 1)

for i in range(0, k + 1):
    d[i] = pow(k // i, n, MOD)

for i in range(k, 0, -1):  # 大きいほうから
    for j in range(i * 2, k + 1, i):  # iの倍数
        # d[6] = d'[6] - d[12] - d[18] ...
        d[i] -= d[j]
        d[i] %= MOD
ans = 0
for i, item in enumerate(d):
    ans += i * item
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
# YouTube解説
MOD = 1000000007
n, k = [int(x) for x in input().split()]
d = [pow(k, n, MOD) for i in range(1, k+1)]

for i in range(k, 0, -1):  # 大きいほうから
    for j in range(i * 2, k + 1, i):  # iの倍数
        # d[6] = d'[6] - d[12] - d[18] ...
        d[i] -= d[j]
        d[i] %= MOD
ans = 0
for i, item in enumerate(d):
    ans += i * item
    ans %= MOD
print(ans)
Problem p02768 (python)

Fixed submission:
def combinations_mod(n, r, mod=1000000007):
    """Returns nCr in mod."""
    r = min(r, n - r)
    combs = 1
    for i, j in zip(range(n - r + 1, n + 1), range(1, r + 1)):
        combs = combs % mod * i % mod * pow(j, mod - 2, mod) % mod
    return combs


def main():
    n, a, b = [int(x) for x in input().split()]
    mod = 1000000007
    total = pow(2, n, mod) - 1
    ans = total - combinations_mod(n, a) - combinations_mod(n, b)
    ans %= mod
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def combinations_mod(n, r, mod=1000000007):
    """Returns nCr in mod."""
    combs = 1
    for i, j in zip(range(n - r + 1, n + 1), range(1, r + 1)):
        combs = combs % mod * i % mod * pow(j, mod - 2, mod) % mod
    return combs


def main():
    n, a, b = [int(x) for x in input().split()]
    combs = [0] * (n + 1)  # memorize
    combs[0] = 1  # Pick no flower
    ans = 0
    for pick in range(1, n + 1):
        tmp = combs[n - pick]
        if tmp != 0:
            comb = tmp
        else:
            comb = combinations_mod(n, pick)
        combs[pick] = comb
        if pick not in (a, b):
            ans += comb
            ans %= 1000000007

    print(ans)


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

Fixed submission:
def main():
    n, k = [int(x) for x in input().split()]
    dice = [int(x) for x in input().split()]

    expected_accum = []
    for i, p in enumerate(dice):
        ex = (1 + p) / 2
        if i == 0:
            expected_accum.append(ex)
        else:
            expected_accum.append(expected_accum[-1] + ex)

    def gen():
        for start in range(n - k + 1):
            if start == 0:
                yield expected_accum[k - 1]
            else:
                yield expected_accum[start + k - 1] - expected_accum[start - 1]

    print(max(gen()))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from itertools import accumlate


def main():
    n, k = [int(x) for x in input().split()]
    dice = [int(x) for x in input().split()]

    expected_accum = list(accumlate((1 + p) / 2 for p in dice))

    def gen():
        for start in range(n - k + 1):
            if start == 0:
                yield expected_accum[k - 1]
            else:
                yield expected_accum[start + k - 1] - expected_accum[start - 1]

    print(max(gen()))


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

Fixed submission:
def main():
    item_count, capacity = [int(x) for x in input().split()]
    weights, values = [], []
    for _ in range(item_count):
        w, v = [int(x) for x in input().split()]
        weights.append(w)
        values.append(v)
    # dp[i][j]
    # = (i番目までの品物を、重さがj以下になるように選んだときの価値の最大値)
    dp = [[0] * (capacity + 1) for _ in range(item_count)]
    for item_i in range(item_count):
        for weight_i in range(1, capacity + 1):
            w = weights[item_i]
            if w <= weight_i:
                dp[item_i][weight_i] = max(
                    dp[item_i - 1][weight_i - w] + values[item_i],
                    dp[item_i - 1][weight_i])
            else:
                dp[item_i][weight_i] = dp[item_i - 1][weight_i]
    print(dp[item_count - 1][capacity])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    item_count, capacity = [int(x) for x in input().split()]
    weights, values = [], []
    for _ in range(item_count):
        w, v = [int(x) for x in input().split()]
        weights.append(w)
        values.append(v)
    # dp[i][j]
    # = (i番目までの品物を、重さがj以下になるように選んだときの価値の最大値)
    dp = [[0] * (capacity + 1) for _ in range(item_count)]
    for item_i in range(item_count):
        for weight_i in range(1, capacity + 1):
            if (w := weights[item_i]) <= weight_i:
                dp[item_i][weight_i] = max(
                    dp[item_i - 1][weight_i - w] + values[item_i],
                    dp[item_i - 1][weight_i])
            else:
                dp[item_i][weight_i] = dp[item_i - 1][weight_i]
    print(dp[item_count - 1][capacity])


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

Fixed submission:
def main():
    x, a, b = [int(input()) for i in range(3)]
    ans = (x - a) % b
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main(a, b, c, x):

    def gen(coin, n_of_coins, x_parts):
        for x_part in x_parts:
            for i in range(n_of_coins + 1):
                new_x_part = x_part + coin * i
                yield new_x_part

    x_maybe_iter = gen(50, c, gen(100, b, gen(500, a, [0])))
    patterns = sum(x_maybe == x for x_maybe in x_maybe_iter)
    return patterns


if __name__ == '__main__':
    a, b, c, x = [int(input()) for _ in range(4)]
    print(main(a, b, c, x))
Problem p03449 (python)

Fixed submission:
def main():
    n = int(input())
    matrix = []
    matrix.append([int(num) for num in input().split()])
    matrix.append([int(num) for num in input().split()])

    candies = [sum(matrix[0][:d+1]) + sum(matrix[1][d:]) for d in range(n)]
    print(max(candies))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    matrix = [list(map(int, list(input()))) for i in range(2)]

    candies = [sum(matrix[0][:d+1]) + sum(matrix[1][d:]) for d in range(n)]
    print(max(candies))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    matrix = [list(map(int, list(input()))) for i in range(2)]

    candies = [sum(matrix[0][:d+1]) + sum(matrix[1][d:]) for d in range(n)]
    print(max(candies))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    matrix = [int(num) for num in [input().split() for _ in range(2)]]

    candies = [sum(matrix[0][:d+1]) + sum(matrix[1][d:]) for d in range(n)]
    print(max(candies))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    matrix = [int(num) for num in (input().split() for i in range(2))]

    candies = [sum(matrix[0][:d+1]) + sum(matrix[1][d:]) for d in range(n)]
    print(max(candies))


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

Fixed submission:
h, w = [int(x) for x in input().split()]
matrix = [list(input()) for _ in range(h)]
surrounding_distances = (-1, 0, 1)


def count_bombs(i, j):
    for da in surrounding_distances:
        for db in surrounding_distances:
            if da == db == 0:
                # Not surrounidings.
                continue
            si = i + da
            sj = j + db
            if si < 0 or si >= h or sj < 0 or sj >= w:
                continue
            if matrix[si][sj] == '#':
                yield 1


for i in range(h):
    for j in range(w):
        if matrix[i][j] == '.':
            matrix[i][j] = str(sum(count_bombs(i, j)))

[print(''.join(row)) for row in matrix]

Buggy submission (verdict: Runtime Error):
6 6
#####.
#.#.##
####.#
.#..#.
#.##..
#.#...
Problem p02582 (python)

Fixed submission:
# -*- coding: utf-8 -*-
S = input()
ans = 0
for i in range(len(S)):
  if S[i] == "R":
    if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = input()
ans = 0
for i in range(S):
  if S[i] == "R":
    ans += 1
  else:
    if i == 1:
      ans = 0
print(ans)
Problem p02642 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
m = 1000005

count = 0
cnt = [0] * m
for i in range(n):
  if cnt[a[i]] == 0:
    for j in range(a[i], m, a[i]):
      cnt[j] += 1
  else:
    cnt[a[i]] = 2
for i in range(n):
  if cnt[a[i]] == 1:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
m = 1000000

count = 0
cnt = [0] * m
for i in range(n):
  if cnt[a[i]] == 0:
    for j in range(a[i], m, a[i]):
      cnt[j] += 1
  else:
    cnt[a[i]] = 2
for i in range(n):
  if cnt[a[i]] == 1:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
m = 1000000

count = 0
cnt = [0] * m
for i in range(n):
  if cnt[a[i]] == 0:
    for j in range(a[i], m, a[i]):
      cnt[j] += 1
  elif cnt[a[i]] == 1:
    cnt[a[i]] = 2
for i in range(n):
  if cnt[a[i]] == 1:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
m = 1000000

count = 0
cnt = [0] * m
for i in range(n):
  if cnt[a[i]] == 0:
    for j in range(a[i], m-1, a[i]):
      cnt[j] += 1
  elif cnt[a[i]] == 1:
    cnt[a[i]] = 2
for i in range(n):
  if cnt[a[i]] == 1:
    count += 1
print(count)
Problem p02719 (python)

Fixed submission:
# -*- coding: utf-8 -*-

N, K = map(int, input().split())

remainder = N % K

if remainder > K / 2:
  print(abs(remainder - K))
else:
  print(remainder)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
x = abs(N-K)

remainder = K % x if K >= x else x % K
  
if remainder > x // 2:
  print(abs(remainder - x))
else:
  print(remainder)
Problem p02647 (python)

Fixed submission:
def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    
    if K > 41:
        K = 41
    
    for k in range(K):
        B = [0 for i in range(N)]
        for i in range(N):
            low = max(0,i-A[i])
            high = min(N-1,i+A[i])
            B[low] += 1
            if high+1 < N:
                B[high+1] -= 1
        for i in range(1,N):
            B[i] += B[i-1]
        A = B
    
    print(*A)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    
    if K > 41
        K = 41
    
    for k in range(K):
        B = [0 for i in range(N)]
        for i in range(N):
            low = max(0,i-A[i])
            high = min(N-1,i+A[i])
            B[low] += 1
            if high+1 < N:
                B[high+1] -= 1
        for i in range(1,N):
            B[i] += B[i-1]
        A = B
    
    print(*A)
    
if __name__ == '__main__':
    main()
Problem p02690 (python)

Fixed submission:
X = int(input())
flag = False
for i in range(-120,120):
    for j in range(-120,120):
        if i**5 - j**5 == X:
            print(str(i) + ' ' + str(j))
            flag = True
            break
    if flag:
        break

Buggy submission (verdict: Runtime Error):
def DI(n):
    D = []
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            D.append(i)
            if i != n//i:
                D.append(n//i)
    d = sorted(D)[-2]
    return d

X = int(input())
d = DI(X)
a = 0
b = 0
for i in range(d+1):
    for a in range(i+1):
        b = i - a
        if a**5 + b**5 == X:
            print(str(a) + ' ' + str(b))
            break
Problem p02718 (python)

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

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = []
A = list(map(int,input().split()))
list.sort(A, reverse = True)
if A[M] >= sum(A)/(4*M):
    print('Yes')
else:
    print('No')
Problem p02732 (python)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - count[x] + 1)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in range(A):
    print(S - count[x] + 1)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in range(A):
    print(S - A.count(x) + 1)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)/2
for x in range(A):
    print(S - A.count(x) + 1)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in range(CA.values()):
    S += int(i*(i-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)
Problem p03574 (python)

Fixed submission:
H,W = map(int,input().split())
S = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    S[i] = list(input())
for i in range(H):
    for j in range(W):
        if (S[i][j] == '.'):
            count = 0
            for a in range(-1,2):
                for b in range(-1,2):
                    if(0<=i+a<=H-1 and 0<=j+b<=W-1):
                        if(S[i+a][j+b] == '#'):
                            count += 1
            S[i][j] = count
    print(*S[i], sep='')

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
S = [input().split() for i in range(H)]
for i in range(0,H):
    for j in range(0,W):
        if (S[i][j] == '.'):
            count = 0
            for a in range(-1,2):
                for b in range(-1,2):
                    if(0<=i+a<=H-1 and 0<=j+b<=W-1):
                        if(S[i+a][j+b] == '#'):
                            count += 1
            S[i][j] = count
    print(S[i])

Buggy submission (verdict: Runtime Error):
H,W = map(int,input('H W=').split())
S = [list(map(int,input().split())) for i in range(H)]
for i in range(0,H):
    for j in range(0,W):
        if (S[i][j] == '.'):
            count = 0
            for a in range(-1,2):
                for b in range(-1,2):
                    if(0<=i+a<=H-1 and 0<=j+b<=W-1):
                        if(S[i+a][j+b] == '#'):
                            count += 1
            S[i][j] = count
    print(S[i])

Buggy submission (verdict: Runtime Error):
H,W = map(int,input('H W=').split())
S = []
for i in range(H):
    s = list(map(int,input().strip().split()))
    S.append(s)
for i in range(0,H):
    for j in range(0,W):
        if (S[i][j] == '.'):
            count = 0
            for a in range(-1,2):
                for b in range(-1,2):
                    if(0<=i+a<=H-1 and 0<=j+b<=W-1):
                        if(S[i+a][j+b] == '#'):
                            count += 1
            S[i][j] = count
    print(S[i])
Problem p02548 (python)

Fixed submission:

import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
import time

import numpy as np
import numba
from numba import njit, b1, i4, i8, f8
from numba import jit


def main():
    N = int(input())
    ans=0
    for i in range(1,N+1):
        if N%i==0:
            ans+=N//i -1
        else:
            ans+=N//i
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
import time

import numpy as np
import numba
from numba import njit, b1, i4, i8, f8
from numba import jit


def main():
    N = int(input())
    count=0
    ans=False
    for i in range(N):
        a,b = map(int,input().split())
        if a==b:
            count += 1
        else:
            count=0
        if count >=3:
            ans=True
    print("Yes" if ans else "No")

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

Fixed submission:
import numpy as np
import math
import collections
import bisect
from collections import Counter


N = int(input())

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

A.sort()
Set = set()

Amax = A[len(A) - 1]

counter = Counter(A)
ans = 0
for a in A:
    if a in Set:
        continue
    x = a
    while(x <= Amax):
        Set.add(x)
        x += a

    if counter[a] == 1:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import collections
import bisect
# import sympy


N = int(input())

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

A.sort()
setA = set(A)

Amax = A[len(A) - 1]
dp = [True for i in range(Amax + 1)]
ans = 0
for i in range(len(A)):
    if i < len(A) - 1:
        if A[i] == A[i + 1]:
            continue
    if i > 0:
        if A[i] == A[i - 1]:
            continue

    if dp[A[i]] == True and A[i] in set(A):
        c = 2
        ans += 1
        while(c * A[i] <= Amax):
            dp[c * A[i]] = False
            c += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import collections
import bisect
#import sympy


def divisor(n):
    i = 1
    lower_divisors, upper_divisors = [], []
    while(i * i <= n):
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


N = int(input())

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

A.sort()

ans = 0
ans = N
Set = set()
for i in range(N):
    divs = divisor(A[i])
    # print(divs)
    if i != 0:
        Set.add(A[i - 1])
    if i < N - 1:
        if A[i] == A[i + 1]:
            ans -= 1
            continue

    for d in divs:
        if i != 0:
            if d in Set:
                ans -= 1
                break
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import collections
import bisect
import sympy


def divisor(n):
    i = 1
    lower_divisors, upper_divisors = [], []
    while(i * i <= n):
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


N = int(input())

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

A.sort()

ans = 0
ans = N
for i in range(N):
    divs = sympy.divisors(A[i])
    # print(divs)
    Set = set(A[:i])
    if i < N - 1:
        if A[i] == A[i + 1]:
            ans -= 1
            continue

    for d in divs:
        if i != 0:
            if d in Set:
                ans -= 1
                break
print(ans)
Problem p02742 (python)

Fixed submission:
# Code for B - Bishop
# Use input() to fetch data from STDIN
from math import ceil
import sys
[H, W] = map(int, input().split())

if H <= 1:
    print(1)
    sys.exit(0)

if W <= 1:
    print(1)
    sys.exit(0)


print(ceil(H * W / 2))

Buggy submission (verdict: Runtime Error):
# Code for B - Bishop
# Use input() to fetch data from STDIN
from math import ceil
import sys
[H, W] = map(int, input().split())

if H <= 1:
    print(1)
    sys.exit(1)

if W <= 1:
    print(1)
    sys.exit(1)


print(ceil(H * W / 2))
Problem p03455 (python)

Fixed submission:
# coding: utf-8

judge = input().split()

if (int(judge[0]) * int(judge[1])) % 2 == 1:
    print("Odd")
else:
    print("Even")

Buggy submission (verdict: Runtime Error):
# coding: utf-8

judge = input().split()

if int(judge[0] * judge[1]) % 2 == 1:
    print("Odd")
else:
    print("Even")
Problem p03457 (python)

Fixed submission:
from collections import deque

N = int(input())
t = deque([0] * N)
x = deque([0] * N)
y = deque([0] * N)

for i in range(N):
    t[i], x[i], y[i] = map(int, input().split())

N += 1
t.appendleft(0)
x.appendleft(0)
y.appendleft(0)

for i in range(N-1):
    t_sub = t[i+1] - t[i]
    x_sub = abs(x[i+1] - x[i])
    y_sub = abs(y[i+1] - y[i])
    dist = x_sub + y_sub
    if dist > t_sub or t_sub % 2 != dist % 2:
        print('No')
        exit()

print('Yes')

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

N = int(input())
t = [0] * N
x = [0] * N
y = [0] * N

for i in range(N):
    t[i], x[i], y[i] = map(int, input().split())

N += 1
t.appendleft(0)
x.appendleft(0)
y.appendleft(0)

for i in range(N):
    t_sub = t[i+1] - t[i]
    x_sub = abs(x[i+1] - x[i])
    y_sub = abs(y[i+1] - y[i])
    dist = x_sub + y_sub
    if dist > t_sub or t_sub % 2 == dist % 2:
        print('No')
        exit()

print('Yes')