Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N, M, R = map(int, input().split())
r = [a-1 for a in list(map(int, input().split()))]
d = [[float('inf')]*N for _ in range(N)]

for _ in range(M):
    a, b, c = map(int, input().split())
    d[a-1][b-1] = c
    d[b-1][a-1] = c
    
for i in range(N):
    d[i][i] = 0
    
for k in range(N):
    for i in range(N):
        for j in range(N):
            dd = d[i][k] + d[k][j]
            if dd < d[i][j]:
                d[i][j] = dd

ans = float("inf")

for perm in itertools.permutations(r):
    a = 0
    for i in range(len(perm)-1):
        a += d[perm[i]][perm[i+1]]
    ans = min(a, ans)
    
print(ans)

Fixed submission:
import itertools

def main() :
    N, M, R = map(int, input().split())
    r = [a-1 for a in list(map(int, input().split()))]
    d = [[float('inf')]*N for _ in range(N)]

    for _ in range(M):
        a, b, c = map(int, input().split())
        d[a-1][b-1] = c
        d[b-1][a-1] = c

    for i in range(N):
        d[i][i] = 0

    for k in range(N):
        for i in range(N):
            for j in range(N):
                dd = d[i][k] + d[k][j]
                if dd < d[i][j]:
                    d[i][j] = dd

    ans = float("inf")

    for perm in itertools.permutations(r):
        a = 0
        for i in range(len(perm)-1):
            a += d[perm[i]][perm[i+1]]
        ans = min(a, ans)

    print(ans)
    
main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))

ans = 0

i = 0

while i < len(P):
    if i+1 == P[i]:
        if i+2 == P[i+1]:
            ans += 1
            i += 1
        else:
            ans += 1
    i += 1
    
print(ans)

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

ans = 0

i = 0

while i < len(P):
    if i+1 == P[i]:
        if i+1 != len(P):
            if i+2 == P[i+1]:
                ans += 1
                i += 1
            else:
                ans += 1
        else:
            ans += 1
    i += 1
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

def gcd(a, b):
    if(b > a):
        a, b = b, a

    while(a != b):
        temp = b
        b = a - b
        a = temp
    return a

if max(T) > 5*10**17:
    print(max(T))
else:
    tmp = T[0]
    for i in range(1, N):
        tmp = tmp/gcd(tmp, T[i])*T[i]

    print(int(tmp))

Fixed submission:
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
    
T = sorted(T)

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

if max(T) > 5*10**17:
    print(max(T))
    
else:
    tmp = max(T)
    for i in range(N):
        if tmp % T[i] != 0:
            tmp = T[i]//gcd(tmp, T[i])*tmp

    print(int(tmp))
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

a = [1, 1]

for i in range(K):
    min_ind = a.index(min(a))
    a[min_ind] += 2
    a[1-min_ind] -= 1

print(2)
print(*a)

Fixed submission:
K = int(input())

a = [49 for i in range(50)]

for i in range(50):
    a[i] += K//50
    
for i in range(50):
    mod = K % 50
#     if mod != 0:
    if mod >= i+1:
        a[i] = a[i] + 50 - (mod)
    else:
        a[i] = a[i] - (mod)

print(50)
print(*a)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split(" ")))

sum_a =  sum(a)

minv = abs(2*sum(a[:1]) - sum_a)

for i in range(1, N-1):
    tmp = abs(2*sum(a[:i+1]) - sum_a)
#     print(tmp)
    
    if minv > tmp:
        minv = tmp
        
print(minv)

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

su = sum(a)
diff = 1e10
cc = 0

for i in range(len(a)-1):
    cc += a[i]
    diff = min(diff, abs(su-2*cc))
print(diff)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split(" ")))

ans = 99999999999999999

for i in range(len(a)-1):
    tmp = abs(sum(a[:i+1]) - sum(a[i+1:]))
    if tmp < ans:
        ans = tmp

print(ans)

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

su = sum(a)
diff = 1e10
cc = 0

for i in range(len(a)-1):
    cc += a[i]
    diff = min(diff, abs(su-2*cc))
print(diff)

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

a = list(map(int, input().split(" ")))

