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

Fixed submission:
import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)]) == '.'
up = np.zeros((H, W), dtype=int)
down = np.zeros((H, W), dtype=int)
left = np.zeros((H, W), dtype=int)
right = np.zeros((H, W), dtype=int)
 
for i in range(H):
    up[i] = (up[i-1] + 1) * S[i]
    down[-i-1] = (down[-i] + 1) * S[-i-1]

for i in range(W):
    left[:, i] = (left[:, i-1] + 1) * S[:, i]
    right[:, -i-1] = (right[:, -i] + 1) * S[:, -i-1]

print(np.max(up+down+left+right)-3)

Buggy submission (verdict: Runtime Error):
import numpy as np
 
H, W = map(int, input().split())
S = [input() for _ in range(H)]
 
light = np.array([[-1, -1] for _ in range(H*W)])
 
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        
        if light[W*i+j][0] == -1:
            tmp = 0
            tate = i
            while tate < H and S[tate][j] == '.':
                tmp += 1
                tate += 1
            for k in range(tmp):
                light[W*(i+k)+j][0] = tmp
        
        if light[W*i+j][1] == -1:
            tmp = 0
            yoko = j
            while yoko < W and S[i][yoko] == '.':
                tmp += 1
                yoko += 1
            for k in range(tmp):
                light[W*i+j+k][1] = tmp
 
 
print(np.max(light.sum(axis=1))-1)
Problem p03074 (python)

Fixed submission:
N, K = map(int, input().split())
S = list(input())
left = 0
right = 0
onecnt = 0
zerocnt = 0
zeroflag = False
leftflag = False
ans = 0

while right < N:
    if S[right] == '0' and not zeroflag:
        zerocnt += 1
        zeroflag = True
    elif S[right] == '1' and zeroflag:
        zeroflag = False
        
    if zerocnt > K and zeroflag:
        tmp = right - left
        if tmp > ans:
            ans = tmp
        while True:
            if S[left] == '0' and not leftflag:
                leftflag = True
            elif S[left] == '1' and leftflag:
                leftflag = False
                break
            left += 1
        zerocnt -= 1
    right += 1

if right - left > ans:
    ans = right - left

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline 
N, K = map(int, input().split())
S = list(map(int, input()))

cnt = 0
now = 1
Nums = []

for i in range(N):
    if S[i] == now:
        cnt += 1
    else:
        Nums.append(cnt)
        now = 1 - now
        cnt = 1

if cnt != 0:
    Nums.append(cnt)
if len(Nums) % 2 == 0:
    Nums.append(0)

add = 2*K+1
ans = 0
left = right = 0
tmp = 0    # [left, right)

for i in range(0, len(Nums), 2):
    Nextleft = i
    Nextright = min(i+add, len(Nums))
    
    while Nextleft > left:
        tmp -= Nums[left]
        left += 1
    
    while Nextright > right:
        tmp += Nums[right]
        right += 1
    
    ans = max(tmp, ans)

print(ans)
Problem p03076 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
tmp = 9
last = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        continue
    else:
        if i % 10 <= tmp:
            tmp = i % 10
            last = i

ans = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        ans += i
    else:
        ans += i + (10-i%10)

print(ans-(10-last%10) if last != 0 else ans)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
tmp = 9
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        continue
    else:
        if i % 10 < tmp:
            tmp = i % 10
            last = i

ans = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        ans += i
    else:
        ans += i + (10-i%10)

print(ans-(10-last%10))
Problem p03085 (python)

Fixed submission:
b = input()
if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "G":
    print("C")
else:
    print("G")

Buggy submission (verdict: Runtime Error):
b = int(input())
if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "G":
    print("C")
else:
    print("G")
Problem p03149 (python)

Fixed submission:
N = [str(_) for _ in input().split()]
S = "".join(sorted(N))
print("YES" if S == '1479' else "NO")

