Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

def factor(n):
    table = [0] * (n + 1)
    ans = [1]
    for i in range(2, n + 1):
        if table[i] == 0:
            if n % i == 0:
                ans.append(i)
            for j in range(i + i, n + 1, i):
                table[j] = 1
    return ans

ans = len(set(factor(a)) & set(factor(b)))
print(ans)


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

def factor(n):
    ans = []
    i = 2
    while i * i <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(int(n))
    return ans

ans = len(set(factor(a)) & set(factor(b))) + 1
print(ans)

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

def factor(n):
    table = [0] * (n + 1)
    ans = []
    for i in range(2, n + 1):
        if table[i] == 0:
            if n % i == 0:
                ans.append(i)
            for j in range(i + i, n + 1, i):
                table[j] = 1
    return ans

ans = len(set(factor(a)) & set(factor(b))) + 1
print(ans)


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

def factor(n):
    ans = []
    i = 2
    while i * i <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(int(n))
    return ans

ans = len(set(factor(a)) & set(factor(b))) + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
hi = list(map(int, input().split()))

ans = []
cnt = 0
for i in range(n-1):
    if hi[i] >= hi[i+1]:
        cnt += 1
    else:
        cnt = 0
    ans.append(cnt)
print(max(ans))


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

ans = 0
cnt = 0
for i in range(n-1):
    if hi[i] >= hi[i+1]:
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = list(range(1, n+1))
ans = 0
for i in range(n):
    ans += a[i] % a[(i+1)%n]

print(ans)


Fixed submission:
n = int(input())

ans = n * (n - 1) // 2
print(ans)

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

a = list(range(1, n+1))
b = a[1:] + [a[0]]

ans = 0
for i, j in zip(a, b):
    ans += (i % j)
print(ans)


Fixed submission:
n = int(input())

ans = n * (n - 1) // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

dp = [[0] * 13 for _ in range(len(s)+1)]
dp[0][0] = 1

mul = 1