min_a = 999999999999999
for i in range(1, len(a)):
    cal = abs(sum(a[:i]) - sum(a[i:]))
    if cal < min_a:
        min_a = cal
print(min_a)

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

su = sum(a)
diff = 1e10
cc = 0

for i in range(len(a)-1):
    cc += a[i]
    diff = min(diff, abs(su-2*cc))
print(diff)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B, C, D = list(map(int, input().split(" ")))

memo_dic = {}

def OK_area(n, c, d):
    l = []
    for i in range(c, d+1):
        l.append(n-i)
        l.append(n+i)
    l_uniq = list(set(l))
    return l_uniq

a = min(A, B)
b = max(A, B)
start = [a]
for i in range(N-1):
    list_i = []
    for s in start:
        if s in memo_dic:
            area = memo_dic[s]
        else:
            area = OK_area(s, C, D)
            memo_dic[s] = area
        list_i.extend(area)
        
    list_i_uniq = list(set(list_i))
    start = list_i_uniq
if b in start:
    print("YES")
else:
    print("NO")

Fixed submission:
N, A, B, C, D = list(map(int, input().split(" ")))

answer_flag = False
for i in range(N):
    if (C*(N-1-i)-D*i<=(B-A)) and ((B-A)<=-C*i+D*(N-1-i)):
        answer_flag = True
        break

if answer_flag==True:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split(" ")))

b = []

for i, a in enumerate(A):
    if i % 2 == 0:
        b = b + [a]
    else:
        b = [a] + b
        
if n % 2 == 1:
    b = b[::-1]
print(*b)

Fixed submission:
n = int(input())
A = list(map(int, input().split(" ")))
      
if n % 2 == 0:
    print(*(A[1::2][::-1]+A[0::2]))
else:
    print(*(A[0::2][::-1]+A[1::2]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split(" ")))

b = []

for a in A:
    b.append(a)
    b = b[::-1]
print(*b)

Fixed submission:
n = int(input())
A = list(map(int, input().split(" ")))
      
if n % 2 == 0:
    print(*(A[1::2][::-1]+A[0::2]))
else:
    print(*(A[0::2][::-1]+A[1::2]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split(" ")))

b = []
for i, a_i in enumerate(a):
    if i % 2 == 0:
        b = b + [a_i]
    else:
        b = [a_i] + b
        
if n % 2 == 1:
    b = b[::-1]
        
for b_i in b[:-1]:
    print ("%d "%(b_i), end="")
print("%d"%b[-1])

Fixed submission:
n = int(input())
A = list(map(int, input().split(" ")))
      
if n % 2 == 0:
    print(*(A[1::2][::-1]+A[0::2]))
else:
    print(*(A[0::2][::-1]+A[1::2]))
Buggy python submission (verdict: Runtime Error):
MOD = 1000000007

def fractorial(n):
    ans = 1
    for i in range(n):
        ans *= (i+1)
        ans = ans % MOD    
    return ans


N, M = list(map(int, input().split(" ")))

if abs(N - M) > 1:
    print("%d"%(0))
elif (N - M) == 0:
    print ("%d"%(2*((factorial(N))*(factorial(M)))%MOD))
else :
    print ("%d"%(((factorial(N))*(factorial(M)))%MOD))

Fixed submission:
MOD = 1000000007

dp=[0 for _ in range(100001)]
dp[0]=1

for i in range(1, 100001):
    dp[i] = dp[i-1]*i%MOD


N, M = list(map(int, input().split(" ")))

if abs(N - M) > 1:
    print("%d"%(0))
elif (N - M) == 0:
    print ("%d"%(2*((dp[N])*(dp[M]))%MOD))
else :
    print ("%d"%(((dp[N])*(dp[M]))%MOD))

Buggy python submission (verdict: Runtime Error):
MOD = 1e+9+7

def fractorial(n):
    ans = 1
    for i in range(n):
        ans *= (i+1)
        ans = ans % MOD    
    return ans


N, M = list(map(int, input().split(" ")))

if abs(N - M) > 1:
    print("%d"%(0))
elif (N - M) == 0:
    print ("%d"%(2*((factorial(N))*(factorial(M)))%MOD))
