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

Fixed submission:
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, n):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime


from collections import defaultdict
d=defaultdict(lambda :1)
num = int(input())
w=10**9+7
for i in range(2,num+1):
    prime_num_list = make_prime(i)
    for j in range(len(prime_num_list)):
        key = prime_num_list[j][0]
        d[key] += prime_num_list[j][1]
cnt=1
for val in d.values():
    cnt*=val%w
print(cnt%w)

Buggy submission (verdict: Runtime Error):
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime
def factional_for(n):
    result = 1
    for i in range(n, 0, -1):
        result *= i
    return result
num = int(input())
w=10**9+7
s=1
prime_num_list = make_prime(factional_for(num))
for i in range(len(prime_num_list)):
    s *= (prime_num_list[i][1]+1)%w
print(s)

Buggy submission (verdict: Runtime Error):
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime
def factional_for(n):
    result = 1
    for i in range(n, 0, -1):
        result *= i
    return result
num = int(input())
w=10**9+7
s=0
prime_num_list = make_prime(factional_for(num))
for i in range(len(prime_num_list)):
    s += (prime_num_list[i][1]+1)%w
print(s)

Buggy submission (verdict: Runtime Error):
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime
def factional_for(n):
    result = 1
    for i in range(n, 0, -1):
        result *= i
    return result
num = int(input())
s=0
prime_num_list = make_prime(factional_for(num))
print(prime_num_list)
for i in range(len(prime_num_list)):
    s += prime_num_list[i][1]+1
print(s)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1,int(n**0.5)+1):
        if n % i ==0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

def make_factorial(n):
    if n <= 1:
        return 1
    else:
        return n*make_factorial(n-1)
num = int(input())
print(len(make_divisors(make_factorial(num))))
Problem p03836 (python)

Fixed submission:
sx, sy, tx, ty = map(int,input().split())
x,y=tx-sx,ty-sy
trail='U'*y + 'R'*x
trail+='D'*y + 'L'*x
trail+='L'+'U'*(y+1)+'R'*(x+1)+'D'
trail+='R'+'D'*(y+1)+'L'*(x+1)+'U'
print(trail)

Buggy submission (verdict: Runtime Error):
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, n):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime


from collections import defaultdict
d=defaultdict(lambda :1)
num = int(input())
w=10**9+7
for i in range(2,num+1):
    prime_num_list = make_prime(i)
    for j in range(len(prime_num_list)):
        key = prime_num_list[j][0]
        d[key] += prime_num_list[j][1]
cnt=1
for val in d.values():
    cnt*=val
print(cnt)

Buggy submission (verdict: Runtime Error):
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, n):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime


from collections import defaultdict
d=defaultdict(lambda :1)
num = int(input())
w=10**9+7
for i in range(2,num+1):
    prime_num_list = make_prime(i)
    for j in range(len(prime_num_list)):
        key = prime_num_list[j][0]
        d[key] += prime_num_list[j][1]
cnt=1
for val in d.values():
    cnt*=val
print(cnt)
Problem p02694 (python)

Fixed submission:
num = input()
a = 100
count = 0
while count>=0:
    a = int(a * 1.01)
    count = count + 1
    if a>=int(num):
        break
print(count)

Buggy submission (verdict: Runtime Error):
num = input()
a = 100
count = 0
while count>=0:
  a = a * 1.1
  count = count + 1
  if a>=num:
    break
print(count)
Problem p02741 (python)

Fixed submission:
K=int(input())

lis = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(lis[K-1])

Buggy submission (verdict: Runtime Error):
K=int(input())

lis = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(lis[K+1])
Problem p02761 (python)

Fixed submission:
import sys
N,M = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(M)]

ans = ['-1'] * N

for i in range(M):
    if ans[sc[i][0]-1] == sc[i][1]:
        continue
    elif ans[sc[i][0]-1] == '-1':
        ans[sc[i][0]-1] = sc[i][1]
    else:
        print('-1')
        sys.exit()

if N >= 2:
    if ans[0] == '-1':
        ans[0] = 1
    elif ans[0] == 0:
        print('-1')
        sys.exit()
else:
    if ans[0] == '-1':
        print(0)
        sys.exit()

for i in range(N):
    if ans[i] == '-1':
        ans[i] = 0

real = 0
for i in ans:
    real = real * 10 + i

print(real)

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
s = [list(map(int,input().split())) for i in range(M)]
ans = 0
ans_list = [ 0 for i in range(M)]

if M == 0:
    if N == 1:
        print('0')
    else:
        print(-1)
    sys.exit()
