Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count = 0
ans = []
for i in range(7):
  if i == n-1:
    ans.append(count)
    break
  if h[i] >= h[i+1]:
    count += 1
  else:
    ans.append(count)
    count = 0
print(max(ans))

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
count = 0
ans = []
for i in range(n):
  if i == n-1:
    ans.append(count)
    break
  if h[i] >= h[i+1]:
    count += 1
  else:
    ans.append(count)
    count = 0
print(max(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
  if S[i] != S[K-1]:
    S[i] = "*"
S_changed = "".join(S)
print(S_changed)

Fixed submission:
a,b,c = map(int,input().split())
if a > b:
	A = a
	a = b
	b = A

yoru = 1    
if a < c and b > c:
	yoru = 1
else:
	yoru = 0
if yoru == 1:
	print("Yes")
else:
	print("No")

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

for i in range(N):
	if S[i] != S[K-1]:
		S[i] = "*"
S_changed = "".join(S)
print(S_changed)

Fixed submission:
a,b,c = map(int,input().split())
if a > b:
	A = a
	a = b
	b = A

yoru = 1    
if a < c and b > c:
	yoru = 1
else:
	yoru = 0
if yoru == 1:
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a > b:
	A = a
	a = b
	b = A

yoru = 1    ＃寄り道する
if a < c and b > c:
	yoru = 1
else:
	yoru = 0
if yoru == 1:
	print("Yes")
else:
	print("No")

Fixed submission:
a,b,c = map(int,input().split())
if a > b:
	A = a
	a = b
	b = A

yoru = 1    
if a < c and b > c:
	yoru = 1
else:
	yoru = 0
if yoru == 1:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(str,input().split()))
K = int(input())

for i in range(N):
  if S[i] != S[K]:
    S[i] = str("*")
print(S)

Fixed submission:
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
	if S[i] != S[K-1]:
		S[i] = "*"
S_changed = "".join(S)
print(S_changed)
Buggy python submission (verdict: Runtime Error):
N = int(input())
list = []
num = 0
for i in range(N-1):
    list.append(i)
    if list[0] <= list[i]:
        flag = 1
    else:
        flag = 0

if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    #jが比較対象
                flag = 0      #flag = 1の時カウント、０の時はカウントしない
    num += 1

print(num)

Fixed submission:
n = int (input())
h = list(map(int,input().split()))
max_num = 0
ans = 0
for i in range (n):
  if h[i] >= max_num:
    max_num = h[i]
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(input())
ans = 753 - int(s[0] + s[1] + s[2])
for i in range (8):
  num = s[i] + s[i+1] + s[i+2]
  if ans > abs(int(num)-753):
    ans = abs(int(num)-753)
print(ans)

Fixed submission:
s = list(input())
ans = abs(753 - int(s[0] + s[1] + s[2]))
for i in range (len(s) - 2):
  num = s[i] + s[i+1] + s[i+2]
  if ans > abs(int(num)-753):
    ans = abs(int(num)-753)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
l.append(2)
l.append(1)
for i in range(2,86):
  l.append(l[i-1] + l[i-2])
print(l[n])

Fixed submission:
n = int(input())
l = []
l.append(2)
l.append(1)
for i in range(2,87):
  l.append(l[i-1] + l[i-2])
print(l[n])
Buggy python submission (verdict: Runtime Error):
import numpy as np
def input_one_number():
    return int(input())
 
def input_multiple_number():
    return map(int, input().split())
 
def input_multiple_number_as_list():
    return list(map(int, input().split()))

a,b,h,m=input_multiple_number()

rad=np.deg2rad(min(abs(h*30-m*5.5),360-(abs(h*30-m*5.5))))

ans=np.sqrt(pow(a,2)+pow(b,2)-2*a*b*np.cos(rad))
print(ans)

Fixed submission:
import numpy as np
def input_one_number():
    return int(input())
 
def input_multiple_number():
    return map(int, input().split())
 
def input_multiple_number_as_list():
    return list(map(int, input().split()))

a,b,h,m=input_multiple_number()

rad=np.deg2rad(min(abs(h*30-m*5.5),360-(abs(h*30-m*5.5))))

ans=np.sqrt(pow(a,2)+pow(b,2)-2*a*b*np.cos(rad))
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=sorted([input() for i in range(n)])
ans = ['']
x=1
max=0
for k in range(n):
    if k<n-1:
        if s[k]==s[k+1]:
            x+=1
        else:
            if max<x:
                ans=[s[k]]
                max=x
            if max==x:
                ans.append(s[k])
            x=1
    else:
        if max<x:
            ans=[s[k]]
            max=x
        if max==x:
            ans.append(s[k])

    
print(0)
for j in range(ans.max):
    print(ans[j])

Fixed submission:
n=int(input())
s=sorted([input() for i in range(n)])
ans = ['']
x=1
max=0
for k in range(n):
    if k<n-1:
        if s[k]==s[k+1]:
            x+=1
        else:
            if max<x:
                ans=[s[k]]
                max=x
            elif max==x:
                ans.append(s[k])
            x=1
    else:
        if max<x:
            ans=[s[k]]
            max=x
        elif max==x:
            ans.append(s[k])

    

for j in range(len(ans)):
    print(ans[j])
Buggy python submission (verdict: Runtime Error):
k,x=map(int,input())
if k*500>=x:
    print('Yes')
else:
    print('No')



Fixed submission:
k,x=map(int,input().split())
if k*500>=x:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
k,x=map(int,input())
if k*500>=x:
    print('Yes')
else:
    print('No')



Fixed submission:
k,x=map(int,input().split())
if k*500>=x:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x=int(input())
li=[2]
p=2
i=0
prime=False
if x==2:
    print(2)
else:
    while p<x or prime==False:
        prime=True
        p+=1
        for i in range(len(li)):
            if p%li[i]==0:
                prime=False
        if prime:
            li.append(p)
   
    print(max(li))
    


Fixed submission:
li = list(input().split())
s=li[0]
t=li[1]

print(t+s)
Buggy python submission (verdict: Time Limit Exceeded):
li = list(map(int,input().split()))
a=li[0]
b=li[1]
k=li[2]
i = 1
while i <= k:
    if a >= 1:
        a = a-1
    elif b >= 1:
        b = b-1
    else:
        break
    i += 1


print(str(a)+" "+str(b))

Fixed submission:
li = list(map(int,input().split()))
a=li[0]
b=li[1]
k=li[2]
if a<k:
    if b<k-a:
        a=0
        b=0
    else:
        b=b-k+a
        a=0
        
else:
    a=a-k

print(str(a)+" "+str(b))

Buggy python submission (verdict: Time Limit Exceeded):
li = list(map(int,input().split()))
a=li[0]
b=li[1]
k=li[2]
i = 1
while i <= k:
    if a >= 1:
        a = a-1
    elif b >= 1:
        b = b-1
    else:
        break
    i += 1


print(str(a)+" "+str(b))

Fixed submission:
li = list(map(int,input().split()))
a=li[0]
b=li[1]
k=li[2]
if a<k:
    if b<k-a:
        a=0
        b=0
    else:
        b=b-k+a
        a=0
        
else:
    a=a-k

print(str(a)+" "+str(b))
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
li=[2]
p=1
i=0
prime=False
if x==2:
    print(2)
else:
    while p<x or prime==False:
        prime=True
        p+=2
        for i in range(len(li)):
            if p%li[i]==0:
                prime=False
        if prime:
            li.append(p)
   
    print(p)
    


Fixed submission:
x=int(input())
p=x-1
prime=False
if x==2:
    print(2)
else:
    while prime==False:
        p+=1
        prime=True
        
        for i in range(2,p-1):
            if p%i==0:
                prime=False
        
        
   
    print(p)

Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
li=[2]
p=1
i=0
prime=False
if x==2:
    print(2)
else:
    while p<x or prime==False:
        prime=True
        p+=2
        for i in range(len(li)):
            if p%li[i]==0:
                prime=False
        if prime:
            li.append(p)
   
    print(p)
    


Fixed submission:
x=int(input())
p=x-1
prime=False
if x==2:
    print(2)
else:
    while prime==False:
        p+=1
        prime=True
        
        for i in range(2,p-1):
            if p%i==0:
                prime=False
        
        
   
    print(p)

Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
li=[2]
p=2
i=0
prime=False
if x==2:
    print(2)
else:
    while p<x or prime==False:
        prime=True
        p+=1
        for i in range(len(li)):
            if p%li[i]==0:
                prime=False
        if prime:
            li.append(p)
   
    print(p)
    


Fixed submission:
x=int(input())
p=x-1
prime=False
if x==2:
    print(2)
else:
    while prime==False:
        p+=1
        prime=True
        
        for i in range(2,p-1):
            if p%i==0:
                prime=False
        
        
   
    print(p)

Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
li=[2]
p=2
i=0
prime=False
if x==2:
    print(2)
else:
    while p<x or prime==False:
        prime=True
        p+=1
        for i in range(len(li)):
            if p%li[i]==0:
                prime=False
        if prime:
            li.append(p)
   
    print(max(li))
    


Fixed submission:
x=int(input())
p=x-1
prime=False
if x==2:
    print(2)
else:
    while prime==False:
        p+=1
        prime=True
        
        for i in range(2,p-1):
            if p%i==0:
                prime=False
        
        
   
    print(p)
Buggy python submission (verdict: Runtime Error):
def resolve():
    li = input().split()

    if li[0]+li[1] < 8:
        print("win")
    else if [0]+li[1];li[2] <= 22:
        print("win")
    else:
        print("bust")

Fixed submission:
a = list(map(int,input().split()))
if a[0]+a[1]+a[2] <= 21:
  print('win')
else:
  print('bust')

Buggy python submission (verdict: Runtime Error):
def resolve():
    li = input().split()

    if li[0]+li[1]+li[2] => 22:
        print("bust")
    else:
        print("win")


Fixed submission:
a = list(map(int,input().split()))
if a[0]+a[1]+a[2] <= 21:
  print('win')
else:
  print('bust')

Buggy python submission (verdict: Runtime Error):
li = input().split()

if li[0]+li[1]+li[2] => 22:
    print("bust")
else:
    print("win")


Fixed submission:
a = list(map(int,input().split()))
if a[0]+a[1]+a[2] <= 21:
  print('win')
else:
  print('bust')

Buggy python submission (verdict: Runtime Error):
li = input().split()

if li[0]+li[1]+li[2] >= 22:
    print("bust")
else:
    print("win")


Fixed submission:
a = list(map(int,input().split()))
if a[0]+a[1]+a[2] <= 21:
  print('win')
else:
  print('bust')
Buggy python submission (verdict: Time Limit Exceeded):
D = int(1e9 + 7)
N = int(input())
M = [int(i) % D for i in input().split()]

sum_ = 0
for i, x in enumerate(M[:-1]):
    S = M[i+1:]
    sum_ += (sum(S) % D) * x
    sum_ %= D

print(sum_)


Fixed submission:
D = int(1e9 + 7)
N = int(input())
M = [int(i) for i in input().split()]

R = sum(M[1:])

sum_ = 0
for i, x in enumerate(M[:-1]):
    sum_ += R * x
    sum_ %= D
    R -= M[i+1]

print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
D = int(1e9 + 7)
N = int(input())
M = sorted(map(int, input().split()))

sum_ = 0
for i, x in enumerate(M[:-1]):
    for j, y in enumerate(M[i+1:]):
        sum_ += ((x % D) * (y % D)) % D
        sum_ %= D

print(sum_)


Fixed submission:
D = int(1e9 + 7)
N = int(input())
M = [int(i) for i in input().split()]

R = sum(M[1:])

sum_ = 0
for i, x in enumerate(M[:-1]):
    sum_ += R * x
    sum_ %= D
    R -= M[i+1]

print(sum_)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

A_i = [int(input()) for _ in range(Q)]

for i in range(N):
    a = len(list(filter(lambda x: x == (i+1), A_i)))
    if (K-Q+a) > 0:
        print('Yes')
    else:
        print('No')


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

S_i = [0] * N
for i in range(Q):
    S_i[int(input())-1] += 1

for i in range(N):
    if (K-Q+S_i[i]) > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M = map(int, input().split())
    A_i = list(map(int, input().split()))
    for i in range(M):
        m = max(A_i)
        A_i.remove(m)
        m = m//2
        A_i.append(m)
    print(sum(A_i))


main()


Fixed submission:
import heapq


def main():
    N, M = map(int, input().split())
    A_i = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A_i)
    for i in range(M):
        m = -heapq.heappop(A_i)
        m = m//2
        heapq.heappush(A_i, -m)
    print(-sum(A_i))