else :
    print ("%d"%(((factorial(N))*(factorial(M)))%MOD))

Fixed submission:
MOD = 1000000007

dp=[0 for _ in range(100001)]
dp[0]=1

for i in range(1, 100001):
    dp[i] = dp[i-1]*i%MOD


N, M = list(map(int, input().split(" ")))

if abs(N - M) > 1:
    print("%d"%(0))
elif (N - M) == 0:
    print ("%d"%(2*((dp[N])*(dp[M]))%MOD))
else :
    print ("%d"%(((dp[N])*(dp[M]))%MOD))
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = list(map(int, input().split(" ")))
h = []
for _ in range(N):
    h.append(int(input()))
    
def argmax(l):
    return l.index(max(l))

ans = 0
while True:
    if max(h) <= 0:
        break
    max_idx = argmax(h)
    minus = [B for _ in range(N)]
    minus[max_idx] = A
    h = [x - y for x, y in zip(h, minus)]
    ans += 1

print (ans)

Fixed submission:
from math import ceil

N, A, B = map(int, input().split())
H = []
for _ in range(N):
    H.append(int(input()))
    
left = 0
right = max(H)//B + 1

while right - left > 1:
    mid = (right + left) // 2
    c = sum([ceil((h-B*mid)/(A-B)) for h in H if h > B*mid])
    
    if c > mid:
        left = mid
    else:
        right = mid
print(right)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split(" ")))


maxv = -float("inf")
for i in range(N, 2*N+1):
    tmp = sum(sorted(a[:i], reverse=True)[:N]) - sum(sorted(a[i:])[:N])
    if tmp > maxv:
        maxv = tmp
print(maxv)

Fixed submission:
import heapq

N = int(input())
a = list(map(int, input().split(" ")))

q = a[:N]
heapq.heapify(q)
x = [sum(q)]

for k in range(N, 2*N):
    ## in : a[k], out : v
    out = heapq.heappushpop(q, a[k])
    x.append(x[-1]+a[k]-out)
    
a = a[::-1]    
q = [-v for v in a[:N]]
heapq.heapify(q)
y = [-sum(q)]
for k in range(N, 2*N):
    out = -heapq.heappushpop(q, -a[k])
    y.append(y[-1]+a[k]-out)
    
print(max(v-w for v,w in zip(x, y[::-1])))
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split(" ")))

d = dict()

for i in range(N):
    a, b = list(map(int, input().split(" ")))
    if a in d:
        d[a] = d[a] + b
    else:
        d[a] = b
    
ans_sum = 0

for key in sorted(d.keys()):
    ans_sum += d[key]
    if (ans_sum) >= K:
        print(k)
        break

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

nums = {}

for _ in range(N):
    a, b = list(map(int, input().split(" ")))
    
    if a in nums:
        nums[a] += b
    else :
        nums[a] = b
        
acc = 0
for key in sorted(nums.keys()):
    acc += nums[key]
    if acc >= K:
        print(key)
        break
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split(" ")))

graph = [list() for i in range(N+1)]

for i in range(M):
    a, b = list(map(int, input().split(" ")))
    graph[a].append(b)
    graph[b].append(a)
    
def DFS(node, prev, visited):
    visited.append(node)
    if len(visited) == N:
        return 1
    
    res = 0
    for edge in graph[node]:
        if edge == prev:
            continue
        elif edge in visited:
            continue
        res += dfs(edge, node, visited)
        
    return res

print(DFS(1, 0, []))

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

graph = [list() for i in range(N+1)]

for i in range(M):
    a, b = list(map(int, input().split(" ")))
    graph[a].append(b)
    graph[b].append(a)
    
def DFS(node, prev, visited):
    visited.append(node)
    if len(visited) == N:
        return 1
    
    res = 0
    for edge in graph[node]:
        if edge == prev:
            continue
        elif edge in visited:
            continue
        res += DFS(edge, prev, visited[:])
        
    return res

print(DFS(1, 0, []))

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

graph = [list() for i in range(N+1)]

for i in range(M):
    a, b = list(map(int, input().split(" ")))
    graph[a].append(b)
    graph[b].append(a)
    
