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

Fixed submission:
def main():
    a = input()
    if 'a' in a and 'b' in a and 'c' in a:
        print("Yes", end="")
    else:
        print("No", end="")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    a, b, c = map(int, input().split())
    
    top = max([a, b, c])
    bot = min([a, b, c])
    mid = 0
    for x in [a, b, c]:
        if top != x and bot != x:
            mid = x
    count = 0
    
    count = top - mid
    bot += count
    mid += count
    
    if (top - bot) % 2 == 0:
        count += (top - bot) / 2 
    else:
        count += math.ceil((top - bot) / 2)+1
        
    print(int(count), end="")
    print()

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    a = input()
    if 'a' in a and 'b' in a and 'c' in a:
        print("yes", end=")
    else:
        print("no", end=")

if __name__ == "__main__":
    main()
Problem p03387 (python)

Fixed submission:
import math

def main():
    a, b, c = map(int, input().split())
    
    li = [a, b, c]
    top = max(li)
    top_index = li.index(top)
    bot = min(li)
    bot_index = li.index(bot)
    mid_index = calc_mid_index(top_index, bot_index)
    mid = li[mid_index]
    count = 0
    
    count = top - mid
    bot += count
    mid += count
    
    if (top - bot) % 2 == 0:
        count += (top - bot) / 2 
    else:
        count += math.ceil((top - bot) / 2) + 1
        
    print(int(count))

def calc_mid_index(top_index, bot_index):
    for i in range(3):
        if i != top_index and i != bot_index:
            return i



if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    a, b, c = map(int, input().split())
    
    top = max([a, b, c])
    bot = min([a, b, c])
    global mid
    for x in [a, b, c]:
        if top != x and bot != x:
            mid = x
    count = 0
    
    count = top - mid
    bot += count
    mid += count
    
    if (top - bot) % 2 == 0:
        count += (top - bot) / 2 
    else:
        count += math.ceil((top - bot) / 2)+1
        
    print(int(count), end="")
    print()

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    a, b, c = map(int, input().split())
    
    top = max([a, b, c])
    bot = min([a, b, c])
    for x in [a, b, c]:
        if top != x and bot != x:
            mid = x
    count = 0
    
    count = top - mid
    bot += count
    mid += count
    
    if (top - bot) % 2 == 0:
        count += (top - bot) / 2 
    else:
        count += math.ceil((top - bot) / 2)+1
        
    print(int(count), end="")
    print()

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    a, b, c = map(int, input().split())
    
    top = max([a, b, c])
    bot = min([a, b, c])
    for x in [a, b, c]:
        if top != x and bot != x:
            mid = x
    count = 0
    
    count = top - mid
    bot += count
    mid += count
    
    if (top - bot) % 2 == 0:
        count += (top - bot) / 2 
    else:
        count += math.ceil((top - bot) / 2)+1
        
    print(int(count), end="")

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

Fixed submission:
R = 3
r = [ list(map(int, input().split(' '))) for i in range(R) ]

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  f = True
  for p in range(R):
    if r[p][p] != 0:
      f = False
      break
  if f:
    return True
 
  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
      f = False
      break
  return f
 
N = int(input())
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0
 
print('Yes' if check() else 'No')

Buggy submission (verdict: Runtime Error):
R = 3
r = [ list(map(int, input().split(' '))) for i in range(R) ]

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
	    break
    if f:
      return True
 
  f = True
  for p in range(R):
    if r[p][p] != 0:
      f = False
      break
  if f:
    return True
 
  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
      f = False
      break
  return f
 
N = int(input())
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0
 
print('Yes' if check() else 'No')

Buggy submission (verdict: Runtime Error):
R = 3
r = []
for i in range(R):
  r[i] = list(map(int, input().split(' ')))

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
    if f:
      return True

  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
    if f:
      return True

  f = True
  for p in range(R):
    if r[p][p] != 0:
	    f = False
  if f:
    return True

  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
	    f = False
  return f

N = input()
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0

print('Yes' if check() else 'No')
Problem p02761 (python)

Fixed submission:
N, M = list(map(int, input().split(' ')))
r = [ None for i in range(N) ]

illegal = False
for i in range(M):
  s, c = list(map(int, input().split(' ')))
  if r[s-1] is not None and r[s-1] != c:
    illegal = True
    break
  r[s-1] = c

v = -1
if not illegal:
  for i in range(N):
    if r[i] is None:
      if i == 0 and N != 1:
        r[i] = 1
      else:
        r[i] = 0
  v = sum(r[i] * 10**(N-1-i) for i in range(N))
  if v < 10**(N-1) and not (N == 1 and v == 0):
    v = -1

print(v)

Buggy submission (verdict: Runtime Error):
    N, M = list(map(int, input().split(' ')))
    r = [ None for i in range(N) ]
     
    illegal = False
    for i in range(M):
      s, c = list(map(int, input().split(' ')))
      if r[s-1] is not None and r[s-1] != c:
        illegal = True
        break
      r[s-1] = c
     
    v = -1
    if not illegal:
      for i in range(N):
        if r[i] is None:
          if i == 0 and N != 1:
            r[i] = 1
          else:
            r[i] = 0
      v = sum(r[i] * 10**i for i in range(N))
      if v < 10**(N-1) and not (N == 1 and v == 0):
        v = -1
     
    print(v)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split(' ')))