main()
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input("").split(" "))
p = list(map(int,input().split()))
p.sort()
q = [i+1 for i in range(-2*X,2*X)]

ans = 0
diff = 100

for i in q:
    if (abs(X - i) < diff and (not i in p)):
        ans = i
        diff = abs(X-i)
print(ans)


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

for i in range(len(l)):
    if (l[i] == 0):
        print(i+1)
        break
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
L = list(map(int, input().split()))
L = np.array(L)

ans = L.prod()
if (ans > pow(10,18)):
    print(-1)
else:
    print(ans)

Fixed submission:
A, B = map(int,input().split())
print(A*B)
Buggy python submission (verdict: Runtime Error):
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        System.out.println( Math.max( (Math.max(a*c,a*d)),(Math.max(b*c,b*d)) ) );



    }
}


Fixed submission:
a, b, c, d = list(map(int, input().split()))
print(max((a*c),(a*d),(b*c),(b*d)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
sum = 0
while (n != 0): 
  
    sum = sum + int(n % 10) 
    n = int(n/10) 

    
if (sum%9) == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
ans = 0
for i in range(len(s)):
    ans += int(s[i])
    
if ans%9 == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
sum = 0
while (n != 0): 
  
    sum = sum + int(n % 10) 
    n = int(n/10) 

    
if (sum%9) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()
ans = 0
for i in range(len(s)):
    ans += int(s[i])
    
if ans%9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
s = []
f = []

z = 0
c = 1
m = 0
for a in range(k-1,k):
    z = 0
    c = 1
    while z < k:
        c = c * arr[a-z]
        z += 1

    s.append(c)
    
lastkm1 = c//arr[m]
p = 1
for i in range(k,n):
    m += 1
    c = lastkm1*arr[i]
    s.append(lastkm1*arr[i])
    lastkm1 = c//arr[m]
    if s[p]>s[p-1]:
        print("Yes")
    else:
        print("No")
    p+=1
    


Fixed submission:
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))

