Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def sum(N):
  N=str(N)
  return sum(list(map(int,N)))

t=0
n,a,b=map(int,input().split())
for i in range(n+1):
  if a<=sum(i)<=b:t+=i
print(t)

Fixed submission:
def SUM(N):
  N=str(N)
  return sum(list(map(int,N)))

t=0
n,a,b=map(int, input().split())
for i in range(n+1):
  if a<=SUM(i)<=b:t+=i
print(t)

Buggy python submission (verdict: Runtime Error):
def sum(n):
  n=str(n)
  return sum(list(map(int,n)))

t=0
n,a,b=map(int,input().split())
for i in range(n+1):
  if a<=sum(i)<=b:t+=i
print(t)

Fixed submission:
def SUM(N):
  N=str(N)
  return sum(list(map(int,N)))

t=0
n,a,b=map(int, input().split())
for i in range(n+1):
  if a<=SUM(i)<=b:t+=i
print(t)

Buggy python submission (verdict: Runtime Error):
def sum(n):
  n=str(n)
  return sum(list(map(int,n)))

t=0
n,a,b=map(int,input().split())
for i in range(0,n+1):
  print(i)
  if a<=sum(i)<=b:t+=i
print(t)

Fixed submission:
def SUM(N):
  N=str(N)
  return sum(list(map(int,N)))

t=0
n,a,b=map(int, input().split())
for i in range(n+1):
  if a<=SUM(i)<=b:t+=i
print(t)

Buggy python submission (verdict: Runtime Error):
def sum(n):
  n=str(n)
  return sum(list(map(int,n)))

t=0
n,a,b=map(int, input().split())
for i in range(0,n+1):
  print(i)
  if a<=sum(i)<=b:t+=i
print(t)

Fixed submission:
def SUM(N):
  N=str(N)
  return sum(list(map(int,N)))

t=0
n,a,b=map(int, input().split())
for i in range(n+1):
  if a<=SUM(i)<=b:t+=i
print(t)
Buggy python submission (verdict: Runtime Error):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def calcN(num):
    if num >= 45:
        return 9
    elif num >= 36:
        return 8
    elif num >= 28:
        return 7
    elif num >= 21:
        return 6
    elif num >= 15:
        return 5
    elif num >= 10:
        return 4
    elif num >= 6:
        return 3
    elif num >= 3:
        return 2
    elif num >= 1:
        return 1
    

A = int(input().split())
insuu =  factorization(A)
ret = 0
for i in insuu:
    ret += calcN(i[1])
print(ret)

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def calcN(num):
    if num >= 45:
        return 9
    elif num >= 36:
        return 8
    elif num >= 28:
        return 7
    elif num >= 21:
        return 6
    elif num >= 15:
        return 5
    elif num >= 10:
        return 4
    elif num >= 6:
        return 3
    elif num >= 3:
        return 2
    elif num >= 1:
        return 1
    

A = int(input())
if A == 1:
    print(0)
else:
    insuu =  factorization(A)
    ret = 0
    for i in insuu:
        ret += calcN(i[1])
    print(ret)
Buggy python submission (verdict: Runtime Error):
import itertools
digits1 = [str(i) for i in range(1,10)]
digits2 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits1]))
digits3 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits2]))
digits4 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits3]))
digits5 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits4]))
digits6 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits5]))
digits7 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits6]))
digits8 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits7]))
digits9 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits8]))
digits10 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits9]))
index = digits1 + digits2 + digits3 + digits4 + digits5 + digits6 + digits7 + digits8 + digits9 + digits10
K = int(input())
print(index[K-1])

Fixed submission:
import itertools
def addLunLun(str_num):
    last_digit = int(str_num[len(str_num)-1:])
    if last_digit == 0:
        return [str_num+"0",str_num+"1"]
    elif last_digit == 9:
        return [str_num+"8",str_num+"9"]
    else:
        return [str_num + str(last_digit-1),str_num + str(last_digit),str_num + str(last_digit+1)]
    