import sys
N,M = map(int,input().split())
s = [list(map(int,input().split())) for i in range(M)]
ans = 0
ans_list = [ 0 for i in range(M)]

if M == 0:
    if N == 1:
        print('0')
    else:
        print(-1)
    sys.exit()

for i in range(M):
    ans_list[s[i][0]-1] = s[i][1]

for i in range(M):
    ans = ans * 10 + ans_list[i]

if len(str(ans)) == N:
    print(ans)
else:
    print('-1')
for i in range(M):
    ans_list[s[i][0]-1] = s[i][1]

for i in range(M):
    ans = ans * 10 + ans_list[i]

if len(str(ans)) == N:
    print(ans)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
s = [list(map(int,input().split())) for i in range(M)]
ans = 0
ans_list = [ 0 for i in range(M)]

if M == 0:
    print('0')

for i in range(M):
    ans_list[s[i][0]-1] = s[i][1]

for i in range(M):
    ans = ans * 10 + ans_list[i]

if len(str(ans)) == N:
    print(ans)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
s = [list(map(int,input().split())) for i in range(M)]
ans = 0
ans_list = [ 0 for i in range(M)]

for i in range(M):
    ans_list[s[i][0]-1] = s[i][1]

for i in range(M):
    ans = ans * 10 + ans_list[i]

if len(str(ans)) == N:
    print(ans)
else:
    print('-1')
Problem p02767 (python)

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
min = 9999999999
for i in range(1,101):
    sum = 0
    for j in range(N):
        sum += (X[j] - i)**2
        
    if sum < min:
        min = sum

print(min)

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(M)]

ans = [0] * N
checkd = [False] * N

for i in range(M):
    if not checkd[sc[i][0]-1]:
        checkd[sc[i][0]-1] = True
        ans[sc[i][0]-1] = sc[i][1]
    else:
        if ans[sc[i][0]-1] != sc[i][1]:
            print('-1')
            sys.exit()

if N >= 2 and checkd[0] and ans[0] == 0:
    print('-1')
    sys.exit()

real = 0
for i in ans:
    real = real * 10 + i
    
print(real)
Problem p02784 (python)

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

if H <= sum(A):
    print('Yes')
else:
    print('No')

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

if H =< sum(A):
    print('Yes')
else:
    print('No')
Problem p02789 (python)

Fixed submission:
A,B=map(int,input().split())
if A==B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
P=list(map(int,input().split()))
ans=0
flag=True
for i in range(N):
  for j in range(i):
    if(P[i]>P[j]):
      flag=False
      break
  if flag:ans+=1
  flag=True
print(ans)
Problem p02817 (python)

Fixed submission:
a = list(map(str,input().split()))

print(a[1] + a[0])

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

print(a[1],a[0])
Problem p02717 (python)

Fixed submission:
x,y,z=map(int, input().split())
print("{} {} {}".format(z,x,y))

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

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

min_0 = N
min_1 = abs(N-m*K)
min_2 = abs(min_1-K)
m=int(min_2/K)
min_3 = abs(min_2-m*K)

print(min(min_0, min_1, min_2, min_3))

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

min_0 = N
min_1 = abs(N-m*K)
min_2 = abs(min_1-K)

print(min(min_0, min_1, min_2))N,K=map(int, input().split())
m=int(N/K)

min_0 = N
min_1 = abs(N-m*K)
min_2 = abs(min_1-K)
m=int(min_2/K)
min_3 = abs(min_2-m*K)

print(min(min_0, min_1, min_2, min_3))
Problem p03455 (python)

Fixed submission:
a,b = map(int, input().split())
if (a*b)%2==0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if (a*b)%2==0:
  print('Even')
else:
  print('Odd')
Problem p03456 (python)

Fixed submission:
a, b = input().split()
l_a = len(a)
l_b = len(b)
if ((int(a)*(10**l_b) + int(b))**0.5).is_integer():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b = input().split()
l_a = len(a)
l_b = len(b)
if sqrt(int(a)*10**l_b + int(b)).is_integer():
  print('Yes')
else:
  print('No')
Problem p03730 (python)

Fixed submission:
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li.append(c)

if C in li:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li += c

if C in li:
  print("YES")
else:
  print("NO")
Problem p02848 (python)

Fixed submission:
num = int(input())
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)

Buggy submission (verdict: Runtime Error):

num = input()
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)
Problem p03069 (python)