for i in range(n-k):
    if (arr[i]<arr[i+k]):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
s = []
f = []

z = 0
c = 1
m = 0
for a in range(k-1,k):
    z = 0
    c = 1
    while z < k:
        c = c * arr[a-z]
        z += 1

    s.append(c)
    
lastkm1 = c//arr[m]

for i in range(k,n):
    m += 1
    c = lastkm1*arr[i]
    s.append(lastkm1*arr[i])
    lastkm1 = c//arr[m]

l = len(s)
for i in range(1,l):
    if s[i]>s[i-1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))

for i in range(n-k):
    if (arr[i]<arr[i+k]):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
s = []
f = []

for i in range(k-1,n):
    z = 0
    c = 1
    while z < k:
        c = c * arr[i-z]
        z += 1

    s.append(c)
    
l = len(s)
for i in range(1,l):
    if s[i]>s[i-1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))

for i in range(n-k):
    if (arr[i]<arr[i+k]):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())

nums = []
for a in range(N):
  ci = []
  ci.append(int(input()))
  ci.append(int(input()))
  nums.append(ci)

zoro = maximum = 0
for a in range(N):
  if nums[a][0] == nums[a][1]:
    zoro += 1
    maximum = max(maximum, zoro)
  else:
    zoro = 0

Fixed submission:
N = int(input())

