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

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  s = 0
  xs = []
  for x in [int(input()) for _ in range(5)]:
    if x % 10 == 0:
      s += x
    else:
      xs.append(x)
  if len(xs) < 2:
    print(s + sum(xs))
  else:
    xs = sorted(xs, key=lambda x: x%10, reverse=True)
    print(s + sum(map(lambda x: ceil(x/10)*10, xs[:-1])) + xs[-1])

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  s = 0
  xs = []
  for x in [int(input()) for _ in range(5)]:
    if x % 10 == 0:
      s += x
    else:
      xs.append(x)
  if len(xs) == 1:
    print(s + sum(xs))
  else:
    xs = sorted(xs, key=lambda x: x%10, reverse=True)
    print(s + sum(map(lambda x: ceil(x/10)*10, xs[:-1])) + xs[-1])

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

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

# @profile
def calc_lcs(s, t):
  dp = [[0 for _ in range(len(t)+1)] for _ in range(len(s)+1)]
  # dp = numpy.zeros((len(s)+1, len(t)+1))
  for i, si in enumerate(s, 1):
    for j, tj in enumerate(t, 1):
      dp[i][j] = max((dp[i-1][j-1] + 1) if si==tj else 0, dp[i-1][j], dp[i][j-1])

  lcs = ''
  i, j = len(s), len(t)
  while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
      i -= 1
    elif dp[i][j] == dp[i][j-1]:
      j -= 1
    else:
      lcs = s[i-1] + lcs
      i -= 1
      j -= 1
  return lcs

def main():
  s = input().strip()
  t = input().strip()
  print(calc_lcs(s, t))


if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

import numpy

def calc_lcs(s, t):
  dp = numpy.zeros((len(s)+1, len(t)+1))
  for i, si in enumerate(s, 1):
    for j, tj in enumerate(t, 1):
      dp[i][j] = max((dp[i-1][j-1] + (1 if si==tj else 0), dp[i-1][j], dp[i][j-1]))

  lcs = ''
  i, j = len(s), len(t)
  while i > 0 and j > 0:
    if   dp[i][j] == dp[i-1][j-1]+1:
      lcs = s[i-1] + lcs
      i -= 1
      j -= 1
    elif dp[i][j] == dp[i-1][j]:
      i -= 1
    elif dp[i][j] == dp[i][j-1]:
      j -= 1
  return lcs

def main():
  s = input().strip()
  t = input().strip()
  print(calc_lcs(s, t))


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

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)

