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

Fixed submission:
#!/usr/bin/env python
from fractions import gcd
#from math import gcd

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

    L = [[] for i in range(N+1)]
    R = [[] for i in range(N+1)]
    L[0] = 0
    R[N] = 0

    for i in range(N):
        L[i+1] = gcd(L[i], A[i])
        R[N-1-i] = gcd(R[N-i], A[N-1-i])

    M = [[] for i in range(N)]
    for i in range(N):
        M[i] = gcd(L[i], R[i+1])

    return max(M)

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

Buggy submission (verdict: Runtime Error):
#from math import gcd

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

    L = [[] for i in range(N+1)]
    R = [[] for i in range(N+1)]
    L[0] = 0
    R[N] = 0

    for i in range(N):
        L[i+1] = gcd(L[i], A[i])
        R[N-1-i] = gcd(R[N-i], A[N-1-i])

    M = [[] for i in range(N)]
    for i in range(N):
        M[i] = gcd(L[i], R[i+1])

    return max(M)

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

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
from math import gcd

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

    L = [[] for i in range(N+1)]
    R = [[] for i in range(N+1)]
    L[0] = 0
    R[N] = 0

    for i in range(N):
        L[i+1] = gcd(L[i], A[i])
        R[N-1-i] = gcd(R[N-i], A[N-1-i])

    M = [[] for i in range(N)]
    for i in range(N):
        M[i] = gcd(L[i], R[i+1])

    return max(M)

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

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
from math import gcd

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

    L = [[] for i in range(N+1)]
    R = [[] for i in range(N+1)]
    L[0] = 0
    R[N] = 0

    for i in range(N):
        L[i+1] = gcd(L[i], A[i])
        R[N-1-i] = gcd(R[N-i], A[N-1-i])

    M = [[] for i in range(N)]
    for i in range(N):
        M[i] = gcd(L[i], R[i+1])

    return max(M)

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

Fixed submission:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a

def chmax(a, b):
    if a < b:
        return b
    else:
        return a

def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    dp = [inf] * 110000

    dp[0] = 0
    for i in range(n-1):
        for j in range(1, min(k+1, n-i)):
            dp[i+j] = chmin(dp[i+j], dp[i] + abs(h[i+j] - h[i]))
    print(dp[n-1])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
#from fractions import gcd
from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a

def chmax(a, b):
    if a < b:
        return b
    else:
        return a

def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    dp = [inf] * 110000

    dp[0] = 0
    for i in range(n-1):
        for j in range(1, min(k+1, n-i)):
            dp[i+j] = chmin(dp[i+j], dp[i] + abs(h[i+j] - h[i]))
    print(dp[n-1])

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

Fixed submission:
s1 = input()
s2 = input()[::-1]
print("YES") if s1 == s2 else print("NO")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

def main():
    n = int(input())
    la = list(map(int, input().split()))
    lb = list(map(int, input().split()))
    lc = list(map(int, input().split()))
    
    la.sort()
    lb.sort()
    lc.sort()

    ans = 0
    for a in la:
        if a < lb[-1]:
            idxb = bisect.bisect_right(lb, a)
            for b in lb[idxb:]:
                if b < lc[-1]:
                    idxc = bisect.bisect_right(lc, b)
                    ans += (n - idxc)
    print(ans) 

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

Fixed submission:
a, b, c = map(int, input().split())
if (a <= c) and (c <= b):
    print('Yes')
    
else:
    print('No')

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

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

s = input().split(' ')

print(s[0][0].upper() + s[1][0].upper() + s[2][0].upper())

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

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

def comp(a, b):
    if a < b:
        print("LESS")
    elif a < b:
        print("GREATER")
    else:
        print("EQUAL")

comp(a, b)
Problem p03828 (python)

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

## N! = 1 * 2 * ... * N
## N! = 2~e2 + 3~e3 + 5~e5 + ... + prime~eprime
## e2 = ord2(1) + ord2(2) + ... + ord2(N)
## ans = (e2 + 1)(e3 + 1)(e5 + 1)...
## e2 = [N/2] + [N/4] + [N/8] + [N/16] +...

from math import floor as gs
N = int(input())

## creating prime numbers until N
def fun_prime(k):
    counter = 0
    primes = [2, 3]

    for n in range(5, k+1, 2):
        isprime = True
        for i in range(1, len(primes)):
            if primes[i] ** 2 > n:
                break
            if n % primes[i] == 0:
                isprime = False
                break
        if isprime == True:
            primes.append(n)
    return(primes)