Fixed submission:
###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
#    count = 0
    countMin = 200001
    counttemp = 0
    isWhite = True
    numlist = []
    for t in S:
        if t == "#" and isWhite:
            isWhite = False
            numlist.append(counttemp)
            counttemp = 0
        if t == "." and not isWhite:
            isWhite = True
            numlist.append(counttemp)
            counttemp = 0
        counttemp += 1
    
    numlist.append(counttemp)
    if len(numlist) <= 2:
        countMin = 0
    else:
        countMin = sum(numlist[2::2])
        temp = countMin
        i = 2
        while i < len(numlist):
            temp += numlist[i-1] - numlist[i]
            countMin = temp if temp < countMin else countMin
            i += 2
#    print(numlist)           
    print(countMin)

Buggy submission (verdict: Runtime Error):

###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
#    count = 0
    countMin = 200001
    counttemp = 0
    isWhite = True
    numlist = []
    for t in S:
        if t == "#" and isWhite:
            isWhite = False
            numlist.append(counttemp)
            counttemp = 0
        if t == "." and not isWhite:
            isWhite = True
            numlist.append(counttemp)
            counttemp = 0
        counttemp += 1
    
    numlist.append(counttemp)
    if len(numlist) <= 2:
        countMin = 0
    else:
        j = 1
        while j < N:
            counttemp = 0
            i = 2
            while i < N:
                if i < j :
                    counttemp += numlist[i-1]
                else:
                    counttemp += numlist[i]
                i += 2
            if counttemp < countMin:
                countMin = counttemp
            j += 1    
#    print(numlist)           
    print(countMin)

Buggy submission (verdict: Runtime Error):

###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
    count = 0
    for t in S:
        if t == "#":
            keepColor = True
        if keepColor and t == ".":
            count += 1
    count2 = 0
    keepColor = False
    for t in S[::-1]:
        if t == ".":
            keepColor = True
        if keepColor and t == "#":
            count2 += 1
    print(min(count,count2))
Problem p02714 (python)

Fixed submission:
from collections import Counter

N = int(input())
s = input()
cnt = Counter(s)
R = cnt.get('R', 0)
G = cnt.get('G', 0)
B = cnt.get('B', 0)
ans = R * G * B
for i in range(N-1):
  for j in range(i+1, N):
    if s[i] != s[j] and 2*j-i < N and s[i] != s[2*j-i] and s[j] != s[2*j-i]:
      ans -= 1
print(ans)

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

N = int(input())
s = input()
cnt = Counter(s)
R = cnt.get('R', 0)
G = cnt.get('G', 0)
B = cnt.get('B', 0)
ans = R * G * B
for i in range(N-1):
  for j in range(i+1, N):
    if s[i] != s[j] and 2*j-i < n and s[i] != s[2*j-i] and s[j] != s[2*j-i]:
      ans -= 1
print(ans)
Problem p02727 (python)

Fixed submission:
def resolve():
    X, Y, A, B, C = map(int, input().split())
    p = sorted(list(map(int, input().split())), reverse=True)
    q = sorted(list(map(int, input().split())), reverse=True)
    r = sorted(list(map(int, input().split())), reverse=True)
    pre = sorted(p[:X] + q[:Y])
    for i in range(min(X + Y, C)):
        if pre[i] < r[i]:
            pre[i] = r[i]
        else:
            break
    print(sum(pre))

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    X, Y, A, B, C = map(int, input().split())
    p = sorted(list(map(int, input().split())), reverse=True)
    q = sorted(list(map(int, input().split())), reverse=True)
    r = sorted(list(map(int, input().split())), reverse=True)
    pp, pq, pr = 0, 0, 0
    x, y = 0, 0
    ans = 0
    while X > 0 and Y > 0:
        while X > 0 and p[pp] > r[pr]:
            ans += p[pp]
            pp += 1
            X -= 1

        while Y > 0 and q[pq] > r[pr]:
            ans += q[pq]
            pq += 1
            Y -= 1
		
        if not X and not Y:
            break
        ans += r[pr]
        pr += 1
        if not X or X < Y:
            Y -= 1
        else:
            X -= 1

    print(ans)

resolve()
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())
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))

Buggy submission (verdict: Runtime Error):
N, R = map(int, input())
if N >= 10:
  print(R)
else:
  print(R - 100 * (10 - N))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())
if N >= 10:
  print(R)
else:
  print(R - 100 * (10 - N))
Problem p02772 (python)