for i in range(len(s)):
    x = s[-(i+1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i+1][(mul*k + j)%13] += dp[i][j]
                dp[i+1][(mul*k + j)%13] %= 10**9 + 7
    else:
        k = int(x)
        for j in range(13):
            dp[i+1][(mul*k + j)%13] += dp[i][j]
            dp[i+1][(mul*k + j)%13] %= 10**9 + 7
    mul = mul * 10 % 13

print(dp[len(s)][5])


Fixed submission:
s = input()

dp = [[0] * 13 for _ in range(len(s)+1)]
dp[0][0] = 1

mul = 1

for i in range(len(s)):
    x = s[-(i+1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i+1][(mul*k + j)%13] += dp[i][j]
                dp[i+1][(mul*k + j)%13] %= 10**9 + 7
    else:
        k = int(x)
        for j in range(13):
            dp[i+1][(mul*k + j)%13] += dp[i][j]
            dp[i+1][(mul*k + j)%13] %= 10**9 + 7
    mul = mul * 10 % 13

print(dp[len(s)][5])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
hi = list(map(int, input().split()))

dp = [float('INF')] * n
dp[0] = 0

for i in range(n):
    for j in range(1, k+1):
        if n > i+j >= 0:
            dp[i+j] = min(dp[i+j], dp[i] + abs(hi[i] - hi[i+j]))

print(dp[-1])


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

dp = [float('INF')] * n
dp[0] = 0

for i in range(n):
    for j in range(1, k+1):
        if n > i+j >= 0:
            dp[i+j] = min(dp[i+j], dp[i] + abs(hi[i] - hi[i+j]))

print(dp[-1])
Buggy python submission (verdict: Runtime Error):
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

ans = float("inf")
for b in range(1<<d):
    m = set(range(1, d+1))
    c = 0
    s = 0
    for i in range(d):
        if b & (1<<i):
            c += pc[i][0]
            s += 100*(i+1)*pc[i][0] + pc[i][1]
            m.discard(i+1)
    if s >= g:
        ans = min(ans, c)
        continue
    while s < g:
        p = pc[max(m)-1][0]
        for _ in range(p):
            c += 1
            s += 100*max(m)
            if s >= g:
                break
        m.discard(max(m))
    ans = min(ans, c)
print(ans)


Fixed submission:
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

ans = float("inf")
for b in range(1<<d):
    m = set(range(1, d+1))
    c = 0
    s = 0
    for i in range(d):
        if b & (1<<i):
            c += pc[i][0]
            s += 100*(i+1)*pc[i][0] + pc[i][1]
            m.discard(i+1)
    if s >= g:
        ans = min(ans, c)
        continue
    while s < g and m:
        p = pc[max(m)-1][0]
        for _ in range(p):
            c += 1
            s += 100*max(m)
            if s >= g:
                break
        m.discard(max(m))
    ans = min(ans, c)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

prd = 1
for i in range(N):
  prd *= A[i]
if(prd > 10**18):
  print(-1)
else:
  print(prd)

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

if 0 in A:
  print(0)
  exit()
else:
  flag = True
  prd = 1
  A.sort(reverse=True)
  for i in range(N):
    prd *= A[i]
    if prd > 10**18:
      flag = False
      break
if flag:
  print(prd)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

flag = True
A = sorted(A)
for i in range(N-1):
  if A[i] == A[i+1]:
    flag = False
    break
if flag:
  print("YES")
else:
  print("NO")

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

if S == U:
  print(A-1, B)
else:
  print(A, B-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

flag = True
for i in range(N):
  for j in range(i+1, N):
    if A[i] == A[j]:
      flag = False
      break
if flag:
  print("YES")
else:
  print("NO")

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

flag = True
A = sorted(A)
for i in range(N-1):
  if A[i] == A[i+1]:
    flag = False
if flag:
  print("YES")
else:
  print("NO")

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

flag = True
for i in range(N):
  for j in range(i+1, N):
    if A[i] == A[j]:
      flag = False
if flag:
  print("YES")
else:
  print("NO")

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

flag = True
A = sorted(A)
for i in range(N-1):
  if A[i] == A[i+1]:
    flag = False
if flag:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

diff = [0 for i in range(N)]
for i in range(N):
  diff[i] = V[i] - C[i]
diff = list(reversed(sorted(diff)))
i, ans = 0, 0
while diff[i] > 0:
  ans += diff[i]
  i += 1
print(max(ans, 0))

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

ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans += V[i] - C[i]
print(ans)

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

diff = [0 for i in range(N)]
for i in range(N):
  diff[i] = V[i] - C[i]
diff = list(reversed(sorted(diff)))
i, ans = 0, 0
while diff[i] > 0:
  ans += diff[i]
  i += 1
print(ans)

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

ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans += V[i] - C[i]
print(ans)

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

diff = [0 for i in range(N)]
for i in range(N):
  diff[i] = V[i] - C[i]
diff = list(reversed(sorted(diff)))
i, ans = 0, 0
while diff[i] >= 0:
  ans += diff[i]
  i += 1
print(max(ans, 0))

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

ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans += V[i] - C[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
X,Y,A,B,C = [int(i) for i in input().split()]

def input_list(N):
  list = []
  for i in input().split():
    list.append(int(i))
  list.sort(reverse=True)
  return list

P = input_list(A)
Q = input_list(B)
R = input_list(C)

def delete_last(list,X):
  for i in range(X,len(list)):
    list.pop(X)

delete_last(P,X)
delete_last(Q,Y)


Top = P + Q + R
Top.sort(reverse=True)
sum = 0
for i in range(X+Y):
  sum += Top[i]
print(sum)


Fixed submission:
X,Y,A,B,C = [int(i) for i in input().split()]

def input_list(N):
  list = []
  for i in input().split():
    list.append(int(i))
  list.sort(reverse=True)
  return list

P = input_list(A)
Q = input_list(B)
R = input_list(C)
Top = P[:X] + Q[:Y] + R
Top.sort(reverse=True)
sum = 0
for i in range(X+Y):
  sum += Top[i]
print(sum)
Buggy python submission (verdict: Runtime Error):
N=int(input())
count=0
answer=0

for i in range(N+1):
	count=0
	if i%2==1:
		for j in range(i):
			if i%(j+1)==0:
				count +=1
		
		if count==8:
			answer += 1
	
	print(answer)

print(answer)

Fixed submission:
A,B=map(int, input().split())
S=(A-1)*(B-1)
print(S)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int, input().split()))
sum = 0
last = 0
sw = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
    if last < sum:
      print("Yes")
      sw = 1
      break
  if sw ==0:
    print("No")
  last = sum
  sum = 0
  sw = 0

Fixed submission:
X = int(input())

for num in range(9):
  if 1800 - num*200 <= X <= 1999 -num*200:
    print(num+1)
Buggy python submission (verdict: Runtime Error):
A,B,C = int(input().split())
print(A)

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

for i in range(K+1):
  if( i == K+1 ):
    break
  for j in range(K+1):
    if( i + j == K+1 ):
      break
    for k in range(K+1):
      if( i + j + k == K+1 ):
        break
      if A*(2**i) < B*(2**j) < C*(2**k):
        print("Yes")
        exit()
     
print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int, input().split()))
sum = 1
last = 1
sw = 0
for num in range(K):
  last *= A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum *= A[i+j]
    if last < sum:
      print("Yes")
      sw = 1
      break
  if sw ==0:
    print("No")
  last = sum
  sum = 1
  sw = 0

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

