Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

n, s = input().split()
N = int(n)
S = [str(i) for i in s] 

counter = [0] * 26
alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(26):
    counter[i] = S.count(alp[i])

syu = 0
for i in range(26):
    if counter[i] > 0:
        syu += 1

ans = 0
for k in range(1,syu+1):
    ans += math.factorial(N) // (math.factorial(N - k) * math.factorial(k))
    #print(ans)

for a in range(26):
    num = counter[a]
    mod = N - num 
    if num == 2:
        ans -= num - 1
        for k in range(3,syu+1):
            #print(k)
            ans -= math.factorial(mod) // (math.factorial(mod - k+num) * math.factorial(k-num))
    if num > 2:
        itr = math.factorial(num) // (math.factorial(num - 2) * math.factorial(2))
        ans -= (num - 1) * itr
        for k in range(3,syu+1):
            itr = math.factorial(num) // (math.factorial(num - k) * math.factorial(k))
            ans -= (math.factorial(mod) // (math.factorial(mod - k+num) * math.factorial(k-num)))*itr

print(ans)

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

alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
count = [1]*26

for n  in range(N):
    for a in range(26):
        if S[n] == alp[a]:
            count[a] += 1

ans = 1
for a in range(26):
    ans *= count[a]
    ans %= 10**9+7

ans -= 1

print(ans%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int, input().split())
ans = A

for n in range(A+1,B+1):
    ans = ans ^ n
    
print(ans)

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

def F0(n):
    if n%4 == 1:
        return 1
    if n%4 == 2:
        return n + 1
    if n%4 == 3:
        return 0
    if n%4 == 0:
        return n
    if n == 0:
        return 0


print(F0(A-1)^F0(B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int, input().split())
ans = A
 
for n in range(A+1,B+1):
    ans = ans ^ n
    
print(ans)

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

def F0(n):
    if n%4 == 1:
        return 1
    if n%4 == 2:
        return n + 1
    if n%4 == 3:
        return 0
    if n%4 == 0:
        return n
    if n == 0:
        return 0


print(F0(A-1)^F0(B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int, input().split())
ans = A

for n in range(A+1,B+1):
    ans = ans ^ n
    
print(ans)

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

def F0(n):
    if n%4 == 1:
        return 1
    if n%4 == 2:
        return n + 1
    if n%4 == 3:
        return 0
    if n%4 == 0:
        return n
    if n == 0:
        return 0


print(F0(A-1)^F0(B))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
l = len(S)
t = True
nex = 0
while t:
    s = S
    for i in range(len(S)-1):
        if nex == 1:
            nex = 0
            continue
        if S[i:i+2] == '01' or S[i:i+2] == '10':
            s = s[:i] + '--' + s[i+2:]
            nex = 1
    #print('s',s)
    s = s.replace('-','')
    if s == S:
        print(l-len(S))
        exit()
    if len(s) == 0:
        print(l)
        exit()
    S = s

Fixed submission:
S = input()
C1 = 0
C0 = 0
for i in range(len(S)):
    if S[i] == '1':
        C1 +=1
    if S[i] == '0':
        C0 +=1

print(min(C0,C1)*2)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
l = len(S)
t = True
nex = 0
while t:
    s = S
    for i in range(len(S)-1):
        if nex == 1:
            nex = 0
            continue
        if S[i:i+2] == '01' or S[i:i+2] == '10':
            s = s[:i] + '--' + s[i+2:]
            nex = 1
    #print('s',s)
    s = s.replace('-','')
    if s == S:
        print(l-len(S))
        exit()
    if len(s) == 0:
        print(l)
        exit()
    S = s

Fixed submission:
S = input()
C1 = 0
C0 = 0
for i in range(len(S)):
    if S[i] == '1':
        C1 +=1
    if S[i] == '0':
        C0 +=1

print(min(C0,C1)*2)
Buggy python submission (verdict: Runtime Error):
import math
 
N = int(input())
A = [int(i) for i in input().split()]
g = A[0]
for n in range(1,N):
    g = math.gcd(g,A[n])

print(g)


Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N = int(input())
A = [int(i) for i in input().split()]
g = A[0]
for n in range(1,N):
    g = gcd(g,A[n])

print(g)

Buggy python submission (verdict: Runtime Error):
import math
 
N = int(input())
A = [int(i) for i in input().split()] 

 
print(math.gcd(A))

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N = int(input())
A = [int(i) for i in input().split()]
g = A[0]
for n in range(1,N):
    g = gcd(g,A[n])

print(g)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

N = int(input())
A = [int(i) for i in input().split()] 

g = gcd(*A)

print(g)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N = int(input())
A = [int(i) for i in input().split()]
g = A[0]
for n in range(1,N):
    g = gcd(g,A[n])

print(g)
Buggy python submission (verdict: Runtime Error):
import itertools 

N,M = map(int, input().split())
X = [int(i) for i in input().split()]

if M == 1:
    print(0)
    exit()

if N == 1:
    print(X[M-1]-X[0])
    exit()


X.sort()
index = range(1,M)

anslist = []
for c in itertools.combinations(index, N-1):
    ans = X[c[0]-1] - X[0]
    #print(ans)
    for n in range(N-1):
        if n == N-2:
            ans += X[M-1] - X[c[n]]
        else:
            ans += X[c[n+1]-1] - X[c[n]]
    anslist.append(ans)

print(min(anslist))


Fixed submission:
N,M = map(int, input().split())
X = [int(i) for i in input().split()]

if N >= M:
    print(0)
    exit()


X.sort()
L = [X[i+1] - X[i] for i in range(len(X)-1)]
L.sort()

print(sum(L[:(M-N)]))
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
h = [int(i) for i in input().split()]

dp = [9999999999999999999999]*N

dp[0] = 0
for i in range(1,N):
    for k in range(1,K+1):
        if i > k-1:
            dp[i] = min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))

print(dp[N-1])

Fixed submission:
N,K = map(int,input().split())
h = [int(i) for i in input().split()]

dp = [9999999999999999999999]*N

dp[0] = 0
for i in range(1,N):
    for k in range(1,K+1):
        if i > k-1:
            dp[i] = min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))

