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

Fixed submission:
str1 = input()
n = len(str1)
m = int((n-1)/2)
o = int((n+3)/2)
str2 = str1[:m]
str3 = str1[(o-1):n]
if str1 != str1[::-1]:
	print("No")
else:
    if str2 != str2[::-1]:
	    print("No")
    else:   
        if str3 != str3[::-1]:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
str1 = input()
n = len(str1)
m = (n-1)/2
o = (n+3)/2
str2 = str1[:m]
str3 = str1[o:n]
if str1 != str1[::-1]:
	print("No")
else:
  	if str2 != str2[::-1]:
    	print("No")
    else:
    	if str3 != str3[::-1]:
        	print("No")
        else:
        	print("Yes")
Problem p02700 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
atA=0
atC=0
while(A>0):
    A-=D 
    atA+=1 
while(C>0):
    C-=B 
    atC+=1
#print(atA,atC)
if(atA>=atC):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input())
if(A/D<C/B):
  print('No')
else:
  print('Yes')
Problem p02663 (python)

Fixed submission:
i_l_s = input().split()
i_l = list(map(int, i_l_s))
 
hour = i_l[4]//60
min = i_l[4]%60
 
before = [i_l[0]+hour, i_l[1]+min]
after = [i_l[2], i_l[3]]
 
if(after[0]-before[0] ==0):
    print(after[1]-before[1])
else:
  result = after[1]-before[1] + 60*(after[0]-before[0])
  print(result)

Buggy submission (verdict: Runtime Error):
i_l_s = input().split()
i_l = list(map(int, i_l_s))
 
hour = i_l[4]//60
min = i[4]%60
 
before = [i_l[0]+hour, i_l[1]+min]
after = [i_l[2], i_l[3]]
 
if(after[0]-before[0] ==0):
    print(after[1]-before[1])
else:
  print(after[1]-before[1] + 60(after[0]-before[0]))

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

hour = i_l[4]//60
min = i[4]%60

before = [i_l[0]+hour, i_l[1]+min]
after = [i_l[2], i_l[3]]

if(after[0]-before[0] ==0):
  else:
    print(after[1]-before[1])
else:
  print(after[1]-before[1] + 60(after[0]-before[0]))
Problem p02713 (python)

Fixed submission:
import math

K = int(input())
ans = 0
for i in range(1, K + 1):
    for j in range(1, K + 1):
        for k in range(1, K + 1):
            ans += math.gcd(i, math.gcd(j, k))

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input())

r = 0
g = 0
b = 0
for s in S:
    if s == 'R':
        r += 1
    elif s == 'G':
        g += 1
    else:
        b += 1
ans = r * b * g

d = 1
while True:
    if 2 * d >= N:
        break
    i = 0
    while True:
        j = i + d
        k = j + d
        if k >= N:
            break
        if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
            ans -= 1
        i += 1
    d += 1

print(ans)
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(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 = list(map(int, input().split()))

A.sort(reverse=True)
if A[M] < 1/(4*M):
  print('Yes')
else:
  print('No')
Problem p02756 (python)

Fixed submission:
from collections import deque

S = list(input())
Q = int(input())
d = deque(S)
flag = -1
for _ in range(Q):
    q = list(input().split())
    if q[0] == '1':
        flag *= -1
    else:
        f = int(q[1])
        c = q[2]
        if flag == -1 and f == 1 or flag == 1 and f == 2:
            d.appendleft(c)
        else:
            d.append(c)
d = list(d)
if flag == 1:
    d = d[::-1]

print(''.join(d))

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

S = list(input())
Q = int(input())
d = deque(S)
flag = -1
for _ in range(Q):
    q = list(input().split())
    if q[0] == '1':
        flag *= -1
    else:
        f = int(q[1])
        c = q[2]
        if flag == 1 and f == 1 or flag == -1 and f == 2:
            d.appendleft(c)
        else:
            d.append(c)

if flag == -1:
    d = d[::-1]

print(''.join(d))
Problem p02765 (python)

Fixed submission:
N, R = map(int, input().split())
if N >= 10:
    print(R)
else:
    print(R + (100 * (10 - N)))

Buggy submission (verdict: Runtime Error):
N, R = map(int, input().split())
if N >= 10:
    print(R)
else:
    print(100 * (10 - K))
Problem p02772 (python)

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

for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print('DENIED')
            exit()

print('APPROVED')

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

for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print('DENIED')
            exit()

print('APPROVED')
Problem p02780 (python)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
l = []

for i in range(N):
    l.append((P[i] + 1) / 2)

n = 0
for i in range(N):
    n += l[i]
    l[i] = n

ans = l[K - 1]
for i in range(N - K):
    ans = max(ans, l[i + K] - l[i])

print(ans)
# print(l)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
P = list(map(int, input().split()))
l = []

for i in range(N):
    l.append((P[i] + 1) / 2)

n = 0
for i in range(N):
    n += l[i]
    l[i] = n

ans = l[K]
for i in range(N - K):
    ans = max(ans, l[i + K] - l[i])

print(ans)
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())