def main():
  n, m = map(int, input().strip().split())
  memo = [-1] * (n+1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    lp = 0
    for t in graph[v]:
      lp = max(lp, rec(t)+1)
    memo[v] = lp
    return memo[v]

  lp = 0
  for v in range(1, n+1):
    lp = max(lp, rec(v))
  print(lp)


if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict
import sys
sys.setrecursionlimit(10**5+100)

def main():
  n, m = map(int, input().strip().split())
  memo = [-1] * (n+1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    memo[v] = max([0] + [rec(t)+1 for t in graph[v]])
    return memo[v]

  print(max([rec(v) for v in range(1, n+1)]))

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict
import sys
sys.setrecursionlimit(10**5+1)

def main():
  n, m = map(int, input().strip().split())
  memo = [-1] * (n+1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    memo[v] = max([0] + [rec(t)+1 for t in graph[v]])
    return memo[v]

  print(max([rec(v) for v in range(1, n+1)]))

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict

def main():
  n, m = map(int, input().strip().split())
  memo = [-1] * (n+1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    memo[v] = max([0] + [rec(t)+1 for t in graph[v]])
    return memo[v]

  print(max([rec(v) for v in range(1, n+1)]))

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict
import numpy


def main():
  n, m = map(int, input().strip().split())
  memo = numpy.full(n+1, -1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    memo[v] = numpy.max([0] + [rec(t)+1 for t in graph[v]])
    return memo[v]

  print(numpy.max([rec(v) for v in range(1, n+1)]))

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

Fixed submission:
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

from itertools import combinations
from functools import reduce
from collections import Counter

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

def prime_factorization(x):
  # 100までの素数でしか動かない
  facters = []

  if x == 1:
    return [1]

  if x in primes:
    return [x]

  for p in primes:
    while x%p == 0:
      x /= p
      facters += [p]
  return facters


facters = {i:prime_factorization(i) for i in range(1, 100+1)}

def main():
  n = int(input())

  nn = []
  for i in range(2, n+1):
    nn += facters[i]
  nn = [x+1 for x in Counter(nn).values()]
  count_5 = 0
  count_3 = 0
  count_15 = 0
  count_25 = 0
  count_75 = 0
  f = lambda x: x*f(x-1) if x>1 else 1
  comb = lambda x,y: int(f(x) / (f(y)*f(x-y))) if y<=x else 0
  for x in nn:
    if 75 <= x:
      count_75 += 1
    if 25 <= x:
      count_25 += 1
    if 15 <= x:
      count_15 += 1
    if 5 <= x:
      count_5 += 1
    if 3 <= x:
      count_3 += 1

  counts = [count_3, count_5, count_15, count_25, count_75] # length: 5

  ans = comb(count_5, 2) * (count_3 - 2) \
      + count_15 * (count_5 - 1) \
      + count_25 * (count_3 - 1) \
      + count_75
  print(ans)

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

from itertools import combinations
from functools import reduce
from collections import Counter

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

def prime_factorization(x):
  # 100までの素数でしか動かない
  facters = []

  if x == 1:
    return [1]

  if x in primes:
    return [x]

  for p in primes:
    while x%p == 0:
      x /= p
      facters += [p]
  return facters


facters = {i:prime_factorization(i) for i in range(1, 100+1)}

def main():
  n = int(input())

  nn = []
  for i in range(2, n+1):
    nn += facters[i]
  nn = [x+1 for x in Counter(nn).values()]
  xx = reduce(lambda x, y: x*y, [n+1for n in nn])
  count_5 = 0
  count_3 = 0
  count_15 = 0
  count_25 = 0
  count_75 = 0
  f = lambda x: x*f(x-1) if x>1 else 1
  comb = lambda x,y: int(f(x) / (f(y)*f(x-y))) if y<=x else 0
  for x in nn:
    if 75 <= x:
      count_75 += 1
    if 25 <= x:
      count_25 += 1
    if 15 <= x:
      count_15 += 1
    if 5 <= x:
      count_5 += 1
    if 3 <= x:
      count_3 += 1

  counts = [count_3, count_5, count_15, count_25, count_75] # length: 5

  ans = comb(count_5, 2) * (count_3 - 2) \
      + count_15 * (count_5 - 1) \
      + count_25 * (count_3 - 1) \
      + count_75
  print(ans)

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

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import floor

def main():
  n, m = map(int, input().split())
  divisors = []
  for i in list(range(1, floor(m**0.5)+1))[::-1]:
    if m%i == 0:
      divisors.insert(0, i)    
      if m//i != i:
        divisors.append(m//i)
  
  for divisor in divisors[::-1]:
    if m//divisor >= n:
      print(divisor)
      return
    
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  n, m = map(int, input().split())
  for i in list(range(1, ceil(m/n)+1))[::-1]:
    if m%i == 0 and m//i >= n:
      print(i)
      return

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

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import floor

def main():
  n = int(input())
  la = list(map(int, input().split()))
  la = [a-i for i, a in enumerate(la, 1)]
  la.sort()
  if len(la) == 1:
    print(0)
  else:
    ix = (len(la)-1) // 2
    print(min([sum(map(lambda x: abs(x-la[ix+i]), la)) for i in range(2)]))

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import floor

def main():
  n = int(input())
  la = list(map(int, input().split()))
  la = [a-i for i, a in enumerate(la, 1)]
  ix = len(la) // 2
  print(min([sum(map(lambda x: abs(x-la[ix+i]), la)) for i in range(2)]))

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

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from functools import reduce

def calc_gcd(a, b):
  if a > b:
    a, b = b, a
  while b % a:
    a, b = b % a, a
  return a

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) >= k and k % (reduce(calc_gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
from functools import reduce, gcd

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) > k and (max(la) - k) % (reduce(gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import gcd
from functools import reduce

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) > k and (max(la) - k) % (reduce(gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()
Problem p03679 (python)

Fixed submission:
if __name__=="__main__":
    x, a ,b = map(int, input().split())
    if b - a <= 0:
        print("delicious")
    elif b - a <= x:
        print("safe")
    else:
        print("dangerous")

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    x, a ,b = input().split()
    if b - a <= 0:
        print("delicious")
    elif b - a <= x:
        print("safe")
    else:
        print("dangerous")
Problem p03813 (python)

Fixed submission:
if __name__=="__main__":
    s = int(input())
    if(s < 1200):
        print("ABC")
    else:
        print("ARC")

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    s = int(input())
    if(s < 1200):
	print("ABC")
    else:
        print("ARC")

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    [s] = map(int,input().split())
    if(s < 1200):
	print("ABC")
    else:
        print("ARC")

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    [s] = map(int,input().split())
    if(a < 1200):
    	print("ABC")
    else:
	print("ARC")
Problem p03815 (python)

Fixed submission:
if __name__=="__main__":
    [s] = map(int, input().split())
    q = int(s / 11)
    r = s % 11
    if(r!=0):
        r = int((r-1)/6 + 1)
    print(2*q + r)

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    s=int(input().split()[0])
    q=int(s/11)
    r=s%11
    if(r!=0):
	r=int((r-1)/6+1)
    print(2*q+r)

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
s = int(input().split()[0])
    q = int(s / 11)
    r = s % 11
    if(r!=0):
	r = int((r-1)/6 + 1)
    print(2*q + r)

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    s	= int(input().split()[0])
    q =	int(s / 11)
    r =	s % 11
    if(r!=0):
	r = int((r-1)/6 + 1)
    print(2*q + r)

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    [s]	= map(int, input().split())
    q =	int(s / 11)
    r =	s % 11
    if(r != 0):
	r = int((r-1)/6 + 1)

    print(2*q + r)
Problem p03966 (python)

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def ceil(a, b):
  return (a + b - 1) // b

def main():
  n = int(input())
  nt, na = 1, 1
  for i in range(n):
    t, a = map(int, input().split())
    r = max([ceil(nt, t), ceil(na, a)])
    nt, na = r*t, r*a
  print(nt + na)

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  n = int(input())
  for i in range(n):
    t, a = map(int, input().split())
    if i == 0:
      nt, na =  t, a
      continue
    cands = list(filter(lambda x: x[0] >= nt and x[1] >= na, [(ceil(nt/t)*t, ceil(nt/t)*a), (ceil(na/a)*t, ceil(na/a)*a)]))
    nt, na = min(cands)
  print(nt + na)

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

Fixed submission:
import fractions

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

A,B,C,D = map(int,input().split())
lcm = lcm(C,D)
print((B - A + 1) - ((B // D - (A - 1) // D) + (B // C - (A - 1) // C) - (B // lcm - (A - 1) // lcm)))

Buggy submission (verdict: Runtime Error):
import math

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

A,B,C,D = map(int,input().split())
lcm = lcm(C,D)
print((B - A + 1) - ((B // D - (A - 1) // D) + (B // C - (A - 1) // C) - (B // lcm - (A - 1) // lcm)))
Problem p03074 (python)

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

cnt = 0
state = sss[0]
x = []
if sss[0] == "0":
    x.append(0)
for s in sss:
    if s == state:
        cnt += 1
    else:
        state = s
        x.append(cnt)
        cnt = 1
x.append(cnt)
if sss[-1] == "0":
    x.append(0)
#11101010110011
#1:3 1 1 2 2
#0: 1 1 1 2

#1
#1

y = [0]
for i in range(len(x)):
    y.append(y[i] + x[i])
#:0,1,2,3,4,5,6 7, 8 ,9
#:0,3,4,5,6,7,8,10,12,14

#0,1

z = []
for i in range(k*2+1,len(y))[::2]:
    z.append(y[i] - y[i - (k*2+1)])
#print(x)
#print(y)
#print(z)
if len(x) <= k*2-1:
    print(sum(x))
else:
    print(max(z))

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

now = 1
cnt = 0
x = []

for i in range(n):
    if sss[i] == str(now):
        cnt += 1
    else:
        x.append(cnt)
        now = 1 - now
        cnt = 1
if cnt != 0:
    x.append(cnt)
if len(x) % 2 == 0:
    x.append(0)

Add = 2 * k + 1
ans = 0

for i in range(len(x))[::2]:
    tmp = 0
    left = i
    right = min(i + Add, len(x))
    for j in range(left, right + 1):
        tmp += x[j]
    ans = max(tmp, ans)

print(ans)

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


if N/2 < K:
    ans = N
else:
    cnt = 0
    state = S[0]
    X = []
    if S[0] == "0":
        X.append(0)
    for i in S:
        if i == state:
            cnt += 1
        else:
            state = i
            X.append(cnt)
            cnt = 1
    X.append(cnt)

    #print(X)
    #print(len(X)-K)

    Y = []
    for i in range(0,len(X)-(K*2+1)+1,2):
        tmp = 0
        for j in range(i,i+(K*2+1)):
            tmp += X[j]
        Y.append(tmp)
    
    #print(Y)

    ans = max(Y)

print(ans)
Problem p03076 (python)

Fixed submission:
x = []
y = []
for i in range(5):
    a = int(input())
    if a % 10 != 0:
        y.append(a % 10)
    if a % 10 != 0:
        a = a + (10 - (a % 10))
    x.append(a)

ans = sum(x)
if len(y) != 0:
    s = 10 - min(y)
    ans -= s

print(ans)

Buggy submission (verdict: Runtime Error):
x = []
y = []
for i in range(5):
    a = int(input())
    if a % 10 != 0:
        y.append(a % 10)
    if a % 10 != 0:
        a = a + (10 - (a % 10))
    x.append(a)

ans = sum(x)
s = 10 - min(y)

ans -= s

print(ans)
Problem p03078 (python)

Fixed submission:
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []
for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])
ab.sort(reverse = True)

abc = []
for i in range(min(k,len(ab))):
    for j in range(z):
        abc.append(ab[i] + c[j])

abc.sort(reverse = True)

for i in range(k):
    print(abc[i])

Buggy submission (verdict: Runtime Error):
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

x = []
for i in range(100):
    for j in range(100):
        for k in range(100):
            x.append(A[i] + B[j] + C[k])
x.sort(reverse=True)

for i in range(K):
    print(x[i])
Problem p03086 (python)

Fixed submission:
A = str(input())
S = []
for s in A:
    S.append(s)
ACGT = ["A","C","G","T"]
X = []
cnt = 0
ans = []
for i in range(len(S)):
    if S[i] in ACGT:
        cnt += 1
        continue
    else:
        ans.append(cnt)
        cnt = 0
ans.append(cnt)
print(max(ans))

Buggy submission (verdict: Runtime Error):
A = str(input())
S = []
for s in A:
    S.append(s)
ACGT = ["A","C","G","T"]
X = []
cnt = 0
ans = []
for i in range(len(S)):
    if S[i] in ACGT:
        cnt += 1
        continue
    else:
        ans.append(cnt)
        cnt = 0

print(max(ans))
Problem p03087 (python)

Fixed submission:
N,Q = map(int,input().split())
s = input()
t = [0]
ans = []
for i in range(N):
    if s[i:i+2] == "AC":
        t.append(t[i] + 1)
    else:
        t.append(t[i])
for i in range(Q):
    l,r = map(int,input().split())
    ans.append(t[r-1]-t[l-1])
for i in ans:
    print(i)

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

index = -1
idxs = []
while True:
    index = s.find("A", index + 1)
    if index == -1:
        break
    elif s[index + 1] == "C":
        idxs.append(index)

for i in range(Q):
    l,r = map(int,input().split())
    ans = sum(l-1 <= x <= r-2 for x in idxs)
    print(ans)

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


idx = []

for i in range(len(S)):
        if S[i] != "A" and S[i] != "C":
            flag = 0
            continue
        if S[i] == "A":
            flag = 1
            continue
        if S[i] == "C" and flag == 1:
            flag = 0
            idx.append(i-1)
            continue
        if S[i] == "C" and flag == 0:
            continue

#print(idx)
L = []
R = []
for _ in range(Q):
    l,r = map(int,input().split())
    ans = 0
    for i in idx:
        if i in range(l-1,r-1):
            ans += 1
    print(ans)
Problem p03126 (python)

Fixed submission:
N,M = map(int,input().split())
A = [0 for i in range(M)]
for i in range(N):
    B = list(map(int,input().split()))
    B.pop(0)
    for j in range(len(B)):
        A[B[j]-1] += 1

cnt = 0
for i in range(M):
    if A[i] == N:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import copy
N,M = map(int,input().split())
A = list(map(int,input().split()))
x = A.pop(0)
for i in range(N-1):
    B = list(map(int,input().split()))
    B.pop(0)
    y = len(A)
    C = copy.deepcopy(A)
    for j in range(y):
        if C[j] not in B:
            A.pop(j)
    if len(A) == 0:
        break

print(len(A))
Problem p03730 (python)

Fixed submission:
A,B,C = map(int,input().split())
i = 1
ans = "NO"
modlist = []
while True:
    if (B * i + C) % A == 0:
        ans = "YES"
        break
    else:
        modlist.append((B * i + C) % A)
        i += 1
    if len(modlist) != len(set(modlist)):
        break
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
found = False
for i in range(1,B+1):
    if A * i % B == C:
        found = True
if found = True:
    print("YES")
else:
    print("NO")
Problem p02717 (python)

Fixed submission:
X, Y, Z = input().split()
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
b = 0
if X == 1:
  print(0)
else:
  while b <= N: 
    N = abs(N - X)
    b = abs(N - X)
  print(N)
Problem p02772 (python)

Fixed submission:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')

Buggy submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
print(A)
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0

for l in B:
  if l % 5 == 0 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Buggy submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
print(A)
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 0 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

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

B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 1 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Buggy submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 1 or l % 3 == 0:
    C += C + 1

if C/len(B) ==1:
  print('APPROVED')
else:
  print('DENIED')

Buggy submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
B = []
C = 1

for i in A:
  if i % 2 == 0:
    B.append(i)

for l in B:
  if l % 3 == 1 or l % 5 == 0:
    C += C + 1
    
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')
Problem p03292 (python)

Fixed submission:
a,b,c = input().split(' ')
A = abs(int(a)-int(b))
B = abs(int(b)-int(c))
C = abs(int(c)-int(a))
N = A + B + C -max(A, B, C)
print(N)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
X = 0
for i in range(len(S)):
  S = S[-1] + S[:-1] 
  print(S)
  if S == T:
    X = 1

if X == 0:
  print('No')
elif X == 1:
  print('Yes')
Problem p02642 (python)

Fixed submission:
import sys
N = int(input())
A = sorted(list(map(int, sys.stdin.readline().split())))

d = {}
for a in A:
    d.setdefault(a, 0)
    d[a] += 1

A = sorted(set(A))
t = [True] * (10 ** 6 + 1)
for a in A:
    if d[a] > 1:
        t[a] = False
    for i in range(a + a, 10 ** 6 + 1, a):
        t[i] = False
print(sum(1 for a in A if t[a]))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
A = sorted(list(map(int, sys.stdin.readline().split())))

count = 0

for i in range(N):
    bool = True
    for j in range(i):
        if A[i] % A[j] == 0:
            bool = False
            break
    if bool:
        count += 1
        
if A[0] == A[1]:
    count -= 1
        
print(count)