print(dp[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C = map(int,input().split())
can = min(A+B,C)
eat = 0
for i in range(can):
    C -= 1
    eat += 1
    if A > 0:
        A -= 1
    else:
        eat += 1
        B -= 1

if C > 0:
    eat += 1

print(eat+B)

Fixed submission:
A,B,C = map(int,input().split())
can = min(A+B,C)
eat = 0
C -= can
eat += can*2-A
B = A+B -can

if C > 0:
    eat += 1

print(eat+B)
Buggy python submission (verdict: Runtime Error):
D, G = map(int, input().split())
p = [0]*D
c = [0]*D
for d in range(D):
    p[d], c[d] = map(int, input().split())

time_list = []
for i in range(1<<D):
    point = 0
    time = 0
    output = []
    for j in range(D): 
        #print(i,j+1,bin(i>>j))
        if ((i >> j) & 1) == 1: #ある数と1とのANDを取ることは，その数の右端のbitが0か1を調べることに等しい．iの右からj+1番目のbitが1かどうかを確認している．
            output.append(A[j])
    #print(output)
    for d in range(D):
        if ((i>>d) & 1) == 1:
            point += 100*(d+1)* p[d] + c[d]
            time += p[d]
    if point < G:
        # iで一番左側にある0を探す。
        for d in range(D)[::-1]:
            if ((i>>d) & 1) == 0: # and論理積は1==1以外はすべてfalse
                for k in range(p[d]):
                    if point < G:
                        point += 100*(d+1) 
                        time += 1
                    else: break
                break
            else: continue
    if point >= G:
        time_list.append(time)
print(min(time_list))

Fixed submission:
D, G = map(int, input().split())
p = [0]*D
c = [0]*D
for d in range(D):
    p[d], c[d] = map(int, input().split())

time_list = []
for i in range(1<<D):
    point = 0
    time = 0
    output = []
    #for j in range(D): 
        #print(i,j+1,bin(i>>j))
        #if ((i >> j) & 1) == 1: #ある数と1とのANDを取ることは，その数の右端のbitが0か1を調べることに等しい．iの右からj+1番目のbitが1かどうかを確認している．
            #output.append(A[j])
    #print(output)
    for d in range(D):
        if ((i>>d) & 1) == 1:
            point += 100*(d+1)* p[d] + c[d]
            time += p[d]
    if point < G:
        # iで一番左側にある0を探す。
        for d in range(D)[::-1]:
            if ((i>>d) & 1) == 0: # and論理積は1==1以外はすべてfalse
                for k in range(p[d]):
                    if point < G:
                        point += 100*(d+1) 
                        time += 1
                    else: break
                break
            else: continue
    if point >= G:
        time_list.append(time)
print(min(time_list))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

E = [0]*(N+2)
W = [0]*(N+2)
for i in range(1,N+1):
    if S[i-1] == 'E':
        E[i] = E[i-1] + 1
        W[i] = W[i-1]
    else:
        W[i] = W[i-1] + 1
        E[i] = E[i-1]
#print(E)
#print(W)
ans = N
for l in range(1,N+2):
    num = E[N]-E[l+1]
    num += W[l-1]-W[0]
    if ans >= num:
        ans = num

print(ans)

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

E = [0]*(N+2)
W = [0]*(N+2)
for i in range(1,N+1):
    if S[i-1] == 'E':
        E[i] = E[i-1] + 1
        W[i] = W[i-1]
    else:
        W[i] = W[i-1] + 1
        E[i] = E[i-1]

ans = 300000
for L in range(1,N+1):
    num = E[N] - E[L] + W[L-1] -W[0]
    if ans > num:
        ans = num

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

E = [0]*N
W = [0]*N
for i in range(N):
    if S[i] == 'E':
        E[i] = 1
    else:
        W[i] = 1
    
ans = N
for l in range(N):
    num = sum(E[l+1:])
    num += sum(W[:l])
    if ans >= num:
        ans = num

print(ans)

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

E = [0]*(N+2)
W = [0]*(N+2)
for i in range(1,N+1):
    if S[i-1] == 'E':
        E[i] = E[i-1] + 1
        W[i] = W[i-1]
    else:
        W[i] = W[i-1] + 1
        E[i] = E[i-1]

ans = 300000
for L in range(1,N+1):
    num = E[N] - E[L] + W[L-1] -W[0]
    if ans > num:
        ans = num

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#AGC 013 C - Ants on a Circle
N,L,T = map(int, input().split())
X = [0]*N
W = [0]*N
for n in range(N):
    X[n],W[n] = map(int, input().split())

for t in range(T):
    #print('now is ',t)
    for n in range(N):
        if n == N-1:
            if X[N-1]%L == X[0] and W[N-1] == 1 and W[0] == 2:
                W[N-1] = 2
                W[0] =1
                X[0] +=1
            else:
                X[N-1] += (-1)**(W[N-1]+1)
                X[N-1] %= L
                if X[N-1] == X[0]:
                	W[N-1] = 2
                	W[0] = 1
        else:
            if X[n] == X[n+1]:
                W[n] = 2
                W[n+1] = 1
                X[n] += (-1)**(W[n]+1)
                X[n] %= L
            elif (X[n]+1)%L == X[n+1] and W[n] == 1 and W[n+1] == 2:
                W[n] = 2
                W[n+1] =1
                X[n+1] -=1
            else:
                X[n] += (-1)**(W[n]+1)
                X[n] %= L
    #for n in range(N):
        #print(X[n],' ',W[n])
for n in range(N):
    print(X[n])

Fixed submission:
N,L,T = map(int, input().split())
X = [0]*N
W = [0]*N
for n in range(N):
    X[n],W[n] = map(int, input().split())
index = 0
#after T
for n in range(N):
    X[n] += ((-1)**(W[n]+1))*T
    index += X[n]//L
    X[n] %= L
index %= N
X.sort()
X = X[index:] + X[:index] #No.1 wo hajimeni mottekuru.
for n in range(N):
    print(X[n])
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int, input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z == S:
                ans += 1
print(ans)

Fixed submission:
K,S = map(int, input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        if S-x-y <= K and S-x-y >= 0:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import os
import datetime

def main():
    a, b = map(int, input().split())
    val = list(map(lambda x: int(x), input().split()))

    result_dict = []

    for i in range(len(val)):
        for j in range(i+1, len(val)):
            result_dict.append(val[i] * val[j])

    min_list = sorted(result_dict)
    print(min_list[b-1])

if __name__ == '__main__':
    main()

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

import os
import datetime

def main():
    # スペース区切りの整数の入力
    a, b, c = map(int, input().split())
    int_dict = {}
    int_dict[a] = ""
    int_dict[b] = ""
    int_dict[c] = ""

    if len(int_dict) == 2:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n):
  s = input()
  if s not in d:d[s] = 0
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]
a1 = filter(lambda tp:tp[1] == max_cnt, d.items())
a2 = map(lambda tp:tp[0], a1)
for s in sorted(a2):
  print(s)


Fixed submission:
a,b,c = [int(x) for x in input().split()]

if (a==b and c!= a) or (a==c and a!=b) or (b == c and a!=b):print('Yes')
else:print('No')

Buggy python submission (verdict: Runtime Error):
n, k = [int(x) for x in input().split()]
nums = [int(x) for x in input().split()]
nums.sort()
if 0 in nums:
  index = nums.index(0)
  if index == 0:
    print(nums[1] * nums[k]
    break
  if index == n-1:
    print(nums[-2] * nums[-k - 1]
  else:
      num_neg = index
      num_pos = n - index
      if k < num_neg * num_pos:
          s = k // num_pos
          f = k % num_pos
          if f == 0:
              print(nums[-s] * nums[index+1])
          else:
              print(nums[-s-1] * nums[-f-1])
      else:
          new_list = nums[index:] + [-x for x in nums[:inedex]]
          new_list.sort()
          print(new_list[1] * new_list[k]
else:
    l, h = 0, n - 1
    while l < h:
        m = (l+h) // 2
        if nums[m] >= 0:
            h = m
        else:
            l = m + 1
        index = l
    num_neg = index
    num_pos = n - index
    if k < num_neg * num_pos:
        s = k // num_pos
        f = k % num_pos
        if f == 0:
            print(nums[-s] * nums[index+1])
        else:
            print(nums[-s-1] * nums[-f-1])
    else:
        new_list = nums[index:] + [-x for x in nums[:inedex]]
        new_list.sort()
        print(new_list[0] * new_list[k-1]

Fixed submission:
a,b,c = [int(x) for x in input().split()]

if (a==b and c!= a) or (a==c and a!=b) or (b == c and a!=b):print('Yes')
else:print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = {}
for i range(n):
  s = input()
  if s not in d:d[s] = 0
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]
a1 = filter(lambda tp:tp[1] == max_cnt, d.items())
a2 = map(lambda tp:tp[0], a1)
for s in sorted(a2):
  print(s)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
  s = input()
  if s not in d:d[s] = 1
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda x:x[1])[-1][1]
s = [x for x, y in d.items() if y == max_cnt]
s.sort()
for name in s:
    print(name)
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())
l = 0
for i in range(len(s)):
  if S[i] == T[i]:
    l += 1
print(l)

Fixed submission:
S = list(input())
T = list(input())
l = 0
for i in range(len(S)):
  if S[i] == T[i]:
    l += 1
print(l)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    return(False)
  else:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])

