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

sys.setrecursionlimit(100000)
input = lambda : sys.stdin.readline().rstrip()

def pow_mod(x, y, mod):
    tmp = x
    ret = 1
    while y > 0:
        if y % 2 == 1:
            ret = ret * tmp % mod
        tmp = tmp * tmp % mod
        y //= 2
    return ret

def inverse(x, mod):
    return pow_mod(x, mod - 2, mod)

N = int(input())
x = list(map(int, input().split()))

MOD = 1000000007

def factorial(x):
    if x <= 1:
        return 1
    else:
        return x * factorial(x - 1) % MOD

f = factorial(N - 1)

h = [0]
for _ in range(N):
    h.append((h[-1] + f * inverse(len(h), MOD)) % MOD)

ans = 0
for i in range(N - 1):
    ans += h[i + 1] * (x[i + 1] - x[i])
    ans %= MOD

print(ans)

Fixed submission:
import sys

sys.setrecursionlimit(1000000)
input = lambda : sys.stdin.readline().rstrip()

def pow_mod(x, y, mod):
    tmp = x
    ret = 1
    while y > 0:
        if y % 2 == 1:
            ret = ret * tmp % mod
        tmp = tmp * tmp % mod
        y //= 2
    return ret

def inverse(x, mod):
    return pow_mod(x, mod - 2, mod)

N = int(input())
x = list(map(int, input().split()))

MOD = 1000000007

def factorial(x):
    if x <= 1:
        return 1
    else:
        return x * factorial(x - 1) % MOD

f = factorial(N - 1)

h = [0]
for _ in range(N):
    h.append((h[-1] + f * inverse(len(h), MOD)) % MOD)

ans = 0
for i in range(N - 1):
    ans += h[i + 1] * (x[i + 1] - x[i])
    ans %= MOD

print(ans)

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

input = lambda : sys.stdin.readline().rstrip()

def pow_mod(x, y, mod):
    tmp = x
    ret = 1
    while y > 0:
        if y % 2 == 1:
            ret = ret * tmp % mod
        tmp = tmp * tmp % mod
        y //= 2
    return ret

def inverse(x, mod):
    return pow_mod(x, mod - 2, mod)

N = int(input())
x = list(map(int, input().split()))

MOD = 1000000007

def factorial(x):
    if x <= 1:
        return 1
    else:
        return x * factorial(x - 1) % MOD

f = factorial(N - 1)

h = [0]
for _ in range(N):
    h.append((h[-1] + f * inverse(len(h), MOD)) % MOD)

ans = 0
for i in range(N - 1):
    ans += h[i + 1] * (x[i + 1] - x[i])
    ans %= MOD

print(ans)

Fixed submission:
import sys

sys.setrecursionlimit(1000000)
input = lambda : sys.stdin.readline().rstrip()

def pow_mod(x, y, mod):
    tmp = x
    ret = 1
    while y > 0:
        if y % 2 == 1:
            ret = ret * tmp % mod
        tmp = tmp * tmp % mod
        y //= 2
    return ret

def inverse(x, mod):
    return pow_mod(x, mod - 2, mod)

N = int(input())
x = list(map(int, input().split()))

MOD = 1000000007

def factorial(x):
    if x <= 1:
        return 1
    else:
        return x * factorial(x - 1) % MOD

f = factorial(N - 1)

h = [0]
for _ in range(N):
    h.append((h[-1] + f * inverse(len(h), MOD)) % MOD)

ans = 0
for i in range(N - 1):
    ans += h[i + 1] * (x[i + 1] - x[i])
    ans %= MOD

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math

sys.setrecursionlimit(1000000)
input = lambda: sys.stdin.readline().rstrip()