primes_N = fun_prime(N)

ans = 1
if N == 1:
    print(int(ans))
else:
    for prime in primes_N:
        e = 0
        power = prime
        while power <= N:
            e += gs(N/power)
            power = power * prime
        ans = ans * (e + 1)
    ans = ans % (10 ** 9 + 7)
    print(int(ans))

Buggy submission (verdict: Runtime Error):

N = int(input())
ls = [1]
ans = 0

if N == 1:
        print(1)
else:
    for i in range(1, N+1):
        new_ls = map(lambda x: x*i, ls)
        for j in new_ls    
            if j not in ls:
                ans += 1
                ls.append(j)
    print(ans)

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

N = int(input())
ls = [1]
ans = 0

if N == 1:
        print(1)
else:
    for i in range(1, N+1):
        for j in ls:
            x = j * i
            if x not in ls:
                ans += 1
                n.append(x)
    print(ans)
Problem p03853 (python)

Fixed submission:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
#from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    h, w = map(int, input().split())
    C = [None] * h
    for i in range(h):
        C[i] = input()
    for i in range(h):
        print(C[i])
        print(C[i])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
#from fractions import gcd
from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    h, w = map(int, input().split())
    C = [None] * h
    for i in range(h):
        C[i] = input()
    for i in range(h):
        print(C[i])
        print(C[i])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# problem B
y, x = map(int, input())
for i in range(y):
    l = input()
    print(l)
    print(l)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# problem B
y, x = map(int, input())
l = list(input() for i in range(y))
for i in range(y):
    print(l[i])
    print(l[i])
Problem p03862 (python)

Fixed submission:
# problem C
N, x = map(int, input().split())
num_list = [int(x) for x in input().split()]
if x < num_list[0]:
    count = num_list[0] - x
    num_list[0] = x
else:
    count = 0

for i in range(N-1):
    n = num_list[i] + num_list[i+1]
    if x < n:
        num_list[i+1] = x - num_list[i]
        count += n - x
    else:
        pass
print(count)

Buggy submission (verdict: Runtime Error):
# problem C
N, x = map(int, input().split())
num_list = [int(x) for x in input().split()]
if x < num_list[0]:
    count = n - num_list[0]
    num_list[0] = x
else:
    count = 0


for i in range(N-1):
    n = num_list[i] + num_list[i+1]
    if x < n:
        num_list[i+1] = x - num_list[i]
        count += n - x
    else:
        pass
print(count)
Problem p03997 (python)

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

N = 3
# N = int(input())
s = [input() for i in range(N)]

a = int(s[0])
b = int(s[1])
h = int(s[2])

S = int(((a + b)*h/2))
print(str(S))

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

N = 3
# N = int(input())
s = [input() for i in range(N)]

a = s[1]
b = s[2]
h = s[3]

S = ((a + b)*h/2)
print(str(S))

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

N = 3 
# N = int(input())
s = [input() for range(N)]

a = s[1]
b = s[2]
h = s[3]

S = ((a + b)*h/2)
print(str(S))
Problem p03998 (python)

Fixed submission:

# -*- coding: utf-8 -*-
# problem B
player = {i:list(input()) for i in 'abc'}

t = 'a'
while True:
    if len(player[t]) == 0:
        break
    else:
        x = player[t][0]
        player[t].pop(0)
        t = x

print(t.upper())

Buggy submission (verdict: Runtime Error):

# -*- coding: utf-8 -*-
# problem B
player = {i:list(input()) for i in 'abc'}

t = 'a'
while True:
    if len(player[t]) == 0:
        break
    else:
        x = p[t][0]
        p[t].pop(0)
        t = x

print(t.upper())
Problem p04044 (python)

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

N, L = map(int, input().split())
ls = []

for _ in range(N):
    input_data = input()
    ls.append(input_data)

ls.sort()
print(''.join(ls))

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

N, L = map(int, input().split())
ls = []

for _ in N:
    input_data = input()
    ls.append(input_data)

ls.sort()
print(''.join(ls))
Problem p02713 (python)

Fixed submission:
from math import gcd
ans = 0
K = int(input())
 