r = [ None for i in range(N) ]
duplicated = False
for i in range(M):
  s, c = list(map(int, input().split(' ')))
  if r[s-1] is not None:
	duplicated = True
    break
  r[s-1] = c

v = -1
if not duplicated:
  for i in range(N):
    if r[i] is None:
      r[i] = 0
  v = sum(r[i] * 10**i for i in range(N))
  if v < 100:
    v = -1

print(v)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split(' ')))
r = [ None for i in range(N) ]
duplicated = False
for i in range(M):
  s, c = list(map(int, input().split(' ')))
  if r[s-1] is not None:
	duplicated = True
    break
  r[s-1] = c

if not duplicated:
  for i in range(N):
    if r[i] is None:
      r[i] = 0
  v = sum(r[i] * 10**i for i in range(N))
  print(v)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split(' ')))
r = [ None for i in range(N) ]
duplicated = False
for i in range(M):
  s, c = list(map(int, input().split(' ')))
  if r[s-1] is not None:
	duplicated = True
    break
  r[s-1] = c

if duplicated:
  for i in range(N):
    if r[i] is None:
      r[i] = 0
  v = sum(r[i] * 10**i for i in range(N))
  print(v)
else:
  print(-1)
Problem p03005 (python)

Fixed submission:
data = []

data.extend(list(map(int, input().split(" "))))
N = data[0]
K = data[1]

if K == 1:
    print(0)
else:
    print(N - K)

Buggy submission (verdict: Runtime Error):

data = []

data.extend(list(map(int, input().split(str))))
N = data[0]
K = data[1]

if K == 1:
    print(0)
else:
    print(N - K)

Buggy submission (verdict: Runtime Error):

data = []

data.extend(list(map(int, input().split(str))))
N = data[0]
K = data[1]

if K == 1:
    print(0)
else:
    print(K - N)
Problem p02741 (python)

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
i = int(input())-1
print(l[i])

Buggy submission (verdict: Runtime Error):
# 各条件の入力
a, b, c = map(int, input().split())

# 答えの出力
import math

"""
素直にやると誤差で死ぬ
if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
    ans = 'Yes'
else:
    ans = 'No'
"""


# 整数でやる
left = a + b + (math.sqrt(a*b))*2
right = c

left2 = ((math.sqrt(a*b))*2) **2
right2 = (c - a - b) **2

left3 = 4*a*b
right3 = right2

if (c - a - b) < 0:
    ans = 'No'
elif left3 < right3:
    ans = 'Yes'
else:
    ans = 'No'

# 出力
print(ans)

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

# 答えの出力

if (a**2 + b**2) + (2*(a*b)) < c**2:
    ans = 'Yes'
else:
    ans = 'No'

# 出力
print(ans)

Buggy submission (verdict: Runtime Error):