for i in range(0,N-K):
  if A[i] < A[i+K]:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int, input().split()))
kake = []
sum = 1
for i in range(0,N-K+1):
  for j in range(K):
  	sum *= A[i+j]
  kake += [sum]
  sum = 1
for num in range(len(kake)-1):
  if kake[num] < kake[num+1]:
    print("Yes")
  else:
    print("No")

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

for i in range(0,N-K):
  if A[i] < A[i+K]:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int, input().split()))
sum = 0
last = 0
sw = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
    if last < sum:
      print("Yes")
      sw = 1
      break
  if sw ==0:
    print("No")
  last = sum
  sum = 0
  sw = 0

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

for i in range(0,N-K):
  if A[i] < A[i+K]:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int, input().split()))
sum = 0
last = 0
sw = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
    if last < sum:
      print("Yes")
      sw = 1
  if sw ==0:
    print("No")
  last = sum
  sum = 0
  sw = 0

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

for i in range(0,N-K):
  if A[i] < A[i+K]:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int, input().split()))
sum = 0
last = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
  if last < sum:
    print("Yes")
  else:
    print("No")
  last = sum
  sum = 0

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

for i in range(0,N-K):
  if A[i] < A[i+K]:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(input())

if (S[K-1] == 'A'):
  S[K] = 'a'
elif (S[K-1] == 'B'):
  S[K] = 'b'
elif (S[K-1] == 'C'):
  S[K] = 'c'
  
ans = ''.join(S)
    
print(ans)



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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)

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

if (S[K-1] == "A"):
  S[K] = "a"
elif (S[K-1] == "B"):
  S[K] = "b"
elif (S[K-1] == "C"):
  S[K] = "c"
  
ans = ','.join(S)
    
print(ans)



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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)

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

if (S[K] == 'A'):
  S[K] = 'a'
elif (S[K] == 'B'):
  S[K] = 'b'
else:
  S[K] = 'c'
  
ans = ','.join(S)
    
print(ans)



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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)

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

if (S[K] == 'A'):
  S[K] = 'a'
elif (S[K] == 'B'):
  S[K] = 'b'
else:
  S[K] = 'c'
    