Buggy submission (verdict: Runtime Error):
N = [int(_) for _ in input().split()]
S = "".join(sorted(N))
print("YES" if S == 1479 else "NO")
Problem p03160 (python)

Fixed submission:
N = int(input())
h = list(map(int, input().split()))
dp = [(10 ** 4) * N] * N
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, N):
    dp[i] = min(dp[i-2] + abs(h[i] - h[i-2]), dp[i-1] + abs(h[i] - h[i-1]))

print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
h = [int(_) for _ in input().split()] + [0]*N
dp = [float('inf')]*(N*N)
dp[0] = 0
dp[1] = abs(h[0]-h[1])

for i in range(N):
    dp[i+1] = min(dp[i+1], dp[i]+abs(h[i]-h[i+1]))
    dp[i+2] = min(dp[i+2], dp[i]+abs(h[i]-h[i+2]))

print(dp[N-1])
Problem p03161 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [0] * N

for i, hi in enumerate(h):
    if i == 0:
        continue
    if i - K < 0:
        dp[i] = min(dpk + abs(hi-hk) for dpk, hk in zip(dp[:i], h[:i]))
    else:
        dp[i] = min(dpk + abs(hi-hk) for dpk, hk in zip(dp[i-K:i], h[i-K:i]))

print(dp[-1])

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

N, K = map(int, input().split())
h = [int(x) for _ in input().split()]
init = 10**9
dp = [init] * N
dp[0] = 0

for i in range(1, N):
    if i - K < 0:
        dp[i] = min(dpk + abs(h[i]-hk) for dpk, hk in zip(dp[:i], h[:i]))
    else:
        dp[i] = min(dpk + abs(h[i]-hk) for dpk, hk in zip(dp[i-K:i], h[i-K:i]))

print(dp[-1])
Problem p03193 (python)

Fixed submission:
N, H, W = map(int, input().split())
AB = [[int(_) for _ in input().split()] for _ in range(N)]
ans = 0

for i in AB:
    if i[0] >= H and i[1] >= W:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N, H, W = map(int, input().split())
AB = [[int(_) for _ in input().split()] for _ in range(N)]
ans = 0

for i in AB:
    if i[0] >= H and AB[1] >= W:
        ans += 1

print(ans)
Problem p03196 (python)