info = []
for i in range(N):
    chis = input().split()
    info.append(chis)

maximum = zoro = 0
for each in info:
    if each[0] == each[1]:
        zoro += 1
        maximum = max(maximum, zoro)
    else:
        zoro = 0

if maximum > 2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
while True:
    ia = input()
    if ia == "AC":
        ac += 1
    elif ia == "WA":
        wa += 1
    elif ia == "TLE":
        tle += 1
    elif ia == "RE":
        re += 1
    else:
        break

print(f"""\
AC x {ac}
WA x {wa}
TLE x {tle}
RE x {re}""")


Fixed submission:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for x in range(N):
    ia = input()
    if ia == "AC":
        ac += 1
    elif ia == "WA":
        wa += 1
    elif ia == "TLE":
        tle += 1
    elif ia == "RE":
        re += 1
    else:
        break

print(f"""\
AC x {ac}
WA x {wa}
TLE x {tle}
RE x {re}""")

Buggy python submission (verdict: Runtime Error):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
while True:
    ia = input()
    if ia == "AC":
        ac += 1
    elif ia == "WA":
        wa += 1
    elif ia == "TLE":
        tle += 1
    elif ia == "RE":
        re += 1
    else:
        break

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)

Fixed submission:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for x in range(N):
    ia = input()
    if ia == "AC":
        ac += 1
    elif ia == "WA":
        wa += 1
    elif ia == "TLE":
        tle += 1
    elif ia == "RE":
        re += 1
    else:
        break

print(f"""\
AC x {ac}
WA x {wa}
TLE x {tle}
RE x {re}""")
Buggy python submission (verdict: Runtime Error):
#coding: utf-8

def __input__():
    X = str(input("―― "))
    em = 0
    Return = []
    error = False
    for spam in range(len(X)):
        if X[spam] == " ":
            Return.append(int(X[em:spam]))
            em = spam+1
    Return.append(X[em:])