l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
# 各条件の入力
i = int(input())
# 答えの出力
print(l[i])
Problem p02952 (python)

Fixed submission:
n =int(input())

if n < 10:
    print(n)
elif 10 <= n < 100:
    print(9)
elif 100 <= n <1000:
    print(n-90)
elif 1000 <= n < 10000:
    print(909)
elif 10000 <= n < 100000:
    print(n-9090)
elif 100000 <= n < 1000000:
    print(90909)

Buggy submission (verdict: Runtime Error):
if n >= 100000:
    print(90909)
elif n >= 10000:
    print(n-9090)
elif n >= 1000:
    print(909)
elif n >= 100:
    print(n-90)
elif n >= 10:
    print(n)

Buggy submission (verdict: Runtime Error):
m = input()

if n < 10:
    print(n)
elif 10 <= n < 100:
    print(9)
elif 100 <= n <1000:
    print(n-90)
elif 1000 <= n < 10000:
    print(909)
elif 10000 <= n < 100000:
    print(n-9090)
elif 100000<= n < 1000000:
    print(90909)
Problem p02953 (python)

Fixed submission:
# ABC 136 C
n = int(input())
h = [ int(_) for _ in input().split() ]
flag = True

for i in range(len(h)-1, 0, -1):
    if h[i-1] == h[i] +1:
        h[i-1] = h[i-1]-1  
        
for j in range(0,len(h)-1):
    if h[j] > h[j+1]:
        print('No')
        flag = False
        break
        
if flag == True:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [ int(_) for _ in input().split() ]
flag = True

for i in range(len(h)-1, 0, -1):
    if h[i] == h[i+1] +1:
        h[i] = h[i]-1  
        
for j in range(0,len(h)-1):
    if h[j] > h[j+1]:
        print('No')
        flag = False
        break
        
if flag == True:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [ int(_) for _ in input().split() ]

for i in range(0,h-1):
    if h[i] > h[i+1]:
        h[i] = h[i]-1
    print(h)   
        
for i in range(0,h-1):
    if h[j] > h[j+1]:
        print('No')
        exit()
        
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [ int(_) for _ in input().split() ]

flag = True
h_s = [ x-1 for x in h ]
h_sorted = sorted(h)

for i in range(0,h-1):
    if h[i] > h[i+1]:
        h[i] = h[i]-1
    print(h)   
        
for i in range(0,h-1):
    if h[j] > h[j+1]:
        print('No')
        flag = False
        
if flag == True:
    print('Yes')
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [ int(input()) for x in range(n) ] 

b = sorted(a, reverse = True)
maximum = b[0]