Fixed submission:
N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    prime = [0] * (10**6+1)
    index = 2
    tmp = 0
    while P > 1 and index < 10**6+1:
        if P % index == 0:
            tmp += 1
            P //= index
            if P == 1:
                prime[index] = tmp
        else:
            prime[index] = tmp
            tmp = 0
            if index == 2:
                index += 1
            else:
                index += 2
    
    
    if prime[2] >= N:
        ans = 2 ** (prime[2]//N)
    else:
        ans = 1
    for i in range(3, 10**6+1, 2):
        ans *= max(1, i ** (prime[i]//N))
    
    print(ans)

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    prime = [0] * (10**6+1)
    index = 2
    tmp = 0
    while P > 1:
        if P % index == 0:
            tmp += 1
            P //= index
            if P == 1:
                prime[index] = tmp
        else:
            prime[index] = tmp
            tmp = 0
            if index == 2:
                index += 1
            else:
                index += 2
    
    
    if prime[2] >= N:
        ans = 2 ** (prime[2]//N)
    else:
        ans = 1
    for i in range(3, 10**6+1, 2):
        ans *= max(1, i ** (prime[i]//N))
    
    print(ans)

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    prime = [0] * (10**6+1)
    index = 2
    tmp = 0
    while P > 1:
        if P % index == 0:
            tmp += 1
            P //= index
            if P == 1:
                prime[index] = tmp
        else:
            prime[index] = tmp
            tmp = 0
            if index == 2:
                index += 1
            else:
                index += 2
    
    
    if prime[2] >= N:
        ans = 2
    else:
        ans = 1
    for i in range(3, 10**6+1, 2):
        if prime[i] >= N:
            ans *= i
    
    print(ans)
Problem p03213 (python)

Fixed submission:
import bisect
from math import factorial as fact
import sys
input = sys.stdin.readline
 
N = int(input())
prime = []
p_flag = [False] * (101)
p_flag[0] = p_flag[1] = True
 
for i in range(2, 101):
    if not p_flag[i]:
        prime.append(i)
        for j in range(2*i, 101, i):
            p_flag[j] = True
 
M = len(prime)
factor = [0]*M
 
for i in range(2, N+1):
    for j in range(M):
        tmp = prime[j]
        if tmp > i:
            break
        while i % tmp == 0:
            factor[j] += 1
            tmp *= prime[j]
 
factor = factor[::-1]
point74 = M - bisect.bisect_left(factor, 74)
point24 = M - bisect.bisect_left(factor, 24)
point14 = M - bisect.bisect_left(factor, 14)
point4 = M - bisect.bisect_left(factor, 4)
point2 = M - bisect.bisect_left(factor, 2)
 
if N < 10:
    ans = 0
else:
    ans = fact(point4)//(fact(point4-2)*fact(2)) * (point2-2)
    if point14 > 0:
        ans += point14 * (point4-1)
    if point24 > 0:
        ans += point24 * (point2-1)
    if point74 > 0:
        ans += point74
 
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
from math import factorial as fact
import sys
input = sys.stdin.readline

N = int(input())
prime = []
p_flag = [False] * (101)
p_flag[0] = p_flag[1] = True

for i in range(2, 101):
    if not p_flag[i]:
        prime.append(i)
        for j in range(2*i, 101, i):
            p_flag[j] = True

M = len(prime)
factor = [0]*M

for i in range(2, N+1):
    for j in range(M):
        tmp = prime[j]
        while i % tmp == 0:
            factor[j] += 1
            tmp *= tmp

factor = factor[::-1]
point74 = M - bisect.bisect_left(factor, 74)
point24 = M - bisect.bisect_left(factor, 24)
point14 = M - bisect.bisect_left(factor, 14)
point4 = M - bisect.bisect_left(factor, 4)
point2 = M - bisect.bisect_left(factor, 2)

ans = max(fact(point4)//(fact(point4-2)*fact(2)) * (point2-2), 0)
if point14 > 0:
    ans += point14 * (point4-1)
if point24 > 0:
    ans += point24 * (point2-1)
if point74 > 0:
    ans += point74

print(ans)
Problem p03241 (python)

Fixed submission:
import bisect
import math
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
if M % N == 0:
    print(M//N)
else:
    upper = math.ceil(M/N)
    factor = set()
    for i in range(1, int(M**0.5)+1):
        if M % i == 0:
            factor.add(i)
    
    factor1 = set()
    for i in factor:
        factor1.add(M//i)
    factor |= factor1
    
    factor = sorted(list(factor))
    print(factor[bisect.bisect_right(factor, upper)-1])

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

N, M = map(int, input().split())
if M % N == 0:
    print(M//N)
else:
    upper = math.ceil(M/N)
    for i in range(upper, 0, -1):
        if M % i == 0:
            break

    print(i)
Problem p03244 (python)

Fixed submission:
import sys
input = sys.stdin.readline

n = int(input())
v = [int(_) for _ in input().split()]
oddcnt = [[0, i] for i in range(10**5+1)]
evencnt = [[0, i] for i in range(10**5+1)]

for i, j in enumerate(v):
    if i % 2 == 0:
        oddcnt[j][0] += 1
    else:
        evencnt[j][0] += 1

oddcnt = sorted(oddcnt, key=lambda x: (-x[0], x[1]))
evencnt = sorted(evencnt, key=lambda x: (-x[0], -x[1]))

if oddcnt[0][1] != evencnt[0][1]:
    print(n-oddcnt[0][0]-evencnt[0][0])
elif oddcnt[0][0] > evencnt[0][0]:
    print(n-oddcnt[0][0]-evencnt[1][0])
elif oddcnt[0][0] < evencnt[0][0]:
    print(n-oddcnt[1][0]-evencnt[0][0])
elif oddcnt[1][0] > evencnt[1][0]:
    print(n-oddcnt[1][0]-evencnt[0][0])
else:
    print(n-oddcnt[0][0]-evencnt[1][0])

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

n = int(input())
v = [int(_) for _ in input().split()]
oddcnt = [[0, i] for i in range(1, 10**5+1)]
evencnt = [[0, i] for i in range(1, 10**5+1)]

for i, j in enumerate(v):
    if i % 2 == 0:
        oddcnt[j][0] += 1
    else:
        evencnt[j][0] += 1

oddcnt = sorted(oddcnt, key=lambda x: (-x[0], x[1]))
evencnt = sorted(evencnt, key=lambda x: (-x[0], -x[1]))

if oddcnt[0][1] != evencnt[0][1]:
    print(n-oddcnt[0][0]-evencnt[0][0])
elif oddcnt[0][0] > evencnt[0][0]:
    print(n-oddcnt[0][0]-evencnt[1][0])
else:
    print(n-oddcnt[1][0]-evencnt[0][0])
Problem p03288 (python)

Fixed submission:
R = int(input())
if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else:
  print("AGC")

Buggy submission (verdict: Runtime Error):
R = int(input())
if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else
  print("AGC")
Problem p03289 (python)

Fixed submission:
S = input()
N = len(S)
flag = False

for i, charS in enumerate(S):
    if charS == "C" and (1 < i and i < N-1):
        flag = True
        numC = i
        break

if S[0] != "A":
    flag = False

if flag:
    text = [S[j] for j in range(N) if j != 0 and j != numC]
    text = ''.join(text)
    if not(text.islower()):
        flag = False

print("AC" if flag else "WA")

Buggy submission (verdict: Runtime Error):
S = input()
flag = True

if S[0] != 'A':
    flag = False

for i in range(2, len(S)-1):
    if S[i] == 'C':
        break
else:
    flag = False

if flag:
    copy = []
    for j in range(1, len(S)):
        if j == i:
            continue
        copy += S[j]

if not(''.join(copy).islower()):
    flag = False

print("AC" if flag else "WA")

Buggy submission (verdict: Runtime Error):
S = input()
flag = True

if S[0] != 'A':
    flag = False

for i in range(2, len(S)-1):
    if S[i] == 'C':
        break
else:
    flag = False

if flag:
    copy = []
    for j in range(1, len(S)):
        if j == i:
            continue
        copy += S[j]

if not(''.join(copy).islower()):
    flag = False
    
print("AC" if flag else "WA")
Problem p03316 (python)

Fixed submission:
N = input()
S = list(map(int, N))
print("Yes" if int(N) % sum(S) == 0 else "No")

Buggy submission (verdict: Runtime Error):
N = input()
S = list(map(int, N))
print("Yes" if N % sum(S) == 0 else "No")
Problem p03379 (python)

Fixed submission:
N = int(input())
X = [int(_) for _ in input().split()]
L = sorted(X)

small = L[N//2-1]
large = L[N//2]

for i in X:
    if i <= small:
        print(large)
    else:
        print(small)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = [int(_) for _ in input().split()]
L = sorted(X)

small = L[N//2]
large = L[N//2+1]

for i in X:
    if i <= small:
        print(large)
    else:
        print(small)
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B)+min(C,D))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B)+min(C+D))
Problem p03424 (python)

Fixed submission:
N = int(input())
S = input().split()
res = len(set(S))
print("Three" if res == 3 else "Four")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input().split() for _ in range(N)]
res = len(set(S))
print("Three" if res == 3 else "Four")
Problem p03567 (python)

Fixed submission:
S = input()
flag = False

for i in range(4):
    if S[i:i+2] == "AC":
        flag = True

print("Yes" if flag else "No")

Buggy submission (verdict: Runtime Error):
S = input()
flag = False

for i in range(4):
    if S[i:i+2] == "AC"
        flag = True

print("Yes" if flag else "No")
Problem p03579 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


def dfs(v, cur):
    color[v] = cur
    
    for next_v in Graph[v]:
        if color[next_v] != -1:
            if color[next_v] != cur:
                continue
            else:
                return False
        elif not dfs(next_v, 1-cur):
            return False
    return True
        


N, M = map(int, input().split())
AB = [[int(_) for _ in input().split()] for _ in range(M)]
Graph = [[] for _ in range(N)]
color = [-1]*N

for i in AB:
    Graph[i[0]-1].append(i[1]-1)
    Graph[i[1]-1].append(i[0]-1)

if dfs(0, 0):
    black = color.count(0)
    white = N - black
    print(black*white-M)
else:
    print(comb(N, 2)-M)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


def dfs(v, cur):
    color[v] = cur
    
    for next_v in Graph[v]:
        if color[next_v] != -1:
            if color[next_v] != cur:
                continue
            else:
                return False
        elif not dfs(next_v, 1-cur):
            return False
    return True
        


N, M = map(int, input().split())
AB = [[int(_) for _ in input().split()] for _ in range(M)]
Graph = [[] for _ in range(N)]
color = [-1]*N

for i in AB:
    Graph[i[0]-1].append(i[1]-1)
    Graph[i[1]-1].append(i[0]-1)

if dfs(0, 0):
  	black = color.count(0)
    white = N - black
    print(black*white-M)
else:
    print(comb(N, 2)-M)
Problem p03633 (python)

Fixed submission:
import sys
input = sys.stdin.readline


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a*b // gcd(a, b)


N = int(input())
T = [int(input()) for _ in range(N)]

if N == 1:
    print(T[0])

else:
    LCM = lcm(T[0], T[1])
    
    for i in range(1, N-1):
        LCM = lcm(LCM, T[i+1])
    
    print(LCM)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a*b // gcd(a, b)


N = int(input())
T = [int(input()) for _ in range(N)]
LCM = lcm(T[0], T[1])

for i in range(1, N-1):
    LCM = lcm(LCM, T[i+1])

print(LCM)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1

for i in T:
    ans = (ans * i) // math.gcd(ans, i)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
T = [int(input()) for _ in range(N)]
lcm = 1

for i in T:
    lcm = lcm*i//math.gcd(lcm, i)

print(lcm)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
T = [int(input()) for _ in range(N)]
LCM = 1

for i in T:
    LCM = LCM*i//math.gcd(LCM, i)

print(LCM)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
T = [int(input()) for _ in range(N)]
LCM = 1

for i in T:
    LCM = LCM*i//math.gcd(LCM, i)

print(LCM)
Problem p03651 (python)

Fixed submission:
from fractions import gcd

N, K = map(int, input().split())
A = [int(_) for _ in input().split()]

if N == 1:
    print("POSSIBLE" if K == A[0] else "IMPOSSIBLE")
else:
    GCD = gcd(A[0], A[1])
    
    for i in range(2, N):
        GCD = gcd(GCD, A[i])
    
    if K <= max(A) and K % GCD == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

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

N, K = map(int, input().split())
A = [int(_) for _ in input().split()]
GCD = gcd(A[0], A[1])

for i in range(2, N):
    GCD = gcd(GCD, A[i])

if K <= max(A) and K % GCD == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem p03675 (python)

Fixed submission:
n = int(input())
a = [int(_) for _ in input().split()]

if n%2==0:
    s = a[n-1::-2] + a[::2]
else:
    s = a[n-1::-2] + a[1::2]

print(*s)

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

if (n % 2) == 0:
    print(*a[n-1::-2], *a[::2])
else:
    print(*a[n-1::-2], *a[1::2])

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

if n % 2 == 0:
    print(*a[n-1::-2], *a[::2])
else:
    print(*a[n-1::-2], *a[1::2])
Problem p03861 (python)

Fixed submission:
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)

Buggy submission (verdict: Runtime Error):
def f(n):
    return(int(n/x)+1 if n >=0 else 0)
    
a, b, x = list(map(int, input().split()))
print(max(f(b)-f(a-1)),0)
Problem p03919 (python)

Fixed submission:
from itertools import product

H, W = map(int, input().split())
L = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
S = [[str(_) for _ in input().split()] for _ in range(H)]

for i, j in product(range(H), range(W)):
    if S[i][j] == "snuke":
        break

res = L[j] + str(i+1)
print(res)

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

H, W = map(int, input().split())
L = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
S = [[str(_) for _ in input().split()] for _ in range(W)]

for i, j in product(range(H), range(W)):
    if S[i][j] == "snuke":
        break

res = L[i] + str(j+1)
print(res)
Problem p03957 (python)

Fixed submission:
s = input()
flag = False
for i in range(len(s)):
    if s[i] == "C":
        flag = True
        break


if flag:
    flag = False
    for j in range(len(s)-1, -1, -1):
        if s[j] == "F":
            flag = True
            break

print("Yes" if (flag and i < j) else "No")

Buggy submission (verdict: Runtime Error):
s = input()
flag = False
for i in range(len(s)):
    if s[i] == "C":
        flag = True
        break


if flag:
    flag = False
    for j in range(len(s)-1, -1, -1):
        if s[j] == "F":
            flag = True
            break

print("Yes" if i < j and flag else "No")

Buggy submission (verdict: Runtime Error):
s = input()
flag = False
for i in range(len(s)):
    if s[i] == "C":
        flag = True
        break


if flag:
    flag = False
    for j in range(len(s)-1, 0, -1):
        if s[j] == "F":
            flag = True
            break

print("Yes" if i < j and flag else "No")
Problem p02742 (python)

Fixed submission:
x, y = map(int, input().split())

count = 0
if y == 1 or x == 1:
	count = 1
elif y % 2 == 0:
	count = x * (y // 2)
else:
	count = x * ((y + 1) // 2) - (x // 2)

print(count)

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

count = 0
if y % 2 == 0:
	count = x * (y // 2)
elif y == 1
	count = 1
else:
	count = x * ((y + 1) // 2) - (x // 2)

print(count)
Problem p02717 (python)

Fixed submission:
ina = list(map(int, input().split()))
 
print(ina[2], ina[0], ina[1])

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

print(in[2], in[0], in[1])
Problem p02993 (python)

Fixed submission:
a = input()
flag = False

for i in range(0, 3):
    if a[i] == a[i+1]:
        print("Bad")
        flag = True
        break

if not flag:
    print("Good")

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

for i in range(0,3):
  if a[i] == a[i+1]:
    print("Bad")
	return

print("Good")
Problem p03071 (python)

Fixed submission:
A, B = map(int, input().split())
cnt = 0
for i in range(2):
    cnt += max(A, B)
    if A == max(A, B):
        A -= 1
    else:
        B -= 1

print(cnt)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())
cnt = 0
for i in range(2):
  cnt += max(A, B)
  A -= 1 if A == max(A, B) else B -= 1
  
print(cnt)
Problem p03493 (python)

Fixed submission:
number = str(input())
count = 0

for n in number:
  if n == "1":
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n: int = input()
number: int = []
count: int = 0
flag: bool = False

number = list(map(int, input().split()))
while flag != True:
    tmp: int = []
    for n in number:
        if n % 2 == 0:
            tmp.append(n / 2)

        else:
            flag = True
            break

    if flag:
        print(count)
        break

    number = tmp
    count += 1

Buggy submission (verdict: Runtime Error):
n: int = input()
number: int = [input()]
count: int = 0
flag: bool = False

while flag != True:
    tmp: int = []
    for n in number:
        if n % 2 == 0:
            tmp.append(n / 2)

        else:
            flag = True
            break

    if flag:
        print(count)
        break

    number = tmp
    count += 1