print(H // A + min(H % A, 1))

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

print(H // A + min(H % A))
Problem p02795 (python)

Fixed submission:
H = int(input())
W = int(input())
N = int(input())
import math
print(int(math.ceil(N / max(H, W))))

Buggy submission (verdict: Runtime Error):
H = int(input())
W = int(input())
N = int(input())
import math
print(int(math.ceil(N // max(H, W)))
Problem p02853 (python)

Fixed submission:
X, Y = map(int, input().split())

ans = 0

if X == 3:
    ans += 100000
elif X == 2:
    ans += 200000
elif X == 1:
    ans += 300000

if Y == 3:
    ans += 100000
elif Y == 2:
    ans += 200000
elif Y == 1:
    ans += 300000


if ans == 600000:
    ans += 400000

print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())

ans = 0

def f(n):
    if n == 3:
        tmp = 100000
    elif n == 2:
        tmp = 200000
    elif n == 1:
        tmp= 300000

ans = f(X) + f(Y)

if ans == 600000:
    ans += 400000

print(ans)
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

def input():
    return sys.stdin.readline()

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

edge = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)

counter = [0] * (N + 1)
for _ in range(Q):
    p, x = map(int, input().split())
    counter[p] += x

# print(edge)
# print(counter)

visited = [False] * (N + 1)
visited[1] = True
ans = [0] * (N + 1)

def dfs(fro, p):
    visited[fro] = True
    now = counter[fro] + p
    for to in edge[fro]:
        if not visited[to]:
            dfs(to, now)
    ans[fro] = now
    return

dfs(1, 0)

print(*ans[1:])

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

edge = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)

counter = [0] * (N + 1)
for _ in range(Q):
    p, x = map(int, input().split())
    counter[p] += x

# print(edge)
# print(counter)

visited = [False] * (N + 1)
ans = [0] * (N + 1)

def dfs(fro, p):
    visited[fro] = True
    now = counter[fro] + p
    for to in edge[fro]:
        if not visited[to]:
            dfs(to, now)
    ans[fro] = now

dfs(1, 0)

print(*ans[1:])
Problem p02975 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = sorted(set(A))

if len(B) == 1 and B[0] == 0:
    print('Yes')
    exit()

if N % 3 == 0:
    if len(B) == 2 and A.count(0) == N // 3:
        print('Yes')
        exit()
    if len(B) == 3 and A.count(B[0]) == A.count(B[1]) == A.count(B[2]):
        if B[0] ^ B[1] ^ B[2] == 0:
            print('Yes')
            exit()

print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = sorted(set(A))
if N % 3 == 0:
    if len(B) == 1 and B[0] == 0:
        print('Yes')
        exit()
    if len(B) == 2 and A.count(0) == N // 3 and A.count(B[1]) == 2 * N // 3:
        if B[0] ^ B[1] ^ B[2] == 0:
            print('Yes')
            exit()
    if len(B) == 3 and A.count(B[0]) == A.count(B[1]) == A.count(B[2]):
        print('Yes')
        exit()

print('No')
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(B // 2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(B // 2)
else:
    print(0)
Problem p03037 (python)

Fixed submission:
N, M = map(int, input().split())
A = []
B = []
for _ in range(M):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
ans = min(B) - max(A) + 1

if ans < 1:
    print(0)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
ans = min(B) - max(A) + 1

if ans < 1:
    print(0)
else:
    print(ans)
Problem p03050 (python)

Fixed submission:
N = int(input())
import math
ans = 0
for k in range(1, int(math.sqrt(N) + 1)):
    # print(k - 1, N // k - 1)
    m = N // k - 1
    if m != 0:
        if N % k == 0 and N // m == N % m:
            ans += m

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
import math
ans = 0
for k in range(1, int(math.sqrt(N) + 1)):
    # print(k - 1, N // k - 1)
    m = N // k - 1
    if N % k == 0 and N // m == N % m:
        ans += m

print(ans)
Problem p03074 (python)

Fixed submission:
N, K = map(int, input().split())
s = input()
S = [int(x) for x in list(str(s))]

l = []
tmp = 1
p = S[0]

for i in range(1, N):
    if p == S[i]:
        tmp += 1
    else:
        l.append(tmp)
        p = S[i]
        tmp = 1
l.append(tmp)

if len(l) == 1:
    print(N)
    exit()

i = 0
check = False

if S[0] == 0:
    r = 2 * K - 1
    check = True
else:
    r = 2 * K

ans = sum(l[i:r + 1])
tmp = ans

while r < len(l) - 2:
    tmp += l[r + 1] + l[r + 2]
    r += 2
    if check:
        tmp -= l[i]
        i += 1
        check = False
    else:
        tmp -= l[i] + l[i + 1]
        i += 2
    ans = max(tmp, ans)

if S[-1] == 0:
    tmp += l[r + 1]
    if check:
        tmp -= l[i]
    else:
        tmp -= l[i] + l[i + 1]

ans = max(ans, tmp)
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
s = input()
S = [int(x) for x in list(str(s))]

l = []
tmp = 1
p = S[0]

for i in range(1, N):
    if p == S[i]:
        tmp += 1
    else:
        l.append(tmp)
        p = S[i]
        tmp = 1
l.append(tmp)

i = 0
check = False

if S[0] == 0:
    r = 2 * K - 1
    check = True
else:
    r = 2 * K

ans = sum(l[i:r + 1])
tmp = ans

while r < len(l) - 2:
    tmp += l[r + 1] + l[r + 2]
    r += 2
    if check:
        tmp -= l[i]
        i += 1
        check = False
    else:
        tmp -= l[i] + l[i + 1]
        i += 2
    ans = max(tmp, ans)

if S[-1] == 0:
    tmp += l[r + 1]
    if check:
        tmp -= l[i]
    else:
        tmp -= l[i] + l[i + 1]

ans = max(ans, tmp)
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
s = input()
S = [int(x) for x in list(str(s))]
S.append(2)

l = []
tmp = 1
p = S[0]

if N == 1:
    print(1)
    exit()

for i in range(1, N + 1):
    if p == S[i]:
        tmp += 1
    else:
        l.append(tmp)
        p = S[i]
        tmp = 1

i = 0
check = False

if S[0] == 0:
    r = 2 * K - 1
    check = True
else:
    r = 2 * K

ans = sum(l[i:r + 1])
tmp = ans

while r < len(l) - 2:
    tmp += l[r + 1] + l[r + 2]
    r += 2
    if check:
        tmp -= l[i]
        i += 1
        check = False
    else:
        tmp -= l[i] + l[i + 1]
        i += 2
    ans = max(tmp, ans)

if S[-2] == 0:
    tmp += l[r + 1]
    if check:
        tmp -= l[i]
    else:
        tmp -= l[i] + l[i + 1]

ans = max(ans, tmp)
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
s = input()
S = [int(x) for x in list(str(s))]
S.append(2)

l = []
tmp = 1
p = S[0]

for i in range(1, N + 1):
    if p == S[i]:
        tmp += 1
    else:
        l.append(tmp)
        p = S[i]
        tmp = 1

i = 0
check = False

if S[0] == 0:
    r = 2 * K - 1
    check = True
else:
    r = 2 * K

ans = sum(l[i:r + 1])
tmp = ans

while r < len(l) - 2:
    tmp += l[r + 1] + l[r + 2]
    r += 2
    if check:
        tmp -= l[i]
        i += 1
        check = False
    else:
        tmp -= l[i] + l[i + 1]
        i += 2
    ans = max(tmp, ans)

if S[-2] == 0:
    tmp += l[r + 1]
    if check:
        tmp -= l[i]
    else:
        tmp -= l[i] + l[i + 1]

ans = max(ans, tmp)
print(ans)
Problem p03165 (python)

Fixed submission:
# educational DP contest F

X = input()
Y = input()
x = len(X)
y = len(Y)

dp = [[0 for _ in range(y + 1)] for _ in range(x + 1)]
for i in range(x):
    for j in range(y):
        if X[i] == Y[j]:
            dp[i + 1][j + 1] = dp[i][j] + 1
        else:
            dp[i + 1][j + 1] = max(dp[i][j + 1], dp[i + 1][j])

# print(dp[x][y])

ans = ''
while x > 0 and y > 0:
    if dp[x][y] == dp[x][y - 1]:
        y -= 1
    elif dp[x][y] == dp[x - 1][y]:
        x -= 1
    else:
        ans += X[x - 1]
        x -= 1
        y -= 1

print(ans[::-1])

Buggy submission (verdict: Runtime Error):
X = input()
Y = input()
x = len(X)
y = len(Y)

dp = [[0 for _ in range(y + 1)] for _ in range(x + 1)]
for i in range(x):
	for j in range(y):
		if X[i] == Y[j]:
            dp[i + 1][j + 1] = dp[i][j] + 1
		else:
			dp[i + 1][j + 1] = max(dp[i][j + 1], dp[i + 1][j])

print(dp[x][y])
Problem p03231 (python)

Fixed submission:
from fractions import gcd

N, M = map(int, input().split())
S = input()
T = input()

lcm = (N * M) // gcd(N, M)
gcd = gcd(N, M)

for i in range(gcd):
    if S[i * N // gcd] != T[i * M // gcd]:
        print(-1)
        exit()

print(lcm)

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

N, M = map(int, input().split())
S = input()
T = input()

ans = (a * b) // gcd(a, b)

if ans == N or ans == M:
    print(-1)
else:
    print(ans)
Problem p03311 (python)

Fixed submission:
""" AtCoder """

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

if N ==1:
    print(0)
    exit()

for i in range(N):
    A[i] -= i + 1

A.sort()

b = A[N//2]
bb = A[N//2 + 1]

ans = 0
ansans = 0

for a in A:
    ans += abs(a - b)
    ansans += abs(a - bb)

print(min(ans, ansans))

Buggy submission (verdict: Runtime Error):
""" AtCoder """

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

for i in range(N):
    A[i] -= i + 1

A.sort()

b = A[N//2]
bb = A[N//2 + 1]

ans = 0
ansans = 0

for a in A:
    ans += abs(a - b)
    ansans += abs(a - bb)

print(min(ans, ansans))
Problem p03393 (python)

Fixed submission:
S = input()

abc = list("abcdefghijklmnopqrstuvwxyz")
# ord('a') = 97
n = len(abc)
check = [0] * n
for s in S:
    check[ord(s) - 97] = 1

if S == ''.join(abc[::-1]):
    print(-1)
    exit()

if sum(check) != n:
    for i in range(n):
        if check[i] == 0:
            S += abc[i]
            break
    print(S)
else:
    check = [0] * n
    for i in range(0, n):
        check[ord(S[::-1][i]) - 97] = 1
        if S[::-1][i] > S[::-1][i + 1]:
            c = 24 - i
            break
    # print(c)
    # print(check)
    # print(S[c])
    ans = S[:c]
    for i in range(ord(S[c]) - 97, n):
        if check[i] == 1:
            ans += abc[i]
            break
    print(ans)

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

abc = list("abcdefghijklmnopqrstuvwxyz")
# ord('a') = 97
n = len(abc)
check = [0] * n
for s in S:
    check[ord(s) - 97] = 1

if sum(check) != n:
    for i in range(n):
        if check[i] == 0:
            S += abc[i]
            break
    print(S)
elif S == ''.join(abc[::-1]):
    print(-1)
else:
    check = [0] * n
    for i in range(n):
        if ord(S[i]) > ord(S[i + 1]):
            p = i
            break
        check[ord(S[i]) - 97] = 1
    ans = S[:p - 1]
    for i in range(n):
        if check[i] == 0:
            ans += abc[i]
            break
    print(ans)
Problem p03427 (python)

Fixed submission:
N = input()

if len(N) == 1:
    print(int(N))
    exit()

a = str(int(N) - int(N[-1]) - 1)
b = '9' * (len(N) - 1)

A = 0
B = 0
C = 0

for aa in a:
    A += int(aa)
for bb in b:
    B += int(bb)
if int(N[0]) > 1:
    B += int(N[0]) - 1
for n in N:
    C += int(n)


print(max(A, B, C))

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

a = str(int(N) - int(N[-1]) - 1)
b = '9' * (len(N) - 1)

A = 0
B = 0

for aa in a:
    A += int(aa)
for bb in b:
    B += int(bb)
if int(N[0]) > 1:
    B += int(N[0]) - 1

print(max(A, B))
Problem p03436 (python)

Fixed submission:
H, W = map(int, input().split())
ans = 0
S = []
for _ in range(H):
    s = list(input())
    ans += s.count('.')
    S.append(s)

inf = float('inf')
G = [[inf] * H * W for _ in range(H * W)]

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]

for h in range(H):
    for w in range(W):
        for x, y in zip(dx, dy):
            nx = w + x
            ny = h + y
            if 0 <= nx < W and 0 <= ny < H and S[ny][nx] != '#':
                G[W * h + w][W * ny + nx] = 1

from scipy.sparse.csgraph import dijkstra

d = dijkstra(G, indices=0)
if d[-1] == inf:
    print(-1)
else:
    print(int(ans - d[-1] - 1))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
ans = 0
S = []
for _ in range(H):
    s = list(input())
    ans += s.count('.')
    S.append(s)

inf = float('inf')
G = [[inf] * H * W for _ in range(H * W)]

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]

for h in range(H):
    for w in range(W):
        for x, y in zip(dx, dy):
            nx = w + x
            ny = h + y
            if 0 <= nx < W and 0 <= ny < H and S[ny][nx] != '#':
                G[W * h + w][W * ny + nx] = 1

from scipy.sparse.csgraph import dijkstra

d = dijkstra(G, indices=0)

print(int(ans - d[-1] - 1))
Problem p03438 (python)

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

c = max(0, sum(B) - sum(A))
ca = 0
cb = 0

for a, b in zip(A, B):
    if a < b:
        ca += (b - a + 1) // 2
        cb += (b - a) % 2
    if a > b:
        cb += a - b

if c < max(ca, cb):
    print('No')
else:
    print('Yes')

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

c = max(0, sum(B) - sum(A))
ca = 0
cb = 0

for a, b in zip(A, B):
    if a < b:
        ca += (b - a + 1) // 2
        cb += (b - a) % 2
    if a > b:
        cb += a - b

if c < max(ca + cb):
    print('No')
else:
    print('Yes')
Problem p03623 (python)

Fixed submission:
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
  print('A')
else:
  print('B')

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
  print(A)
else:
  print(B)
Problem p03643 (python)

Fixed submission:
print("ABC"+input())

Buggy submission (verdict: Runtime Error):
print("ABC" + int(input()))
Problem p03644 (python)

Fixed submission:
""" AtCoder """

N = int(input())
ans_list = [2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

if N == 1:
    print(1)
    exit()

for i in range(7):
    if N >= ans_list[i]:
        print(ans_list[i])
        break

Buggy submission (verdict: Runtime Error):
""" AtCoder """

N = int(input())
ans_list = [2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

if N == 1:
    print(1)

for i in range(7):
    if N > ans_list[i]:
        print(ans_list[i])
        break
Problem p03675 (python)

Fixed submission:
from collections import deque

n = int(input())
a = list(input().split())

b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))

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

b = []
for aa in a:
    b.append(aa)
    b.reverse()

ans = ''
for bb in b:
    ans += bb + ' '

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

Fixed submission:
""" AtCoder """

A, s, C = input().split()

print('A' + s[0] + 'C')

Buggy submission (verdict: Runtime Error):
""" AtCoder """

A, s, C = map(int, input().split())

print('A' + s[0] + 'C')
Problem p03997 (python)

Fixed submission:
""" AtCoder """

a = int(input())
b = int(input())
h = int(input())

print(int((a + b) * h / 2))

Buggy submission (verdict: Runtime Error):
""" AtCoder """

a, b, h = map(int, input().split())

print((a + b) * h / 2)
Problem p02664 (python)

Fixed submission:
S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

if S == "?":
  print("D")
if S == "P?":
  print("PD")
if S == "D?":
  print("DD")
if S == "?D":
  print("PD")
if S == "?P":
  print("DP")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i-1] == "D":
      S[i] = "P"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

if S == "?":
  print("D")
is S == "P?":
  print("PD")
if S == "D?":
  print("DD")
if S == "?D":
  print("PD")
if S == "?P":
  print("DP")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i-1] == "D":
      S[i] = "P"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i+1] == "D":
      S[i] = "P"
    elif S[i-1] == "D":
      S[i] = "P"
    else:
      S[i] = "D"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i+1] == "D":
      S[i] = "P"
    elif S[i-1] == "D":
      S[i] = "P"
    else:
      S[i] = "D"


if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)