l = __input__()
x = 1
for a in l:
  x *= a

print(x)


Fixed submission:
X = str(input())
em = 0
Return = []
for spam in range(len(X)):
    if X[spam] == " ":
        Return.append(int(X[em:spam]))
        em = spam+1
Return.append(int(X[em:]))
x = 1
for a in Return:
    x = x * a

print(x)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
string = str(input())
X = 0; li = []
for a in range(len(string)):
  if a = " ":
    li.append(string[X:a])
    X = a
h1 = li[0];m1 = li[1];h2 = li[2];m1 = li[3];k = li[4]
Time = (h1 * 60 + m1) - (h2 * 60 + m2) - K
print(int(Time))

Fixed submission:
#coding: utf-8
string = str(input())
X = 0
li = []
for a in range(len(string)):
    if string[a] == " ":
        li.append(string[X:a])
        X = a+1
li.append(string[X:])
for aa in range(len(li)):
    li[aa] = int(li[aa])
h1 = li[0]
m1 = li[1]
h2 = li[2]
m2 = li[3]
k = li[4]
Time = (h2 * 60 + m2) - (h1 * 60 + m1) - k
print(int(Time))

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

h1 = int(input("H₁＝"))
m1 = int(input("M₁＝"))
h2 = int(input("H₂＝"))
m1 = int(input("H₂＝"))
k = int(input("k＝"))

Time = (h1 * 60 + m1) - (h2 * 60 + m2) - K
print(int(Time))


Fixed submission:
#coding: utf-8
string = str(input())
X = 0
li = []
for a in range(len(string)):
    if string[a] == " ":
        li.append(string[X:a])
        X = a+1
li.append(string[X:])
for aa in range(len(li)):
    li[aa] = int(li[aa])
h1 = li[0]
m1 = li[1]
h2 = li[2]
m2 = li[3]
k = li[4]
Time = (h2 * 60 + m2) - (h1 * 60 + m1) - k
print(int(Time))

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

H1 = int(input("H₁="))
M1 = int(input("M₁="))
H2 = int(input("K₂="))
M2 = int(input("M₂="))
K = int(input("K="))

T = (60 * H1 + M1) - (60 * H2 + M2) - K

print(int(T))

Fixed submission:
#coding: utf-8
string = str(input())
X = 0
li = []
for a in range(len(string)):
    if string[a] == " ":
        li.append(string[X:a])
        X = a+1
li.append(string[X:])
for aa in range(len(li)):
    li[aa] = int(li[aa])
h1 = li[0]
m1 = li[1]
h2 = li[2]
m2 = li[3]
k = li[4]
Time = (h2 * 60 + m2) - (h1 * 60 + m1) - k
print(int(Time))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        if num == 0:
            Str += "D"
        else:
            if Str[num-1] == "P":
                Str += "D"
            else:
                if S[num+1] == "P":
                    Str += "D"
                else:
                    Str += "P"
print(Str)


Fixed submission:
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        Str += "D"
print(Str)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        if num == 0:
            Str += "D"
        else:
            if Str[num-1] == "P":
                Str += "D"
            else:
                if S[num+1] == "P":
                    Str += "D"
                else:
                    Str += "D"
print(Str)

Fixed submission:
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        Str += "D"
print(Str)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        if num == 0:
            Str += "D"
        else:
            if Str[num-1] == "P":
                Str += "D"
            else:
                if S[num+1] == "P":
                    Str += "D"
                else:
                    Str += "P"
print(Str)

Fixed submission:
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        Str += "D"
print(Str)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n):
    for j in range(1,n):
        if i*j <= n-1:
            ans += 1
        else:
            break
print(ans)


Fixed submission:
n = int(input())
ans = 0
for i in range(1,n):
    for j in range(i,n):
        if i*j <= n-1:
            if i == j:
                ans += 1
            else:
                ans += 2
        else:
            break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def yaku(k):
    count  = 0
    an = []
    for i in range(1,k+1):
        if len(an) > 0 and i == an[-1]:
            count += len(an)
            break
        if k % i == 0:
            count += 1
            if k/i != i:
                an.append(k/i)
    return count

n = int(input())
ans = 0
for i in range(n-1):
    count = yaku(n-i-1)
    ans += count
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n):
    for j in range(i,n):
        if i*j <= n-1:
            if i == j:
                ans += 1
            else:
                ans += 2
        else:
            break
print(ans)