for i in a:
    if i == maximum:
        print(b[1])
    else:
        print(maximum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [ int(input()) for x in range(n) ]

for i in a:
    a.remove(i)
    print( max(b) )
    a.append(i)
Problem p04045 (python)

Fixed submission:
N,K = list(map(int, input().split()))
D = sorted(input().split())
W = []
for i in range(10):
    if str(i) not in D:
        W.append(i)

while True:
    cnt = 0
    for i in range(len(W)):
        cnt += str(N).count(str(W[i]))
    if cnt == len(str(N)):
        break
    N += 1

print(N)

Buggy submission (verdict: Runtime Error):
N,K = list(map(str, input().split()))
D = sorted(input().split())
W = []
P = ""

for i in range(10):
    if str(i) not in D:
        W.append(str(i))

for i in range(len(N)):
    for j in range(len(W)):
        if N[i] <= W[j]:
            P += W[j]
            break

print(int(P))
Problem p02724 (python)

Fixed submission:
import math
X = int(input())
A = X/500
A=math.floor(A)
Q=1000*A
D=A*500
Y=X-D
B = Y/5
B = math.floor(B)
B= 5*B
print(int(Q+B))

Buggy submission (verdict: Runtime Error):
X = int(input())import math
X = int(input())
A = X/500
A=math.floor(A)
Q=1000*A
D=A*500
Y=X-D
B = Y/5
B = math.floor(B)
B= 5*B
print(Q+B)
Problem p02865 (python)

Fixed submission:
N=int(input())
if N==1 or N==2:
  ans=0
elif N%2==0:
  ans=(N/2)-1
else:
  ans=N//2  
print(int(ans))

Buggy submission (verdict: Runtime Error):
N=int(import())
if N==1:
  ans=0
elif N==2:
  ans=0
elif N%2==0:
  ans=(N/2)-1
else:
  ans=N//2  
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(import())
 
if N==1orN==2:
  ans=0
elif N%2==0:
  ans=(N/2)-1
else:
  ans=N//2
  
print(ans)

Buggy submission (verdict: Runtime Error):
import math
N=int(import())
ams=0
 
if N==1orN==2:
  ans=0
elif N%2==0:
  ans=(N/2)-1
else:
  ans=N/2
  ans = math.floor(ans)
  
print(ans)

Buggy submission (verdict: Runtime Error):

import math
N=int(import())
 
if N==1 or N==2:
  ans=0
elif N%2==0:
  ans=N/2-1
else:
  ans=N/2
  ans = math.floor(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
import math
N=int(import())

if N==1 or N==2:
  ans=0
else N%2==0:
  ans=N/2-1
else:
  ans=N/2
  ans = math.floor(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
import math
N=int(import())
 
a = comb(N, 3, exact=True)
if N==1 or N==2:
  ans=0
else N%2==0:
  ans=a/2-1
else:
  ans=a/2
  ans = math.floor(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
import math
N=int(import())

a = comb(N, 3, exact=True)
if N%2==0:
  ans=a/2-1
else:
  ans=a/2
  ans = math.floor(ans)
print(ans)
Problem p02886 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
 
s=0
for i in range(a):
  for j in range(i+1,a):
    s+=b[i]*b[j]
print(s)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
 
s=0
for i in range(a):
  for j in range(i+1,a):
    s+=d[i]*d[j]
print(s)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split())
 
s=0
for i in range(a):
  for j in range(i+1,a):
    s+=b[i]*b[j]
print(s)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split))
 
s=0
for i in range(a):
  for j in range(i+1,a):
    s+=b[i]*b[j]
print(s)

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

s=0
for i in range(a):
  for j in range(i+1,a):
    s+=d[i]*d[j]
print(s)
Problem p02934 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=0
for i in range(N):
    a+=1/A[i]
print(1/a)

Buggy submission (verdict: Runtime Error):
N-int(input())
A=list(map(int,input().split()))
a=0
for i in range(N-1):
    a+=1/A[i]
print(1/a)
Problem p03071 (python)

Fixed submission:
a,b=map(int, input().split())
ans=0
if(a>b):
    ans+=a
    a=a-1
    if(a>b):
        ans+=a
    else:
        ans+=b
else:
    ans+=b
    b=b-1
    if(a>b):
        ans+=a
    else:
        ans+=b
print(ans)

Buggy submission (verdict: Runtime Error):
    a, b= [int(x) for x in input().split()]
    print(max(a+b, max(a+a-1, b+b-1)))
Problem p03106 (python)

Fixed submission:
a,b,k=map(int, input().split())
c=[]
for i in range(1,min(a,b)+1):
    if (a%i==0) and (b%i==0):
        c.append(i)
print(c[len(c)-k])

Buggy submission (verdict: Runtime Error):
a,b,k=map(float, input().split())
c=[]
for i in range(1,a+1):
    if a%i==0 and b%i==0:
        c.append(i)
print(c[k-1])
Problem p03597 (python)

Fixed submission:
N=int(input())
A=int(input())
print(N**2-A)

Buggy submission (verdict: Runtime Error):
    s = input().split()
     
    if s.count('5') == 2 and s.count('7') == 1:
      print('YES')
    else:
      print('NO')
Problem p03657 (python)

Fixed submission:
A,B=map(int,input().split())
print("Impossible" if (A+B)%3!=0 and A%3!=0 and B%3!=0 else "Possible")

Buggy submission (verdict: Runtime Error):
print("Impossible" if int(input()[::2])%3 else "Possible")
Problem p03796 (python)

Fixed submission:
import math
print(math.factorial(int(input()))%(10**9+7))

Buggy submission (verdict: Runtime Error):
def func(X):
    if X==1:
        return 1
    else:
        return X*func(X-1)
N=int(input())
print(func(N)%((10**9)+7))
Problem p04044 (python)

Fixed submission:
N,L=map(int,input().split())
A=[]
for i in range(N):
    s=input()
    A.append(s)
B=sorted(A)
for i in range(N):
    print(B[i],end="")

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[]
for i in range(N):
    s=input()
    S.append(s)
print(sorted(S)[0]+sorted(S)[1]+sorted(S)[2])
Problem p03231 (python)

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

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    if (a*i - (a-b)) % b == 0:
        j = (a * i - (a-b)) // b
        if not s[i-1] == t[j-1]:
            clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b > a:
        gcd(b, a)
    while b:
	    a, b = b, a % b
    return a

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    if (a*i - (a-b)) % b != 0:
        j = a * i - (a-b)
        if not s[i-1] == t[j-1]:
            clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
s = input()
t = input()

import math
l = n * m // math.gcd(n, m)
a = l // n
b = l // m

res = False
clear_all = True
for i in range(1,n+1):
    for j in range(1,m+1):
        if a * i - b * j == a - b:
            if not s[i-1] == t[j-1]:
                clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)