for i in range(M - 1):
  L,R = map(int, input().split())
  if find_key(L1,R1,L,R) != False:
    L1,R1 = find_key(L1,R1,L,R)
  else:
    flag = 1
    print(0)
    break
if flag = 0:
  print(R1-L1+1)

Fixed submission:
A,B = map(int,input().split())
print(B if A >= 13 else 0 if A  <= 5 else B//2)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    print(0)
    flag = 1
    break
  else:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])

for i in range(M - 1):
  L,R = map(int, input().split())
  L1,R1 = find_key(L1,R1,L,R)
if flag == 1:
  print(L1,R1)

Fixed submission:
A,B = map(int,input().split())
print(B if A >= 13 else 0 if A  <= 5 else B//2)

Buggy python submission (verdict: Runtime Error):
year,original = input().split()
if int(year) >= 13:
  print(int(original)
elif 6<=int(year)<=12:
  print(int(original)/2)
else:
  print(0)

Fixed submission:
A,B = map(int,input().split())
print(B if A >= 13 else 0 if A  <= 5 else B//2)

Buggy python submission (verdict: Runtime Error):
year = input()
original = input()
if int(year) >= 13:
  print(int(original)
elif 6<=int(year)<=12:
  print(int(original)/2)
else:
  print(0)


Fixed submission:
A,B = map(int,input().split())
print(B if A >= 13 else 0 if A  <= 5 else B//2)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    return(False)
  else:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])

for i in range(M - 1):
  L,R = map(int, input().split())
  if find_key(L1,R1,L,R) != False:
    L1,R1 = find_key(L1,R1,L,R)
  else:
    flag = 1
    print(0)
    break
if flag = 0:
  print(R1-L1+1)

Fixed submission:
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
    if R1 < L2 or R2 < L1:
        return(False)
    else:
        a = [R1,L1,R2,L2]
        a.sort()
        return(a[1],a[2])

for i in range(M - 1):
    L,R = map(int, input().split())
    if find_key(L1,R1,L,R) != False:
        L1,R1 = find_key(L1,R1,L,R)
    else:
        flag = 1
        print(0)
        break
if flag == 0:
    print(R1-L1+1)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    print(0)
    flag = 1
    break
  elif:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])
for i in range(M - 1):
  L,R = map(int, input().split())
  L1,R1 = find_key(L1,R1,L,R)
if flag == 1:
  print(L1,R1)

Fixed submission:
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
    if R1 < L2 or R2 < L1:
        return(False)
    else:
        a = [R1,L1,R2,L2]
        a.sort()
        return(a[1],a[2])

for i in range(M - 1):
    L,R = map(int, input().split())
    if find_key(L1,R1,L,R) != False:
        L1,R1 = find_key(L1,R1,L,R)
    else:
        flag = 1
        print(0)
        break
if flag == 0:
    print(R1-L1+1)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
L, R = map(int, input().split())
pool = set(range(L, R+1))
for i in range(M-1):
  L, R = map(int, input().split())
  pool = set(range(L, R+1)).intersection(pool)
print(len(pool))

Fixed submission:
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
    if R1 < L2 or R2 < L1:
        return(False)
    else:
        a = [R1,L1,R2,L2]
        a.sort()
        return(a[1],a[2])

for i in range(M - 1):
    L,R = map(int, input().split())
    if find_key(L1,R1,L,R) != False:
        L1,R1 = find_key(L1,R1,L,R)
    else:
        flag = 1
        print(0)
        break
if flag == 0:
    print(R1-L1+1)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if (a==b or a==c) and (b!=c):
    print('Yes')
elif (b==a or b==c) and (a!=c):
    print('Yes')
elif (c==a or c==b) and (a!=b):
    print('Yes')
else:
    print('No')



n = int(input())
flag=0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i%2==0 and i%3!=0 and i%5!=0:
        flag=1 
    else:
        continue
if flag==1:
    print("DENIED")
else:
    print("APPROVED")

Fixed submission:
n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")

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



n = int(input())
flag=0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i%2==0 and i%3!=0 and i%5!=0:
        flag=1 
    else:
        continue
if flag==1:
    print("DENIED")
else:
    print("APPROVED")

Fixed submission:
n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")

Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if (A == B or A == C) and (B != C):
    print('Yes')
elif (B == A or B == C) and (A != C):
    print('Yes')
elif (C == A or C == B) and (A != B):
    print('Yes')
else:
    print('No')

n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")


Fixed submission:
n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")
Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
move = [int(a) for a in map(int, input().split())]

smove = sum(move)
if smove >= H:
    print("Yes")
else:
    print("No")

Fixed submission:
from math import ceil

H, A = map(int, input().split())
print(ceil(H/A))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
a = int(input())
if n-(int)(n/500)*500 <= a:
  print('Yes')
else
  print('No')

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
a = int(input())
if n-(int)(n/500)*500 <= a:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):