for i in range(1, K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      ans += gcd(gcd(i,j), k)
      
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
ans = 0
K = int(input())
 
for i in range(1, K+1):
	for j in range(1,K+1):
  		for k in range(1,K+1):
    		ans = ans + gcd(gcd(i,j), k)
      
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans = 0
K = int(input())
 
for i in range(1, K+1):
	for j in range(1,K+1):
  		for k in range(1,K+1):
          ans = ans + math.gcd(math.gcd(i,j), k)
      
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans = 0
K = int(input())
 
for i in range(1, K+1):
	for j in range(1,K+1):
  		for k in range(1,K+1):
    		ans = ans + math.gcd(math.gcd(i,j), k)
      
print(ans)

Buggy submission (verdict: Runtime Error):
import math
 
ans = 0
K = int(input())
 
for i in range(1, K+1):
	for j in range(1,K+1):
  		for k in range(1,K+1):
    		ans += math.gcd(math.gcd(i,j), k)
      
print(ans)

Buggy submission (verdict: Runtime Error):
import math
 
K = int(input())
 
for i in range(1, K+1):
	for j in range(1,K+1):
  		for k in range(1,K+1):
    		ans += math.gcd(math.gcd(i,j), k)
      
print(ans)

Buggy submission (verdict: Runtime Error):
import math
 
K = input()
 
for i in range(1, K+1):
	for j in range(1,K+1):
  		for k in range(1,K+1):
    		ans += math.gcd(math.gcd(i,j), k)
      
print(ans)
Problem p02957 (python)

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

ans = (a+b)/2
if ans % 1 == 0:
    print("{}".format((int)(ans)))
else:
    print("IMPOSSIBLE")

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

mod = 10**9+7
p = list(input())
# p = list("?"*10**4)

# アルゴリズム
dp = np.zeros(13, dtype=int)
dp[0] = 1
mul = 1
for key in reversed(p):
    new_dp = np.zeros(13, dtype=int)
    if key == "?":
        for i in range(10):
            for j in range(13):
                new_dp[(j + i * mul) % 13] += dp[j]
                new_dp[(j + i * mul) % 13] %= mod
    else:
        
        for j in range(13):
            new_dp[(j + int(key) * mul) % 13] += dp[j]
            new_dp[(j + int(key) * mul) % 13] %= mod
    dp = new_dp.copy()
    mul *= 10

print(dp[5])

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

mod = 10**9+7
p = list(input())
# p = list("?"*10**4)

# アルゴリズム
dp = np.zeros(13, dtype=int)
dp[0] = 1
mul = 1
for key in reversed(p):
    new_dp = np.zeros(13, dtype=int)
    if key == "?":
        for i in range(10):
            for j in range(13):
                new_dp[(j + i * mul) % 13] += dp[j]
                new_dp[(j + i * mul) % 13] %= mod
    else:
        
        for j in range(13):
            new_dp[(j + int(key) * mul) % 13] += dp[j]
            new_dp[(j + int(key) * mul) % 13] %= mod
    dp = new_dp.copy()
    mul *= 10

print(dp[5])
Problem p02969 (python)

Fixed submission:
r = int(input())

print("{}".format(3*r**2))

Buggy submission (verdict: Runtime Error):
def add(n):
    return n + 1

if __name__ == "__main__":
    n = int(input())
    buf = input().split()
    a = [int(s) for s in buf]
    
    boxes = [0] * n

    for i in reversed(range(n)):
        pick_boxes = boxes[i::i+1]
        pick_boxes.pop(0)
        if pick_boxes:
            if (sum(pick_boxes) % 2) == a[i]:
                boxes[i] = 0
            else:
                boxes[i] = 1
        else:
            boxes[i] = a[i]

    box_name = [i for i, x in enumerate(boxes) if x == 1]
    box_name = list(map(add, box_name))
    print(len(box_name))
    if len(box_name) != 0:
        box_name = ' '.join(map(str,box_name))
        print(box_name)

Buggy submission (verdict: Runtime Error):
def add(n):
    return n + 1

if __name__ == "__main__":
    n = int(input())
    buf = input().split()
    a = [int(s) for s in buf]
    
    boxes = [0] * n

    for i in reversed(range(n)):
        print(i)
        pick_boxes = boxes[i::i+1]
        pick_boxes.pop(0)
        print(pick_boxes)
        if pick_boxes:
            if (sum(pick_boxes) % 2) == a[i]:
                boxes[i] = 0
            else:
                boxes[i] = 1
        else:
            boxes[i] = a[i]

    box_name = [i for i, x in enumerate(boxes) if x == 1]
    box_name = list(map(add, box_name))
    print(len(box_name))
    if len(box_name) != 0:
        box_name = ' '.join(map(str,box_name))
        print(box_name)
Problem p02708 (python)

Fixed submission:
N,K = map(int,input().split())
ad = 0
mod = 10 **9 + 7
for k in range(K,N+2):
  ma = (N*(N+1) - (N-k)*(N-k+1))//2
  mi = (k-1)*k//2
  ad += (ma - mi+1)
print(ad%mod)

Buggy submission (verdict: Runtime Error):
mport itertools
n,k = map(int,input().split())
l = list(range(n+1))
ad = 0
for i in list(range(k,n+2)):
        l2 = list(itertools.combinations(l,r=i))
        se = set(map(sum,l2))
        ad += len(se)
print(ad)

Buggy submission (verdict: Runtime Error):
mport itertools
n,k = map(int,input().split())
l = list(range(n+1))
ad = 0
for i in list(range(k,n+2)):
        l2 = list(itertools.combinations(l,r=i))
        se = set(map(sum,l2))
        ad += len(se)
print(ad)

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
k = int(input())
l = list(range(n+1))
ad = 0
for i in list(range(k,n+2)):
        l2 = list(itertools.combinations(l,r=i))
        se = set([sum(j) for j in l2])
        ad += len(se)
print(ad)

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
k = int(input())
l = list(range(n+1))
ad = 0
for i in list(range(k,n+2)):
        l2 = list(itertools.combinations(l,r=i))
        se = set([sum(j) for j in l2])
        ad += len(se)
print(ad)
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
sm = sum(A)
jud = sm/(4*M)

b = 0
for i in A:
    if i > jud:
        b = b+1
if b >= M:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
print('{} {} {}').format(z,x,y)
Problem p02783 (python)

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

Buggy submission (verdict: Runtime Error):
def main():
    hp, num = map(int, input().split())
    a = list(map(int, input().split()))
    attack = sum(a)

    if hp > attack:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()
Problem p02812 (python)

Fixed submission:
N = int(input())
S = input()
a = 0
for i in range(N):
    if S[i]+S[i+1]+S[i+2] == 'ABC':
        a += 1
    if i == N - 3:
        break
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
for i in range(N):
    if S[i]+S[i+1]+S[i+2] == 'ABC':
        a += 1
    if i == N - 3:
        break
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
for i in range(N):
    if S[i]+S[i+1]+S[i+2] == 'ABC':
        a += 1
    if i == N - 3:
        break
print(a)
Problem p02813 (python)

Fixed submission:
import itertools

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

A = list(itertools.permutations(range(1,N+1)))
cnt_a = 0
cnt_b = 0
for i in range(len(A)):
  if P == A[i]:
    cnt_a += i
  if Q == A[i]:
    cnt_b += i

print(abs(cnt_a - cnt_b))

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

A = itertools.permutation(range(1,N))
for i in N:
  if P == A[i]:
    cnt_a = i
  if Q == A[i]:
    cnt_b = i

print(abs(a-b))
Problem p03262 (python)

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

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

if n == 1:
  a.append(a[0])
  n = n+1
d = []
for i in range(n):
  y = abs(a[i] - x)
  d.append(y)

b = gcd(d[0],d[1])
for i in range(n):
	b = gcd(b,d[i])
print(b)

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

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

if n == 1:
  a.append(a[0])

d = []
for i in range(n):
  y = abs(a[i] - x)
  d.append(y)

b = gcd(d[0],d[1])
for i in range(n):
	b = gcd(b,d[i])
print(b)

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

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

d = []
for i in range(n):
  y = abs(a[i] - x)
  d.append(y)

a = gcd(d[0],d[1])
for i in range(n):
	a = gcd(a,d[i])
print(a)
Problem p03282 (python)

Fixed submission:
N, K = [int(input()) for _ in range(2)]
listn = list(str(N))
a = []
if len(str(N)) < K:
    for i in range(len(str(N))):
        if listn[i] != str(1):
            a.append(str(listn[i]))
else:
    for i in range(K):
        if listn[i] != str(1):
            a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
listn = list(str(N))
a = []
if len(str(N)) < K:
    for i in range(len(str(N))):
        if listn[i] != str(1):
            a.append(str(listn[i]))
else:
    for i in range(K):
        if listn[i] != str(1):
            a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
listn = list(str(N))
for i in range(K):
    if listn[i] != str(1):
        a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])