Problem p03239 (python)

Fixed submission:
N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)

Buggy submission (verdict: Runtime Error):
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)

Buggy submission (verdict: Runtime Error):
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Buggy submission (verdict: Runtime Error):
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Buggy submission (verdict: Runtime Error):
N,T=map(int,input())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)
Problem p03243 (python)

Fixed submission:
n=int(input())
a=n//100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)

Buggy submission (verdict: Runtime Error):
n=int(inp())
a=n%100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)
Problem p03267 (python)

Fixed submission:
import math
L = int(input())
r = int(math.log2(L))

res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])

Buggy submission (verdict: Runtime Error):
L = int(input())
for i in range(20):
    if 2**i >  L :
        r = i-1
        break
        
res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])

Buggy submission (verdict: Runtime Error):
L = int(input())
for i in range(20):
    if 2**i >  L :
        r = i-1
        break
#print(r)

res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])
print(res)

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])
Problem p03773 (python)

Fixed submission:
a, b = map(int, input().split())
print((a+b) % 24 )

Buggy submission (verdict: Runtime Error):
 a, b = map(int, input().split())
print((a+b) % 24 )
Problem p03260 (python)

Fixed submission:
if __name__ == '__main__':
    a = input().split()
    if int(a[0])%2 == 1 and int(a[1])%2 == 1:
        print("Yes")
    else:
        print("No")

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

if a%2 == 1 .and. b%2 == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = input().spit()
    if a[0]%2 == 1 and a[1]%2 == 1:
        print("Yes")
    else:
        print("No")
Problem p02911 (python)

Fixed submission:
n,k,q = map(int,input().split())
a = [0 for i in range(n)]
for i in range(q):
    aa = int(input()) - 1
    a[aa] = a[aa] + 1
for i in a:
    if k - q + i > 0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
a = [0 for i in range(n)]
for i in range(q):
    aa = int(input())
    a[aa] = a[aa] + 1
for i in a:
    if k - q + i > 0:
        print("Yes")
    else:
        print("No")
Problem p02934 (python)

Fixed submission:
import fractions as fr
from functools import reduce

def lcm_base(x, y):
  return (x * y) // fr.gcd(x, y)

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

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

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

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

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

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

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

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

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

n=int(input())
a=list(map(int,input().split()))
aa=lcm_list(a)
ans=0
for i in a:
  ans+=aa//i
ans=aa//ans
print(ans)
Problem p02988 (python)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(n-2):
  if p[i]<p[i+1] and p[i+1]<p[i+2] or p[i]>p[i+1] and p[i+1]>p[i+2]:
    ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(intpu())
p=list(map(int,input().split()))
ans=0
for i in range(len(p)-3):
  if p[i]<p[i+1] and p[i+1]<p[i+2] or p[i]<p[i+1] and p[i+1]<p[i+2]:
    ans=ans+1
print(ans)