print(S)



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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)

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

if (S[K] == 'A'):
  S[K] = 'a'
elif (S[K] == 'B'):
  S[K] = 'b'
else:
  S[K] = 'c'
    
printf(S)



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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = [str(_) for _ in input().split()]

if (S[K] == 'A'):
  S[K] = 'a'
elif (S[K] == 'B'):
  S[K] = 'b'
else:
  S[K] = 'c'
    
printf(S)


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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = [str(_) for _ in input().split()]

if (S[K] == 'A'):
	S[K] = 'a'
elif (S[K] == 'B'):
    S[K] = 'b'
else:
	S[K] = 'c'
    
printf(S)

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

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, T = map(int, input().split())
int sum = 0
int t = 0
while(t <= T):
  if t%A == 0:
    sum += B
  t += 1
print(sum)


Fixed submission:
A, B, T = map(int, input().split())
cnt = T // A
ans = B * cnt
print(ans)

Buggy python submission (verdict: Runtime Error):
A, B, T = map(int, input().split())
int sum = 0
int t = 0
while(t < T+0.5):
  if t%A == 0:
    sum += B
  t += 1
print(sum)

Fixed submission:
A, B, T = map(int, input().split())
cnt = T // A
ans = B * cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(input())
acgt = ["A", "C", "G", "T"]
cnt, ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if ans < cnt:
      ans = cnt
  else:
    cnt = 0
print(ans)


Fixed submission:
s = list(input())
acgt = ["A", "C", "G", "T"]
cnt = 0
ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if (ans < cnt):
      ans = cnt
  else:
    cnt = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
s = list(input())
acgt = ['A', 'C', 'G', 'T']
cnt, ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if ans <= cnt:
      ans = cnt
  else:
    cnt = 0
print(ans)


Fixed submission:
s = list(input())
acgt = ["A", "C", "G", "T"]
cnt = 0
ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if (ans < cnt):
      ans = cnt
  else:
    cnt = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
s = str(input())
cnt, ans = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
    cnt += 1
  else:
    if ans <= cnt:
      ans = cnt
    cnt = 0
print(ans)

Fixed submission:
s = list(input())
acgt = ["A", "C", "G", "T"]
cnt = 0
ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if (ans < cnt):
      ans = cnt
  else:
    cnt = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
cnt = 0
ans = 0
for i in range(max(A, B)):
  if (A % i == 0 and B % i == 0):
    cnt += 1
  if cnt == K:
    print(i)
    exit()

Fixed submission:
A, B, K = map(int, input().split())
AB = [A, B]
L = list()
for i in range(1,min(AB)+1):
  if A % i == 0 and B % i == 0:
    L.append(i)
print(L[len(L)-K])
Buggy python submission (verdict: Runtime Error):
input = str(input())
input.split('/')

if input[1] != '10':
  input[1].replace('0', '')
input = int(input)

if (input[0] > 2019) or ( (input[0] == 2019) and (input[1] > 4) ):
  print("TBD")
else:
  print("Heisei")

Fixed submission:
s = input()
m = int(s[5:7])
if m <= 4:
  print("Heisei")
else:
  print("TBD")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
L = list()
ans = list()
for i in range(N):
  l = [int(_) for _ in input().split()]
  for j in range(len(l[0])):
    ans.append(l[j+1])
  l = L.copy()
cnt = 0
num = 0
s = -1
ans.sort()
for k in ans:
  if s == k:
    cnt += 1
    if cnt == N:
      num += 1
      cnt = 0
  else:
    cnt = 1
    s = k
print(num)
    

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

def func(n):
  if n % 2 == 0:
    return (n/2)
  else:
    return (3n+1)

a = list()
a.append(s)
for i in range(1000):
  a.append(func(a[i]))
for j in range(1001):
  for k in range(1001):
    if (j != k and a[j] == a[k]):
      print(k)
      exit()
      