Problem p03605 (python)

Fixed submission:
N = int(input())
a = int(N/10)
b = N%10
#print(N)
#print(a)
#print(b)
if a == 9 or b == 9:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
a = N/10
b = N%10
if a == 9  b == 9:
  print('Yes')
else:
  print('No')
Problem p02664 (python)

Fixed submission:
def ABC_86_B():
    T=list(input())
    for i in range(len(T)):
        if T[i] == '?':
            T[i]='D'

    print(''.join(T))

if __name__ == '__main__':

    ABC_86_B()

Buggy submission (verdict: Runtime Error):
def ABC_86_B():
    T=list(input())
    for i in range(len(T)):
        if T[i] == '?':
            if i==0 and T[0]=='P':
                i=i
            elif i == 0 and T[0]=='D':
                i=i
            elif i == 0 and T[0]=='?' and T[1]=='D':
                T[0] = 'D'
            elif i == 0 and T[0]=='?' and T[1]=='P':
                T[0] = 'D'
            elif T[i-1] == 'P':
                T[i]='D'
            elif T[i-1] == 'D':
                T[i]='P'

    print(''.join(T))

if __name__ == '__main__':

    ABC_86_B()

Buggy submission (verdict: Runtime Error):
def ABC_86_B():
    T=list(input())
    for i in range(len(T)):
        if T[i] == '?':
            if i==0 and T[0]=='P':
                i=i
            elif i == 0 and T[0]=='D':
                i=i
            elif i == 0 and T[0]=='?' and T[1]=='D':
                T[0] = 'P'
            elif i == 0 and T[0]=='?' and T[1]=='P':
                T[0] = 'D'
            elif T[i-1] == 'P':
                T[i]='D'
            elif T[i-1] == 'D':
                T[i]='P'

    print(''.join(T))