li = list(map(int, input().split()))

n=0

for i in range(0,3):
  if li[i+1] - li[i] ==0:
    n++

if n==1:
  print("Yes")
else:
  print("No")



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

n=0

for i in range(0,2):
  if li[i+1] - li[i] ==0:
    n+=1
if li[2] - li[0] ==0:
  n+=1

if n==1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
case = int(input())

A, B, C =[int(x) for x in case.split(' ')]
if (A == B and A != C) or(B == C and A != C) or (A == C and A != C):
    print('Yes')
else:
    print('No')

Fixed submission:

case = input()

A, B, C =[int(x) for x in case.split(' ')]
if (A == B and A != C) or(B == C and A != C) or (A == C and A != B):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
vote = dict()
for i in range(n):
  s = input()
  if s not in vote.keys():
    vote[s] = 0
  else:
    vote[s] += 1
vote.sort()
res = sorted(vote.values(), reverse = True)
for i in res.keys():
  print(i)

Fixed submission:
n = int(input())
vote = dict()
for i in range(n):
  s = input()
  if s not in vote.keys():
    vote[s] = 0
  else:
    vote[s] += 1

res = []
mx = max(vote.values())
for key, value in vote.items():
    if value== mx:
        res.append(key)

res = sorted(res)
for i in res:
  print(i)
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
if A == B != C :
  print('Yes')
elif A != B == C :
  print('Yes')
elif A == C != B :
  print('Yes')
else :
  print('No')


Fixed submission:
i = list(map(int, input().split()))
A = i[0]
B = i[1]
C = i[2]
if A == B != C :
  print('Yes')
elif A != B == C :
  print('Yes')
elif A == C != B :
  print('Yes')
else :
  print('No')