def DFS(node, prev, visited):
    visited.append(node)
    if len(visited) == N:
        return 1
    
    res = 0
    for edge in graph[node]:
        if edge == prev:
            continue
        elif edge in visited:
            continue
        res += dfs(edge, node, visited)
        
    return res

print(DFS(1, 0, []))

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

graph = [list() for i in range(N+1)]

for i in range(M):
    a, b = list(map(int, input().split(" ")))
    graph[a].append(b)
    graph[b].append(a)
    
def DFS(node, prev, visited):
    visited.append(node)
    if len(visited) == N:
        return 1
    
    res = 0
    for edge in graph[node]:
        if edge == prev:
            continue
        elif edge in visited:
            continue
        res += DFS(edge, prev, visited[:])
        
    return res

print(DFS(1, 0, []))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split(" ")))

ref = [a.count(i)-1 for i in list(set(a)) if a.count(i)!=1]

ans = N - ((sum(ref)+1)//2)*2

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
a = list(map(int, input().split(" ")))
c = Counter(a)

ref = [v-1 for k, v in c.items() if v != 1]

ans = N - ((sum(ref)+1)//2)*2

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()

a = -1
b = -1

for i in range(N-2):
    if s[i]==s[i+1]:
        a = i+1
        b = i+2
        break
    elif s[i]==s[i+2]:
        a = i+1
        b = i+3
        break
        
print(str(a)+" "+str(b))

Fixed submission:
s = input()

a = -1
b = -1

for i in range(len(s)-2):
    if s[i]==s[i+1]:
        a = i+1
        b = i+2
        break
    elif s[i]==s[i+2]:
        a = i+1
        b = i+3
        break
if s[-2]==s[-1]:
    a = len(s)-1
    b = len(s)
        
print(str(a)+" "+str(b))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split()) ###n:モンスターの数，k:必殺技の回数
h=list(map(int,input().split())) ###h:モンスターの体力
if k>0:
    for i in range(k):
        if n<=k:
            h.clear()
        else:
            a=max(h)
            h.remove(a)
print(sum(h))

Fixed submission:
n, k = map(int, input().split()) ###n:モンスターの数，k:必殺技の回数
h=sorted(list(map(int,input().split()))) ###h:モンスターの体力

if n<=k:
    print(0)
elif k==0:
    b=sum(h)
    print(b)
else:
    a=sum(h[:-k])
    print(a)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
#2<=N<10**12
a=1
b=1
count=[]
##N=a*b
#output=a+b-2
#積なので対称性よりa<=bとしてオッケー
for i in range(1,N+1):
    if N%i==0:
        a=i
        b=N/i
        if a<=b:
            count.append(int(a+b-2))
print(min(count))


Fixed submission:
N = int(input())
#2<=N<10**12

num=int(N**(1/2)+1)
count=N+1-2
##N=a*b
#output=a+b-2
#積なので対称性よりa<=bとしてオッケー
for i in range(1,num):
    if N%i==0:
       count=min(count,i+N//i -2)
print(count)
Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
a = H * (W - x)
b = H * W - H * (W - x)
c = W * (H - y)
d = H * W - W * (H - y)

if W == H:
    if y == x or y == -x + H:
        e = 1
    else:
        e = 0
else:
    if x == W * (1 / 2) and y == H * (1 / 2):
        e = 1
    else:
        e = 0

else:
e = 0

if a <= b:
    if c <= d:
        if a <= c:
            print(c, e)
        else:
            print(a, e)
    else:
        if a <= d:
            print(d, e)
        else:
            print(a, e)
else:
    if c <= d:
        if b <= c:
            print(c, e)
        else:
            print(b, e)
    else:
        if b <= d:
            print(d, e)
        else:
            print(b, e)


Fixed submission:
W, H, x, y = map(int, input().split())

if x == W * (1 / 2) and y == H * (1 / 2):
   e=1
else:
    e=0

print((W*H)*(1/2),e)
Buggy python submission (verdict: Runtime Error):
a, b, k = (int(i) for i in input().split())
ok_list = []
for i in range(1,max(a, b)):
    if a % i == b % i == 0:
       ok_list.append(i)
print(ok_list[k-1])

Fixed submission:
A,B,K = map(int,input().split())
 
cnt = 0
ans = []
 
for i in range(1,101):
    if A%i == 0 and B%i == 0:
        ans.append(i)
 
print(ans[-K])

Buggy python submission (verdict: Runtime Error):
a, b, k = (int(i) for i in input().split())
ok_list = []
for i in range(1,max(a, b)):
    if a % i == b % i == 0:
       ok_list.append(i)
print(ok_list[k])

Fixed submission:
A,B,K = map(int,input().split())
 
cnt = 0
ans = []
 
for i in range(1,101):
    if A%i == 0 and B%i == 0:
        ans.append(i)
 
print(ans[-K])
Buggy python submission (verdict: Runtime Error):
#制限時間以内でコストの最小のものを選ぶ
n,t=map(int,input().split())
v=[list(map(int,list(input().split()))) for i in range(n)]
list=[]
for i in range(n):
    if v[i][1] <= t:
        list.append(v[i][0])
if list==0:
    print("TLE")
else:
    print(min(list))


Fixed submission:
# 制限時間以内でコストの最小のものを選ぶ
n, t = map(int, input().split())
v = [list(map(int, list(input().split()))) for i in range(n)]
list = []
for i in range(n):
    if v[i][1] <= t:
        list.append(v[i][0])
if list == []:
    print("TLE")
else:
    print(min(list))
Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split())
print(x2+(y1-y2),y2+(x2-x1),x1+(y1-y2),y1+(x2-x1))

Fixed submission:
n = int(input())
list_w = [input() for i in range(n)]
list_ok = [list_w[0]]

if len(list_w) != len(set(list_w)):
    print("No")

else:
    for i in range(1, n):
        if list_w[i - 1][-1] == list_w[i][0]:
            list_ok.append(list_w[i])
            i += 1
    if len(list_ok) == len(list_w):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
from math import gcd
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
MOD = 1000000007
 
LCM = A[0]
for i in range(1, N):
    LCM *= A[i] // gcd(LCM, A[i])
    
for a in A:
  ans += LCM // a
  
print(ans%MOD)


Fixed submission:
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
MOD = 1000000007
 
LCM = A[0]
for i in range(1, N):
    LCM *= A[i] // gcd(LCM, A[i])
    
for a in A:
  ans += LCM // a
  
print(ans%MOD)
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    return gcd(b, a %b)

def gcdlist(l):
    if len(l) == 2:
        return gcd(l[0], l[1])
    f = l.pop()
    s = l.pop()
    m = gcd(f, s)
    l.append(m)
    return gcdlist(l)


def main():
    n, x = map(int, input().split())
    a = [int(v) for v in input().split(' ')]
    a.append(x)
    a.sort()
    dis = [x2 - x1 for x1, x2 in zip(a, a[1:])]
    max_ = 0
    for i in range(n):
        if len(dis) == 1:
            max_ = dis[0]
            break
        max_ = gcdlist(dis)
    print(max_)

if __name__ == '__main__':
    main()


Fixed submission:
def gcd(a,b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    return gcd(b, a %b)

def gcdlist(l):
    if len(l) == 2:
        return gcd(l[0], l[1])
    f = l.pop()
    s = l.pop()
    m = gcd(f, s)
    l.append(m)
    return gcdlist(l)


def main():
    n, x = map(int, input().split())
    a = [int(v) for v in input().split(' ')]
    a.append(x)
    a.sort()
    dis = [x2 - x1 for x1, x2 in zip(a, a[1:])]
    max_ = 0
    for i in range(n):
        if len(dis) == 1:
            max_ = dis[0]
            break
        try:
            max_ = gcdlist(dis)
        except:
            max_ = 1
    print(max_)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import math

def main():
    n, x = map(int, input().split())
    a = [int(v) for v in input().split(' ')]
    a.append(x)
    a.sort()
    dis = [x2 - x1 for x1, x2 in zip(a, a[1:])]
    max_ = 0
    for i in range(n):
        if len(dis) == 1:
            max_ = dis[0]
            break
        try:
            g = max([math.gcd(d1, d2) for d1, d2 in zip(dis[i:], dis[i+1:])])
        except ValueError:
            break
        if g > max_:
            max_ = g
    print(max_)

if __name__ == '__main__':
    main()


Fixed submission:
def gcd(a,b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    return gcd(b, a %b)

def gcdlist(l):
    if len(l) == 2:
        return gcd(l[0], l[1])
    f = l.pop()
    s = l.pop()
    m = gcd(f, s)
    l.append(m)
    return gcdlist(l)


def main():
    n, x = map(int, input().split())
    a = [int(v) for v in input().split(' ')]
    a.append(x)
    a.sort()
    dis = [x2 - x1 for x1, x2 in zip(a, a[1:])]
    max_ = 0
    for i in range(n):
        if len(dis) == 1:
            max_ = dis[0]
            break
        try:
            max_ = gcdlist(dis)
        except:
            max_ = 1
    print(max_)

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

Fixed submission:
A = 0
B = 0
c = 0
A, B, C = map(int, input().split())
if (A == B or A == C or C == B) and (A != B or A != C or B != C):
	print('Yes')
else:
	print("No")

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

Fixed submission:
A = 0
B = 0
c = 0
A, B, C = map(int, input().split())
if (A == B or A == C or C == B) and (A != B or A != C or B != C):
	print('Yes')
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
m = [0]*N
s = input()
m = s.split()
c = 99999999
k = 0
for i in range(N):
	if m[i] > c:
		c = m[i]
		k +=1

print(c)

Fixed submission:
N = int(input())
m = [0]*N
s = input()
m = s.split()
c = 99999999
k = 0
for i in range(N):
	m[i] = int(m[i])
	if m[i] <= c:
		c = m[i]
		k +=1

print(k)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import math


N = int(input())
Xi = list(map(int, input().split()))
Xi.sort()
min = Xi[0]
max = Xi[N-1]
tmp = 0
result = math.inf
for i in range(min,max+1):
    for j in range(0,N):
        tmp += (Xi[j] - i)**2
    if tmp <= result:
        result = tmp
    tmp = 0

print(result)

Fixed submission:
# coding: utf-8
import sys

N = int(input())
Xi = list(map(int, input().split()))
Xi.sort()
min = Xi[0]
max = Xi[N-1]
tmp = 0
result = sys.maxsize
for i in range(min,max+1):
    for j in range(0,N):
        tmp += (Xi[j] - i)**2
    if tmp <= result:
        result = tmp
    tmp = 0

print(result)

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

if __name__=='__main__':
    N = int(input())
    Xi = list(map(int, input().split()))
    Xi.sort()
    min = Xi[0]
    max = Xi[N-1]
    tmp = 0
    result = math.inf
    for i in range(min,max+1):
        for j in range(0,N):
            tmp += (Xi[j] - i)**2
        if tmp <= result:
            result = tmp
        tmp = 0

    print(result)

Fixed submission:
# coding: utf-8
import sys

N = int(input())
Xi = list(map(int, input().split()))
Xi.sort()
min = Xi[0]
max = Xi[N-1]
tmp = 0
result = sys.maxsize
for i in range(min,max+1):
    for j in range(0,N):
        tmp += (Xi[j] - i)**2
    if tmp <= result:
        result = tmp
    tmp = 0

print(result)
Buggy python submission (verdict: Runtime Error):
n,x=[int(i) for i in input().split()]
p=[1]
b=[0]
z=[]
for i in range(n):
  p.append(p[i]*2+1)
  b.append(b[i]*2+2)
  z.append(p[i]+b[i])
ans=0
ici=0
for i in range(n-1, -1, -1):
  if x-ici>z[i]+1:
    ici+=z[i]+2
    ans+=p[i]+1
  elif x-ici<z[i]+1:
    ici+=1
  else:
    ans+=p[i]
    break
print(ans)

Fixed submission:
d=int(input())
ans="Christmas"
for i in range(25-d):
  ans+=" Eve"
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
ans=999
for i in range(s.len()-2):
  ans=min(abs(753-int(s[i:i+2])),ans)
print(ans)

Fixed submission:
s=input()
ans=999
for i in range(len(s)-2):
  ans=min(abs(753-int(s[i:i+3])),ans)
print(ans)