if __name__ == '__main__':

    ABC_86_B()
Problem p02957 (python)

Fixed submission:
def ABC_135_A():
    A,B = map(int, input().split())

    if (A+B)%2 == 0:
        print(int((A+B)/2))
    else:
        print('IMPOSSIBLE')

if __name__ == '__main__':

    ABC_135_A()

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

    if (A+B)/%2 == 0:
        print(int((A+B)/2))
    else:
        print('IMPOSSIBLE')

if __name__ == '__main__':

    ABC_135_A()
Problem p03473 (python)

Fixed submission:
def ABC_84_A():
    M = int(input())
    
    print(48-M)

if __name__ == '__main__':

    ABC_84_A()

Buggy submission (verdict: Runtime Error):
  M = int(input())
    
  print(48-M)

Buggy submission (verdict: Runtime Error):
  M = int(input())
    
    print(48-M)
Problem p03548 (python)

Fixed submission:
def ABC_78_B():
    X,Y,Z = map(int, input().split())
    sum=0
    N=0
    while sum<= X:
        sum = Y*N+Z*(N+1)
        N+=1  
    print(N-2)


if __name__ == '__main__':

    ABC_78_B()

Buggy submission (verdict: Runtime Error):
X,Y,Z = map(int, input().split())
N=0
while sum<= X:
	um = Y*N+Z*(N+1)
	N+=1  
print(N-2)
Problem p03555 (python)

Fixed submission:
def ABC_77_A():
    C1= input()
    C2 =input()
    
    if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':

    ABC_77_A()

Buggy submission (verdict: Runtime Error):
def ABC_77_A():
    A,B,C = map(str, input().split())
    A2,B2,C2 = map(str, input().split())
    
    if A == C2 and C == A2 and B == B2:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':

    ABC_77_A()
Problem p03657 (python)

Fixed submission:
def ABC_67_A():
    A,B = map(int, input().split())
    
    if A%3 == 0:
        print('Possible')
    elif B%3 == 0:
        print('Possible')
    elif (A+B)%3 == 0:
        print('Possible')
    else:
        print('Impossible')

if __name__ == '__main__':

    ABC_67_A()

Buggy submission (verdict: Runtime Error):

    A,B = map(int, input().split())
    
    if A%3 == 0:
        print('Possible')
    elif B%3 == 0:
        print('Possible')
    elif (A+B)%3 == 0:
        print('Possible')
    else:
        print('Impossible')