N, M = map(int, input().split())
a = list(map(lambda x : int(x) // 2, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // math.gcd(lcm, i)
ok = True
for i in a:
    if lcm // i % 2 == 0:
        ok = False

if not ok:
    print(0)
else:
    print((M // lcm - 1) // 2 + 1)

Fixed submission:
import sys
import math

def gcd(x, y):
    if x < y:
        return gcd(y, x)
    if y == 0:
        return x
    return gcd(y, x % y)

sys.setrecursionlimit(1000000)
input = lambda: sys.stdin.readline().rstrip()

N, M = map(int, input().split())
a = list(map(lambda x : int(x) // 2, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ok = True
for i in a:
    if lcm // i % 2 == 0:
        ok = False

if not ok:
    print(0)
else:
    print((M // lcm - 1) // 2 + 1)
Buggy python submission (verdict: Runtime Error):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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


Fixed submission:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

A, B, C, D = map(int, input().split())
ans = B // C + B // D - B // (C * D // gcd(C, D))
ans -= (A - 1) // C + (A - 1) // D - (A - 1) // (C * D // gcd(C, D))
print(B - A + 1 - ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

def main():
    N = int(input())
    h = list(map(int, input().split()))
    ans = 0
    while sum(h) > 0:
        for i in range(N):
            for j in reversed(range(1, N - i + 1)):
                if min(h[i:i + j]) > 0:
                    for k in range(i, i + j):
                        h[k] -= 1
                    ans += 1
                    break
            else:
                continue
            break
    print(ans)

main()


Fixed submission:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

def f(arr):
    m = min(arr)
    for i in range(len(arr)):
        arr[i] -= m
    buf = []
    ret = m
    for i in arr:
        if i == 0:
            if len(buf) > 0:
                ret += f(buf)
                buf = []
        else:
            buf.append(i)
    if len(buf) > 0:
        ret += f(buf)
    return ret

def main():
    N = int(input())
    h = list(map(int, input().split()))
    print(f(h))

main()
Buggy python submission (verdict: Runtime Error):
print('Yes' if len(W) == len(set(W)) and all(i[-1] == j[0] for i, j in zip(W, W[1:])) else 'No')

Fixed submission:
N = int(input())
W = [input() for _ in range(N)]
print('Yes' if len(W) == len(set(W)) and all(i[-1] == j[0] for i, j in zip(W, W[1:])) else 'No')
Buggy python submission (verdict: Runtime Error):
import math
#minH=6deg/min
#HrH=30deg/hr=0.5degree/min
##angle by minH=6*M
##angle by HrH=30*H
##angle=abs(minH-HrH)
A,B,H,M=map(int,input().strip().split())
minH=6*M
HrH=0.5*(H*60+M)
Ang=abs(HrH-minH)
Ans=math.sqrt(A**2+B**2-2*A*B*math.cos((2*math.pi/180)*Ang))
Ans=str(Ans)
if "." in Ans:
  intg=Ans.split(".")[0]
  decimal=Ans.split(".")[1]
  if len(decimal)<9:
    	print(intg+"."+decimal+"0"*(9-len(decimal))
  else:
        print(intg+"."+decimal[:9])
else:
  print(Ans+"."+"0"*9)



Fixed submission:
import math
#minH=6deg/min
#HrH=30deg/hr=0.5degree/min
    ##angle by minH=6*M
    ##angle by HrH=30*H
    ##angle=abs(minH-HrH)
A,B,H,M=map(int,input().strip().split())
minH=6*M
HrH=0.5*(H*60+M)
Ang=abs(HrH-minH)
#print(math.cos((math.pi/180)*Ang))
Ans=math.sqrt(A**2+B**2-2*A*B*math.cos((math.pi/180)*Ang))
Ans=str(Ans)
if "." in Ans:
    intg=Ans.split(".")[0]
    decimal=Ans.split(".")[1]
    if len(decimal)<9:
      print(intg+"."+decimal+"0"*(9-len(decimal)))
    else:
      print(intg+"."+decimal[:9])
else:
   print(Ans+"."+"0"*9)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
N,M=map(int,input().strip().split())
G=defaultdict(list)
for i in range(M):
  u,v=map(int,input().strip().split())
  G[u].append(v)
  G[v].append(V)
dist=[(-1,parent)]*(N+1)
valid=False
Q=[1]
visited=[False]*(N+1)
while(len(Q)!=0):
  top=Q[0]
  Q.pop(0)
  for u in G[top]:
    if not visited[u]:
      Q.append(u)
      dist[u][0]=1+dist[top][0]
      dist[u][1]=top
      visited[u]=True
for pair in dist[1:]:
  if pair[0]==-1:
    valid=True
    print("No")
    return 
if not valid:
  print("Yes")
  for pair in dist[1:]:
    print(pair[1])




Fixed submission:

from collections import defaultdict
N,M=map(int,input().strip().split())
G=defaultdict(list)
for i in range(M):
  u,v=map(int,input().strip().split())
  G[u].append(v)
  G[v].append(u)
dist=[]
for i in range(N+1):
    dist.append([0,-1])
valid=False
Q=[1]
visited=[False]*(N+1)
visited[1]=True
while(len(Q)!=0):
  top=Q[0]
  Q.pop(0)
  for u in G[top]:
    if not visited[u]:
      Q.append(u)
      dist[u][0]=1+dist[top][0]
      dist[u][1]=top
      visited[u]=True
for pair in dist[2:]:
  if pair[0]==-1:
    valid=True
    print("No")
if not valid:
  print("Yes")
  for pair in dist[2:]:
    print(pair[1])
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
if S == T[:len(T)-1]:
  print("Yes")
 else:
  print("No")

Fixed submission:
S=input()
T=input()
if S == T[:len(T)-1]:
      print("Yes")
else:
      print("No")
Buggy python submission (verdict: Runtime Error):
A,B,C,K=map(int,input().strip().split())
K=K-A
if K>0:
  Sum=A
  K=K-B
  if K>0:
    if K>C:
      print(Sum-C)
   	else:
      print(Sum-K)
  else:
     print(Sum)
else:
      print(K)

Fixed submission:
A,B,C,K=map(int,input().strip().split())
if K-A>0:
  K=K-A
  Sum=A
  K=K-B
  if K>0:
    if K>C:
      print(Sum-C)
    else:
      print(Sum-K)
    #if K>C:
  else:
    print(Sum)
else:
	print(K)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

n = stdin.readline().rstrip().split()
a = stdin.readline().rstrip().split()

total = 1
for i in a:
    total = total*int(i)
	if(total > 1000000000000000000):
      total = -1
      break
    
print(total)

Fixed submission:
from sys import stdin
import sys

n = stdin.readline().rstrip().split()
a = stdin.readline().rstrip().split()

if '0' in a:
    print(0)
    sys.exit()

total = 1
for i in a:
    total = total*int(i)

    if(total > 1000000000000000000):
        print(-1)
        sys.exit()

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n = stdin.readline().rstrip()
a = stdin.readline().rstrip().split()

total = 1
for i in a:
    total = total*int(i)

if(total > 1000000000000000000): total = -1
print(total)

Fixed submission:
from sys import stdin
import sys

n = stdin.readline().rstrip().split()
a = stdin.readline().rstrip().split()

if '0' in a:
    print(0)
    sys.exit()

total = 1
for i in a:
    total = total*int(i)

    if(total > 1000000000000000000):
        print(-1)
        sys.exit()

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n = stdin.readline().rstrip().split()
a = stdin.readline().rstrip().split()

total = 1
for i in a:
    total = total*int(i)

if(total > 1000000000000000000): total = -1
print(total)

Fixed submission:
from sys import stdin
import sys

n = stdin.readline().rstrip().split()
a = stdin.readline().rstrip().split()

if '0' in a:
    print(0)
    sys.exit()

total = 1
for i in a:
    total = total*int(i)

    if(total > 1000000000000000000):
        print(-1)
        sys.exit()

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
a.sort()
# print(a)

result = 1
for x in a:
    result *= int(x)
    if result == 0:
        break

if result > 10 ** 18:
    print(-1)
else:
    print(result)

Fixed submission:
n = int(input())
a = input().split()
a.sort()
# print(a)

max_x = 10 ** 18

result = 1
for x in a:
    result *= int(x)
    if result == 0 or result > max_x:
        break

if result > max_x:
    print(-1)
else:
    print(result)

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

result = 1
for x in a:
    result *= int(x)

if result > 10 ** 18:
    print(-1)
else:
    print(result)

Fixed submission:
n = int(input())
a = input().split()
a.sort()
# print(a)

max_x = 10 ** 18

result = 1
for x in a:
    result *= int(x)
    if result == 0 or result > max_x:
        break

if result > max_x:
    print(-1)
else:
    print(result)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input.split())
print(int(a * b))


Fixed submission:
sa, sb = input().split()
a = int(sa)
b = int(sb.replace('.', ''))
print(a * b // 100)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

nums = list(map(int,input().split(" ")))
s = 1
for num in nums:
    s = s * num
if s > 10**18:
    print(-1)
else:
    print(s)
    


Fixed submission:
N = int(input())

nums = list(map(int,input().split(" ")))
s = 1
limit = 10**18
flag = False
for num in nums:
    s = s * num
    if s > limit:
        flag = True
        break

if flag:
    if 0 not in nums:
        print(-1)
    else:
        print(0)
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
impor math
A,B = map(float,input().split(" "))
A = int(A)
B = int(B * 100)
print(math.floor((A*B)/100))


Fixed submission:
from decimal import Decimal
A,B = map(Decimal, input().split(" "))

print(int(A*B))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if (a.include(0)):
  print(0)
  exit()
MAX = 10 ** 18
ans = 1
for i in range(len(a)):
  ans *= a[i]
  if (ans > MAX):
    print(-1)
    exit()
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if (0 in a):
  print(0)
  exit()
MAX = 10 ** 18
ans = 1
for i in range(len(a)):
  ans *= a[i]
  if (ans > MAX):
    print(-1)
    exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, intpu().split())
b.replace('.', '')
print(a * b // 100)

Fixed submission:
a, b = input().split()
b = b.replace('.', '')
a, b = map(int, [a, b])
print(a * b // 100)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

if 0 in a:
    print(0)
    return
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
print(ans)


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

if 0 in a:
    print(0)
    exit()
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
print(ans)

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

if 0 in a:
    print(0)
    return
ans = 1
for i in a:
    ans *= i
    if ans >1000000000000000000:
        print(-1)
        return
print(ans)


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

if 0 in a:
    print(0)
    exit()
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
print(ans)

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

if 0 in a:
    print(0)
    return
ans = 1
for i in a:
    ans *= i
    if ans >1000000000000000000:
        print(-1)
        return
    print(ans)


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

if 0 in a:
    print(0)
    exit()
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int,input().split())
hpa = math.ceil(A / D)
hhb = math.ceil(C / B)
if (hpa >= hpb):
    print('Yes')
else:
    print('No')


Fixed submission:
S, W = map(int,input().split())

if (W >= S):
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int,input().split())
hpa = math.ceil(A / D)
hhb = math.ceil(C / B)
if (hpa >= hpb):
    print('Yes')
else:
    print('No')


Fixed submission:
import math
A, B, C, D = map(int,input().split())
hpa = math.ceil(A / D)
hpb = math.ceil(C / B)
if (hpa >= hpb):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int,input().split())
hpa = A
hhb = C
while(1):
    hpb -= B
    if(hpb <= 0):
        print('Yes')
        break
    hpa -= D
    if(hpa <= 0):
        print('No')
        break  


Fixed submission:
import math
A, B, C, D = map(int,input().split())
hpa = math.ceil(A / D)
hpb = math.ceil(C / B)
if (hpa >= hpb):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())

A = list(map(int, input().split()))
         
n = N - np.sum(A)
if(n >= 0):
    print(n)
else:
    print(-1)


Fixed submission:
import numpy as np
N = int(input())

A = list(map(int, input().split()))
         
c = [0 for i in range(N)]

for i in range(N-1):
    c[A[i] - 1] += 1

for i in range(N):
    print(c[i])
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
N, M = map(int, input().split())

a = comb(N, 2, exact=True)
b = comb(M, 2, exact=True)

print(a+b)


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

a = N * (N-1) // 2
b = M * (M-1) // 2
print(a+b)
Buggy python submission (verdict: Runtime Error):
S, T = map(input().split())
A, B = map (int, input().split())
U = input()

if( S==U):
    print(A-1,B)
else:
    print(A,B-1)


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

if( S==U):
    print(A-1,B)
else:
    print(A,B-1)
Buggy python submission (verdict: Runtime Error):
H, A = map(int,input().split())

if(h % A != 0):
    print(H // A + 1)
else:
    print(H // A)


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

if(H % A != 0):
    print(H // A + 1)
else:
    print(H // A)
Buggy python submission (verdict: Runtime Error):
import math
from fractions import gcd
a, b = map(int, input().split())

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

print(lcm(a, b))


Fixed submission:
from fractions import gcd
a, b = map(int, input().split())

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

print(lcm(a, b))

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

a, b = map(int, input().split())

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

print(lcm(a, b))


Fixed submission:
from fractions import gcd
a, b = map(int, input().split())

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

print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
s = input()

if(s = 'Sunny'):
    print('Cloudy')
elif(s = 'Cloudy'):
    print('Rainy')
else:
    print('Sunny')


Fixed submission:
s = input()
l = ["Sunny","Cloudy","Rainy","Sunny"]
for i in range(3):
  if s==l[i]:
     print(l[i+1])
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = map(list(int,input().split()))
ans = 0
for i in a:
    ans += i
print(1 / ans)


Fixed submission:
n = int(input())

a = map(int,input().split())
ans = 0
for i in a:
    ans += 1/i
print(1 / ans)
Buggy python submission (verdict: Runtime Error):
def main ():
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
print(0)
return
prod = 1
for a in A:
prod *= a
if prod > 1000000000000000000:
print(-1)
return
print(prod)
main ()

Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
    
  print(prod)
main ()

Buggy python submission (verdict: Runtime Error):
def main():
  n=int(input())
  arr=list(map(int,input.split()))
  prod=1
  for i in range(0,n):
    prod*=arr[i]
    if(prod>=1000000000000000000):
      print(-1)
      return
    
  print(prod)

  
main()

Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
    
  print(prod)
main ()

Buggy python submission (verdict: Runtime Error):
def cal():
  n=int(input())
  arr=list(map(int,input.split()))
  prod=1
  for i in range(0,n):
    prod*=arr[i]
    if(prod>=1000000000000000000):
      print(-1)
      return
  print(prod)
  return

cal()

Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
    
  print(prod)
main ()

Buggy python submission (verdict: Time Limit Exceeded):
_ = int(input())
a = [int(i) for i in input().split()]

isOverflow = False

mul = 1
for ai in a:
    mul *= ai

print(-1 if mul > 1000000000000000000 else mul)

Fixed submission:
def main():
    _ = int(input())
    a = [int(i) for i in input().split()]

    if 0 in a:
        print(0)
        return

    mul = 1
    for ai in a:
        mul *= ai
        if mul > 1000000000000000000:
            print(-1)
            return

    print(mul)

main()

Buggy python submission (verdict: Runtime Error):
input()
ans = 1
n = int(1e18)
a = list(map(int, input().strip().split()))
for i in a:
    ans *= i
    if ans > n:
        ans = -1
        break
if 0 in ans: ans = 0
print(ans)


Fixed submission:
input()
ans = 1
n = int(1e18)
a = list(map(int, input().strip().split()))
for i in a:
    ans *= i
    if ans > n:
        ans = -1
        break
if 0 in a: ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for(int i = a; i < b; i ++)
#define FORN(i, a, b) for(int i = a; i <= b; i ++)
#define FORD(i, a, b) for(int i = a-1; i >= b; i --)
#define FORE(i, b) for(auto &i:b)
#define REP(i, b) FOR(i, 0, b)
#define REPN(i, b) FORN(i, 0, b)
#define SQ(i) (i*i)
#define ALL(a) a.begin(), a.end()
#define ALLA(a,n) a, a+n
#define SORT(a) sort(ALL(a))
#define SORTA(a, n) sort(ALLA(a, n))
#define REV(a) reverse(ALL(a))
#define REVA(a, n) reverse(ALLA(a, n))
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define IN(a, b) (a.find(b) != a.end())
#define BACK(a) a.back(); a.RB()
#define QBACK(a) a.top(); a.pop()
#define PRINT(a) FORE(i, a) cout << i << " "; cout << endl

#define PB  push_back
#define RB  pop_back
#define RF  pop_front
#define INS insert
#define F   first
#define S   second
#define UM  unordered_map
#define US  unordered_set
#define PQ  priority_queue

#define IO ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<ll,ll> pll;
typedef queue<int> qi;
typedef queue<double> qd;
typedef queue<ll> qll;
typedef US<int> si;
typedef US<double> sd;
typedef US<ll> sll;
typedef vector<vi> mi;
typedef vector<vd> md;
typedef vector<vll> mll;
typedef vector<pi> vpi;
typedef vector<pd> vpd;
typedef vector<pll> vpll;

int main(){
  IO; ll t; sll V;
  REP(i,3){cin >> t; V.INS(t);}
  cout << (V.size() == 2 ? "Yes":"No");
}


Fixed submission:
v = set(map(int, input().strip().split()))
print("Yes" if len(v) == 2 else "No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().strip().split()))
a=[0]*n
for i in range(n-1,-1,-1):
  c=0
  for j in range(i,n,i):
    c ^= a[j]
  if c != v[i]:
    a[i] = 1
ans = []
for i in range(n):
  if a[i]: ans.append(i+1)
print(len(ans))
print(*ans)

Fixed submission:
n=int(input())
v=list(map(int,input().strip().split()))
a=[0]*n
for i in range(n-1,-1,-1):
  c=0
  for j in range(i,n,i+1):
    c ^= a[j]
  if c != v[i]:
    a[i] = 1
ans = []
for i in range(n):
  if a[i]: ans.append(i+1)
print(len(ans))
print(*ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().strip().split())
s=input.strip()
l=r=0
c=0
while r<n and s[r]=='1': r+=1
while c<k:
 while r<n and s[r]=='0':r+=1
 while r<n and s[r]=='1':r+=1
 if r==n:print(n);exit()
 c+=1
ans=r-l
while r<n:
 while l<n and s[l]=='1':l+=1
 while l<n and s[l]=='0':l+=1 
 while r<n and s[r]=='0':r+=1
 while r<n and s[r]=='1':r+=1
 ans=max(ans,r-l)
print(ans)

 

Fixed submission:
n,k=map(int,input().strip().split())
s=input().strip()
l=r=0
c=0
while r<n and s[r]=='1': r+=1
while c<k:
 while r<n and s[r]=='0':r+=1
 while r<n and s[r]=='1':r+=1
 if r==n:print(n);exit()
 c+=1
ans=r-l
while r<n:
 while l<n and s[l]=='1':l+=1
 while l<n and s[l]=='0':l+=1 
 while r<n and s[r]=='0':r+=1
 while r<n and s[r]=='1':r+=1
 ans=max(ans,r-l)
print(ans)