digits1 = [str(i) for i in range(1,10)]
digits2 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits1]))
digits3 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits2]))
digits4 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits3]))
digits5 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits4]))
digits6 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits5]))
digits7 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits6]))
digits8 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits7]))
digits9 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits8]))
digits10 = list(itertools.chain.from_iterable([addLunLun(i) for i in digits9]))
index = digits1 + digits2 + digits3 + digits4 + digits5 + digits6 + digits7 + digits8 + digits9 + digits10
K = int(input())
print(index[K-1])
Buggy python submission (verdict: Runtime Error):
from math import sqrt
n = int(input())
d = 1000000000000000000000
for i in range(1, sqrt(n)+1):
  if n % i == 0:
    d = min(d, i + n // i - 2)
print(d)


Fixed submission:
from math import sqrt
n = int(input())
d = 1000000000000000000000
for i in range(1, int(sqrt(n))+1):
  if n % i == 0:
    d = min(d, i + n // i - 2)
print(d)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = 1000000000000000000000
for i in range(1, int(sqrt(n))+1):
  if n % i == 0:
    d = min(d, i + n // i - 2)
print(d)

Fixed submission:
from math import sqrt
n = int(input())
d = 1000000000000000000000
for i in range(1, int(sqrt(n))+1):
  if n % i == 0:
    d = min(d, i + n // i - 2)
print(d)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = 1000000000000000000000
for i in range(1, sqrt(n)+1):
  if n % i == 0:
    d = min(d, i + n // i - 2)
print(d)


Fixed submission:
from math import sqrt
n = int(input())
d = 1000000000000000000000
for i in range(1, int(sqrt(n))+1):
  if n % i == 0:
    d = min(d, i + n // i - 2)
print(d)
Buggy python submission (verdict: Runtime Error):
n,h,w= map(int,input().split())
c = 0
for _ in range(int(input()):
	a,b = map(int,input().split())
    if a >= h and b >= w:
		c += 1
print(c)

Fixed submission:
n,h,w= map(int,input().split())
c = 0
for _ in range(n):
    a,b = map(int,input().split())
    if a>=h and b>=w:
        c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)

Fixed submission:
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f, a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_right
n,X = map(int,input().split())
a = sorted(list(map(int,input().split())))
ind = bisect_right(a,X)
if ind == 0:
    print(a[1]-X)
elif ind == n:
    print(X-a[ind-1])
else:
    print(min(a[ind]-X,X-a[ind-1]))


Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
n,X = map(int,input().split())
x = [abs(X-int(i)) for i in input().split()]
g = x[0]
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
from bisect import bisect_right
n,X = map(int,input().split())
a = list(map(int,input().split()))
ind = bisect_right(a,X)
if ind == 0:
    print(a[1]-X)
else:
    print(min(a[ind]-X,X-a[ind-1]))


Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
n,X = map(int,input().split())
x = [abs(X-int(i)) for i in input().split()]
g = x[0]
for i in range(1,n):
    g = gcd(g,x[i])
print(g)
Buggy python submission (verdict: Runtime Error):
S = sorted(list(map(int, input().split())))
print('Yes' if X[0]==X[1] and X[2]==X[3] else 'No')

Fixed submission:
S = set(input())
print('Yes' if len(S)==2 else 'No')
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())

print(int(B) if A >= 13 else 0 if A <= 5 else int(B//2)

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

if A >= 13:
    print(B)
elif A <= 5:
    print(0)
else:    
    print(B//2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = [input() for _ in range(N)]
print('Four' if len(set(D))==4 else 'Three')

Fixed submission:
input()
print("Four" if "Y" in input() else "Three")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

print(a - b - (c *((a-b) // c)))

Fixed submission:
X,A,B = (int(input()) for i in range(3))

print((X-A) % B)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
print(sum(500*i+100*j+50*k==D for i in range(A+1) for j in range(B+1) for k in range(C+1)))

Fixed submission:
A, B, C, D = [int(input()) for i in range(4)]
print(sum([500*a+100*b+50*c == D for a in range(A+1) for b in range(B+1) for c in range(C+1)]))

Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
print(sum(500*i+100*j+50*k==d for i in range(A+1) for j in range(B+1) for k in range(C+1)))

Fixed submission:
A, B, C, D = [int(input()) for i in range(4)]
print(sum([500*a+100*b+50*c == D for a in range(A+1) for b in range(B+1) for c in range(C+1)]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = [int(input()) for _ in range(n)]
print(len(set(D)))

Fixed submission:
N = int(input())
D = [int(input()) for _ in range(N)]
print(len(set(D)))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()
print ('Yes' if re.search(r'\A\d{{{}}}-\d{{{}}}\Z'.format(A, B), S) else 'No') 

Fixed submission:
import re

A, B = map(int, input().split())
S = input()
print ('Yes' if re.search(r'\A\d{{{}}}-\d{{{}}}\Z'.format(A, B), S) else 'No')
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())

print(min(N*A,B))

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

print((A+B+1)//2)
Buggy python submission (verdict: Runtime Error):
N=input()
print("No" if int(N) % sum(map(int, N)) else "Yes")

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

print(N*A if N*A < B else B)
Buggy python submission (verdict: Runtime Error):
from math import floor 
from fractions inport Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(floor(A*B))

Fixed submission:
from math import floor 
from fractions import Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(floor(A*B))

Buggy python submission (verdict: Runtime Error):
import math
from fractions inport Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(math.floor(A*B))

Fixed submission:
from math import floor 
from fractions import Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(floor(A*B))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(1, N+1):
	print(A.count(i))

Fixed submission:
import collections

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

for i in range(1, N+1):
	print(c[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math

sum = 0
K = int(input())

for a in range(1, K+1):
	for b in range(1, K+1):
		for c in range(1, K+1):
			sum += math.gcd(math.gcd(a, b), c)

print(sum)

Fixed submission:
import math

sum = 0
K = int(input())

for a in range(1, K+1):
	for b in range(1, K+1):
		x = math.gcd(a, b)
		for c in range(1, K+1):
			sum += math.gcd(x, c)

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]

S_set = set(S)
Cnt = []
max = 0
for i in S_set:
    Cnt.append([i, S.count(i)])
    if max < S.count(i):
        max = S.count(i)

Cnt_l = sorted(Cnt, reverse = False , key=lambda x: x[0])

x = [Cnt_l[i][0] for i in range(len(Cnt_l)) if Cnt_l[i][1] == max]
for i in x:
    print(i)

Fixed submission:
from collections import Counter

N = int(input())
S = [input() for i in range(N)]

c = Counter(S)
max_c = max(c.values())
#キーの昇順でソート
c_sorted = sorted(c.items(), key = lambda x:x[0])
for v in c_sorted:
    if v[1] == max_c:
        print(v[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]

S_set = set(S)
Cnt = []
max = 0
for i in S_set:
    Cnt.append([i, S.count(i)])
    if max < S.count(i):
        max = S.count(i)

Cnt_l = sorted(Cnt, reverse = False , key=lambda x: x[0])
#print(Cnt_l)
#print(max)
for i in range(len(Cnt_l)):
    if Cnt_l[i][1] == max:
        print(Cnt_l[i][0])

Fixed submission:
from collections import Counter

N = int(input())
S = [input() for i in range(N)]

c = Counter(S)
max_c = max(c.values())
#キーの昇順でソート
c_sorted = sorted(c.items(), key = lambda x:x[0])
for v in c_sorted:
    if v[1] == max_c:
        print(v[0])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = list(map(int, input().split()))

cnt = 0
if K >= N:
    cnt = 0
elif 1 <= K < N:
    for i in range(K):
        H.remove(max(H))
    cnt = sum(H)

elif K == 0:
    cnt = sum(H)

print(cnt)

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

cnt = 0
if K >= N:
    cnt = 0
elif 1 <= K < N:
    H_down = sorted(H, reverse = True)
    cnt = sum(H_down[K:])

elif K == 0:
    cnt = sum(H)

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

num = 1
for i in range(1, N):
    if min(P[:i]) >= P[i]:
        num += 1
    else:
        num = num

print(num)

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

ans = 0
curMin = 1e9
for i in range(N):
    curMin = min(curMin, P[i])
    if curMin == P[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for _ in range(1, k+1):
    if a >= 1:
        a-=1
    elif b >= 1:
        b-=1

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

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

if a >= k:
    a-=k
    print(a, b)
else:
    k -= a
    a = 0
    b = max(0, (b - k))
    print(a, b)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = list(input())

ans = 0
for i in range(len(s)-1):
    if s[i] !== s[i+1]:
        ans += 1
    else:
        ans = ans

ans += 1

print(ans)

Fixed submission:
N = int(input())
s = list(input())
ans = 0
for i in range(len(s)-1):
    if s[i] != s[i+1]:
        ans += 1
    else:
        ans = ans
ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
arr = list(map(int, input().split()))
while len(arr)>1:
    arr=sorted(arr)
    v1 = arr.pop(0)
    v2 = arr.pop(0)
    arr.append((v1+v2)/2)
print(arr[0])

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')

Buggy python submission (verdict: Runtime Error):
N = int(input())
arr = list(map(int, input().split()))
while len(arr)>1:
    arr=sorted(arr)
    v1 = arr.pop(0)
    v2 = arr.pop(0)
    arr.append((v1+v2)/2)
print(sum(arr))

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int, input().split()))
sum = 0
for i in l:
  sum = sum + 1/l
print(1/sum)

Fixed submission:
N = int(input())
A = map(int, input().split())
print(1 / sum(1 / x for x in A))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max[a+b, a-b, a*b])

Fixed submission:
a, b = map(int, input().split())
print(max(a+b, a-b, a*b))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
K = (a + b) / 2
if (type(K) is int):
  print(K)
else:
  print(IMPOSSIBLE)

Fixed submission:
a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print(int((a + b)/2))
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
c = 0
for i in L:
  if L <= X:
    c = c + 1
  elif L > X:
    print(c)
    

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

cnt = 1
D = 0
for i in L:
    D += i
    if D > X:
        break
    else:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
S = input()

if (1 <= S[:2] <= 12) & (1 <= S[2:] <= 12):
    print('AMBIGUOUS')
elif (1 <= S[:2] <= 12) & ((S[2:] == 0) or (13 <= S[2:])):
    print('MMYY')
elif (1 <= S[2:] <= 12) & ((S[:2] == 0) or (13 <= S[:2])):
    print('YYMM')
else:
    print('NA')

Fixed submission:
S = input()

#print(type(S[:2]))
#print(type(int(S[:2])))

if (1 <= int(S[:2]) <= 12) & (1 <= int(S[2:]) <= 12):
    print('AMBIGUOUS')
elif (1 <= int(S[:2]) <= 12) & ((int(S[2:]) == 0) or (13 <= int(S[2:]))):
    print('MMYY')
elif (1 <= int(S[2:]) <= 12) & ((int(S[:2]) == 0) or (13 <= int(S[:2]))):
    print('YYMM')
else:
    print('NA')
Buggy python submission (verdict: Runtime Error):
N = int(input())
v_l = [int(input()) for i in range(N)]
c_l = [int(input()) for i in range(N)]
net = [v_l[i] - c_l[i] for i in range(N)]
max = 0
for i in range(N):
  if net[i] > 0:
    max = max + net[i]
  else:
    max = max
print(max)

Fixed submission:
N = int(input())
v_l = list(map(int, input().split()))
c_l = list(map(int, input().split()))
net = [v_l[i] - c_l[i] for i in range(N)]
max = 0
for i in range(N):
  if net[i] > 0:
    max = max + net[i]
  else:
    max = max
print(max)
Buggy python submission (verdict: Runtime Error):
X = int(input(N))
if X == 7 or X == 5 or X == 3:
  print('YES')
else:
  print('NO')

Fixed submission:
X = int(input())
if X == 7 or X == 5 or X == 3:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())

def lcm(x, y):
    return (x*y) // math.gcd(x, y)

print(lcm(2, N))

Fixed submission:
N = int(input())

if N%2 == 0:
    print(N)
else:
    print(2*N)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
print(N*M-A)

Fixed submission:
N = int(input())
A = int(input())
print(N**2-A)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
q=int(input())
b=[0]*q
c=[0]*q
for i in range(q):
    b[i], c[i] = map(int, input().split())
for i in range(q):
    a=[c[i] if j == b[i] else j for j in a]
    print(sum(a))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
d=(10**5+100)*[0]
res=sum(A)
for x in A:
    d[x]+=1
for i in range(Q):
    b,c=map(int,input().split())
    res+=d[b]*(c-b)
    d[c]+=d[b]
    d[b]=0
    print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in range(n):
    ans=ans*a[i]
if ans>10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in range(n):
    if a[i]==0:
        ans=0
        break
for i in range(n):
    ans=ans*a[i]
    if ans>10**18:
        print(-1)
        break
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
t=list(input())
n=len(t)
if t[0]=="?":
    if t[1]=="P":
            t[0]="D"
    if t[1]=="D":
            t[0]="D"
    elif t[1]=="?":
        t[0]="D"
for i in range(1,n):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        if t[i-1]=="D":
            t[i]="D"
print("".join(t))

Fixed submission:
t=list(input())
n=len(t)
for i in range(n):
    if t[i]=="?":
        t[i]="D"
print("".join(t))

Buggy python submission (verdict: Runtime Error):
t=list(input())
n=len(t)
if t[0]=="?":
    if t[1]=="P":
            t[0]="D"
    if t[1]=="D":
            t[0]="P"
    elif t[1]=="?":
        t[0]="P"
for i in range(1,n):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        if t[i-1]=="D":
            t[i]="P"
print("".join(t))

Fixed submission:
t=list(input())
n=len(t)
for i in range(n):
    if t[i]=="?":
        t[i]="D"
print("".join(t))

Buggy python submission (verdict: Runtime Error):
t=list(input())
n=len(t)
if t[0]=="?":
    if t[1]=="P":
            t[i]="D"
    if t[1]=="D":
            t[i]="P"
for i in range(1,n):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        if t[i-1]=="D":
            t[i]="P"
print("".join(t))

Fixed submission:
t=list(input())
n=len(t)
for i in range(n):
    if t[i]=="?":
        t[i]="D"
print("".join(t))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=list(map(int,input().split()))
a = [0] * m
b = [0] * m
l=[0]*n
count=0
for i in range(m):
    a[i], b[i]=map(int, input().split())
    l[a-1]=max(l[a-1],h[b-1])
    l[b-1]=max(l[b-1],h[a-1])
for i in range(n):
    if h[i]>l[i]:
        count=count+1
print(count)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
l = [0]*n
 
for i in range(m):
    a, b = map(int, input().split())
    l[a-1] = max(l[a-1], h[b-1])
    l[b-1] = max(l[b-1], h[a-1])
 
count = 0
for i in range(n):
    if h[i] > l[i]:
        count += 1
 
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s= []
for _ in range(n):
    s.append(input())
count=1
for i in range(1,n):
    for j in range(i):
        if s[i]==s[j]:
            break
    else:
      count=count+1
print(count)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s= []
for _ in range(n):
    s.append(input())
S=[]
S.append(s[0])
for i in range(1,n):
    for j in range(len(S)):
        if s[i]==S[j]:
            break
    else:
      S.append(s[i])
print(len(S))

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))

Buggy python submission (verdict: Runtime Error):
n=int(input())
 s= []
for _ in range(n):
    s.append(input())
count=0
for i in range(n):
    for j in range(i):
        if s[i]==s[j]:
            count=count
        else:
            count=count+1
print(count)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))
Buggy python submission (verdict: Runtime Error):
n=input()
if s[0]==7: 
	print("Yes")
if s[1]==7:
    print("Yes")
if s[2]==7:
    print("Yes")
else:
    print("No")

Fixed submission:
n=input()
if (n[0]=='7' or n[1]=='7' or n[2]=='7'):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n=input()
if (s[0]==7 or s[1]==7 or s[2]==7):
    print("Yes")
else:
    print("No")

Fixed submission:
n=input()
if (n[0]=='7' or n[1]=='7' or n[2]=='7'):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=input()
sum1=0
for i in range(n):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
    else:
        sum1=sum1
print(sum1)

Fixed submission:
n=int(input())
sum1=0
for i in range(1,n+1):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
print(sum1)

Buggy python submission (verdict: Runtime Error):
n=input()
sum1=0
for i in range(n):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
    else:
        sum1=sum1
print(sum1)

Fixed submission:
n=int(input())
sum1=0
for i in range(1,n+1):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
print(sum1)