Fixed submission:
def resolve():
    N = int(input())
    arr = list(map(int, input().split()))
    f = True
    for num in arr:
        if not num % 2 and not (num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            f = False
            break
    if f:
        print('APPROVED')


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    arr = list(map(int, input.split()))
    for num in arr:
        if not num % 2 and not (num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            quit()
    print('APPROVED')

resolve()
Problem p02786 (python)

Fixed submission:
def resolve():
    H = int(input())
    def sol(n):
        if n == 1:
            return 1
        return 1 + 2 * sol(n//2)
    print(sol(H))

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    H = int(input())
    dp = [0] * (H + 1)
    dp[1] = 1
    for i in range(2, H + 1):
        dp[i] = 1 + 2 * dp[i // 2]
    print(dp[-1])

resolve()

Buggy submission (verdict: Runtime Error):
H = int(input())
dp = [0] * (H+1)
dp[1] = 1
for i in range(2, H+1):
  dp[i] = 1 + 2 * dp[i//2]
print(dp[-1])
Problem p02789 (python)

Fixed submission:
m, n = map(int, input().split())
if m == n:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
M, N = map(int, input())
if M == N:
  print('Yes')
else:
  print('No')
Problem p02818 (python)

Fixed submission:
def resolve():
    A, B, K = map(int, input().split())
    if K >= A:
        print(0, max(0, B - K + A))
    else:
        print(A - K, B)

resolve()

Buggy submission (verdict: Runtime Error):
B, K = map(int, input().split())
if K >= A:
  print(0, max(0, B-K+A))
else:
  print(A-K, B)
Problem p03086 (python)

Fixed submission:
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while start < length and S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start)
  start = right
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start )
  start = right
print(ans)
Problem p02789 (python)

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

if N == M:
  print('Yes')
else:
  print('No')

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

if N == M:
  print('Yes')
else:
  print('No')
Problem p02898 (python)

Fixed submission:
N,K = input().split()
n = int(N)
k = int(K)
hList = input().split()

count = 0
for i in range(0,n):
    if int(hList[i]) >= k:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N,K = input().split()
n = int(N)
k = int(K)
hList = []

for i in range(0,n):
    hList.append(int(input()))

count = 0
for i in range(0,n):
    if hList[i] >= k:
        count += 1
print(count)
Problem p02927 (python)

Fixed submission:
#入力が横に一行並んでるときはこうする↓
M,D = input().split()
 
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
M = input()
D = input()

count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
M = input()
D = input()

count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if (int(y) * int(z) == j) and (int(z) != 1) and (int(y) != 1):
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
M = input()#5
D = input()#30


caM = []
for i in range(1,int(M)+1):
    caM.append(i)
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if (int(y) * int(z) == j) and (int(z) != 1) and (int(y) != 1):
                count += 1
print(count)
Problem p03737 (python)

Fixed submission:
s1,s2,s3 = input().split()

s1 = str(s1[0:1].upper())
s2 = str(s2[0:1].upper())
s3 = str(s3[0:1].upper())
print(s1 + s2 + s3)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = input().split()

s1 = s1[0:1].upper
s2 = s2[0:1].upper
s3 = s3[0:1].upper
print(s1 + s2 + s3)
Problem p03795 (python)

Fixed submission:
N = int(input())

print(N*800 - N//15*200)

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

print(N*800 - (N/15)*200)N = int(input())

print(N*800 - round((N/15))*200)
Problem p03813 (python)

Fixed submission:
x = input()
if int(x) >= 1200:
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
x = input()
if int(x) >= 1200:
    print(ARC)
else:
    print(ABC)

Buggy submission (verdict: Runtime Error):
x = input()
if x >= 1200:
    print(ARC)
else:
    print(ABC)
Problem p02772 (python)

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

for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            continue

        else:
            print("DENIED")
            exit(0)

print("APPROVED")

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

for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
        else:
            print("DENIED")
            exit(0)

print("APPROVED")

Buggy submission (verdict: Runtime Error):
N=int(input())
c=list(map(int,input().split()))
flag=0
for i in range(N):
    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            flag=1
        else:
            flag=0
            print("DENIED")
            exit(0)

if flag==1:
    print("APPROVED")
else:
    print("DENIED!)
Problem p02910 (python)

Fixed submission:
S = list(input())
rtu = "Yes"
ks = 1
for i in S:
    if ks == 1:
        if i == "L":
            rtu = "No"
            ks = 0
            break
        else:
            ks = 0
    elif ks == 0:
        if i == "R":
            rtu = "No"
            ks = 1
            break
        else:
            ks = 1
print(rtu)

Buggy submission (verdict: Runtime Error):
S = list(input())
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ka += 1
print(rtu)