Fixed submission:
def collatz(n):
    if n%2 == 0:
        return n/2
    else:
        return 3*n+1

s=int(input())
nlist =[]
tmp_in = collatz(s)
nlist.append(s)
nlist.append(tmp_in)
cnt = 1
while True:
    cnt += 1
    tmp_out = collatz(tmp_in)

    if tmp_out in nlist:
        print(len(nlist)+1)
        #print(nlist)
        break
    nlist.append(tmp_out)
    tmp_in = tmp_out
Buggy python submission (verdict: Runtime Error):
num = [int(i) for i in input().split()]
num = num.sorted(reverse=True)
ans = 10*num[0] + num[1] + num[2]
print(ans)

Fixed submission:
num = [int(i) for i in input().split()]
num.sort()
print(sum(num)+num[-1]*9)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input())
if N % K == 0:
  print(0)
else:
  print(1)

Fixed submission:
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
n = [int(i) for i in inpyt().split()]
n.sort()
print(int(n[2]-n[0]))

Fixed submission:
n = list(map(int, input().split()))
n.sort()
print(n[2]-n[0])
Buggy python submission (verdict: Runtime Error):
def is_prime(a):
    if a == 1:
        return False
    i = 2
    while i * i <= a:
        if a % i == 0:
            return False
        i += 1
    return True

K = int(input())

if not is_prime(K) or K == 2:
    print(-1)

else:
    exit(1)
    print(K - 1)

Fixed submission:
k = int(input())
ans = 1
x = 7
while ans <= k:
    if x % k == 0:
        print(ans)
        break
    x = x * 10 + 7
    x %= k
    ans += 1
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
score = [0 for i in range(n)]
cnt = 1
for i in range(n):
    if i < k - 1:
        score[i] = a[i]
        cnt *= score[i]
    elif i == k - 1:
        cnt *= a[i]
        score[i] = cnt
    else:
        cnt *= a[i]
        cnt /= a[i - k]
        score[i] = cnt
# print("score =", score)
for i in range(k, n):
    if score[i] > score[i - 1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
# score = [0 for i in range(n)]
# # cnt = 1
# for i in range(n):
#     if i < k - 1:
#         score[i] = a[i]
#     elif i == k - 1:
#         score[i] = score[i - 1] * a[i]
#     else:
#         score[i] = score[i - 1] * a[i] / a[i - k]
# # print("score =", score)
# for i in range(k, n):
#     if score[i] > score[i - 1]:
#         print("Yes")
#     else:
#         print("No")
for i in range(k, n):
    if a[i - k] < a[i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math
import calendar
import fractions
import itertools

n, k = map(int, input().split())
p = list(map(int, input().split()))

ans_list = []

for i in p:
    if i % 2 == 0:
        ans_list.append(i / 2 + 0.5)
    else:
        ans_list.append(i // 2 + 1)


ans = 0

for i in range(n - k + 1):
    total = 0
    for j in range(i, i + k):
        total += ans_list[j]
    ans = max(ans, total)
print(ans)

Fixed submission:
import math
import calendar
import fractions
import itertools

n, k = map(int, input().split())
p = list(map(int, input().split()))

ans_list = []

for i in p:
    if i % 2 == 0:
        ans_list.append(i / 2 + 0.5)
    else:
        ans_list.append(i // 2 + 1)


ans = 0
total = 0
for i in range(0, n - k + 1):
    if i == 0:
        for j in range(k):
            total += ans_list[j]
            ans = total
    else:
        total -= ans_list[i - 1]
        total += ans_list[i + k - 1]
    ans = max(ans, total)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import calendar
import fractions
import itertools

n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
ans = 0

while k > 0:
    h = h[:-1]
    k -= 1

ans += sum(h)

print(ans)


Fixed submission:
import math
import calendar
import fractions
import itertools

n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
ans = 0

if k >= n:
    print(0)
else:
    h = h[:n - k]
    print(sum(h))