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

Fixed submission:
N = int(input())

if N == 100000:
  print(90909)
elif N >= 10000:
  print(909 + N - 9999)
elif N >= 1000:
  print(909)
elif N >= 100:
  print(9 + N - 99)
elif N >= 10:
  print(9)
else:
  print(N)

Buggy submission (verdict: Runtime Error):
N = int(input())

if N = 100000:
  print(90909)
elif N >= 10000:
  print(909 + N - 9999)
elif N >= 1000:
  print(909)
elif N >= 100:
  print(9 + N - 99)
elif N >= 10:
  print(9)
else:
  print(N)
Problem p02953 (python)

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

for i in range(N-1):
  if H[N-i-1] < H[N-i-2]:
    H[N-i-2] -= 1
    
f = 0
for i in range(N-1):
  if H[N-i-1] < H[N-i-2]:
    f = 1
    
if f == 0:
  print("Yes")
else:
  print("No")

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

for i in range(N-1):
  if H(N-i-1) < H(N-i-2):
    H(N-i-2) -= 1
    
f = 0
for i in range(N-1):
  if H(N-i-1) < H(N-i-2):
    f = 1
    
if f == 0:
  print("No")
else:
  print("Yes")

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

for i in range(N-1):
  if H(N-i-1) < H(N-i-2):
    H(N-i-2) -= 1
    
f = 0
for i in range(N-1):
  if H(N-i-1) < H(N-i-2):
    f = 1
    
if f = 0:
  print("No")
else:
  print("Yes")
Problem p02957 (python)

Fixed submission:
a, b = map(int, input().split())
if (a+b)%2 == 1:
  print("IMPOSSIBLE")
else:
  print((a+b)//2)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
err = 0
for i in range(N):
  if p[i]!=i:
    err+=0
if err == 0:
  print("YES")
elif err == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
err = 0
for i in range(N):
  if p[i]!=i:
    err+=0
if err == 0:
  print("YES")
elif err == 2:
  print("YES")
else:
  print("NO")
Problem p02958 (python)

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
err = 0
for i in range(N):
  if p[i] != i+1:
    err += 1
if err == 0:
  print("YES")
elif err == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = input(int())
p = list(map(int, input().split()))
err = 0
for i in range(N):
  if p[i]!=i:
    err+=0
if err == 0:
  print("YES")
elif err == 2:
  print("YES")
else:
  print("NO")
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*r*r)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
print(int(N//(2*D+1.001) + 1))
Problem p02981 (python)

Fixed submission:
N, A, B = map(int,input().split())
print(min(N*A, B))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
print(min(N*A, B)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
if R-L >= 2020:
  print(0)
else:
  m = 2020
  for i in range(L, R):
    for j in range(i+1,R+1):
      m = min(m, (i*j)%2019)
  print(m)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R-L >= 2020:
  print(0)
else:
  m = 2020
  for i in range(L, R):
    for j in range(i+1,R+1):
      m = min(m, (i*j)%2019)
print(m)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R-L >= 4050:
  print(1)
else:
  m = 2020
  for i in range(L, R):
    for j in range(i+1,R+1):
      m = min(m, (i*j)%2019)
print(m)
Problem p03035 (python)

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

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
l = 1
r = N
for i in range(M):
  L, R = map(int, input().split())
  if L > l:
    l = L
  if r > R:
    r = R
if l > r:
  print(0)
else:
  print(r-l+1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
l = 1
r = N
for i in range(M):
  L, R = map(int, input().split())
  if L < l:
    l = L
  if r < R:
    r = R
if l > r:
  print(0)
else:
  print(r-l+1)
Problem p03043 (python)

Fixed submission:
import math
N, K = map(int, input().split())

S = 0

for i in range(N):
  S += ((1/N)*(2**((-1)*max(0, math.ceil(math.log2((K-0.1)/(i+1)))))))

print(S)

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

S = 0

for i in range(N):
  S += ((1/N)*(2**((-1)*max(0, math.ceil(math.log2((K-1)/(i+1)))))))

print(S)

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

S = 0

for i in range(N):
  S += (1/N)*max(math.floor(math.log2((K-1)/N)),1)

print(S)

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

S = 0

for i in range(N):
  S += (1/N)*math.floor(math.log2((K-1)/N))

print(S)
Problem p03071 (python)

Fixed submission:
A, B = map(int, input().split())
print(int(max(2*A-1, 2*B-1, A+B)))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(max(2*A-1, 2*B-1, A+B)
Problem p03085 (python)

Fixed submission:
B = input()

if B == "A":
  print("T")
elif B == "T":
  print("A")
elif B == "G":
  print("C")
else:
  print("G")

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AClst = []
c = 0

for i in range(N-1):
  if S[i:i+2]=="AC":
    c += 1
  AClst.append(c)
AClst.append(c)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[r]-AClst[l])
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
AClst = [0]
c = 0

for i in range(N-1):
  if S[i:i+2]=="AC":
    c += 1
  AClst.append(c)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[r-1]-AClst[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AClst = []
c = 0

for i in range(N-1):
  if S[i:i+2]=="AC":
    c += 1
  AClst.append(c)
AClst.append(c)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[r]-AClst[l])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AClst = []
count = 0

for i in range(N-1):
  if S[i:i+2]=="AC":
    c += 1
  AClst.append(c)
AClst.append(c)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[r]-AClst[l])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AClst = [] #ACのAを抜き出すリスト

for i in range(N-1):
  if S[i,i+2]=="AC":
    AClst.append(1)
  else:
    AClst.append(0)
AClst.append(0)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[l:r].count(1))

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AClst = [] #ACのAを抜き出すリスト

for i in range(N-1):
  if S[i,i+2]=="A":
    AClst.append(1)
  else:
    AClst.append(0)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[l:r].count(1))

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AClst = [] #ACのAを抜き出すリスト

for i in range(len(s)-1):
  if S[i,i+2]=="A":
    AClst.append(1)
  else:
    AClst.append(0)

for i in range(N):
  l, r = map(int, input().split())
  print(AClst[l:r].count(1))
Problem p03106 (python)

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

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
S = []
for i in range(100):
  if A%i==0 and B%i==0:
    S.append(i)
print(S[K-1])
Problem p03110 (python)

Fixed submission:
N = int(input())
s = 0
for i in range(N):
  x, u = input().split()
  if u == "JPY":
    s += float(x)
  else:
    s += float(x) * 380000.0
print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = 0
for i in range(N):
  x, u = input().split()
  if u == "JPY":
    s += int(x)
  else:
    s += int(x) * 380000
print(s)
Problem p03160 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
C = [0 for i in range(N)]
for i in range(N):
  if i == 0:
    C[i] = 0
  elif i == 1:
    C[i] = abs(H[i-1]-H[i])
  else:
    C[i] = min(C[i-1] + abs(H[i-1]-H[i]), C[i-2] + abs(H[i-2]-H[i]))
print(C[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
C = [0 for i in range(N)]
for i in range(N):
  if i == 0:
    C[i] == 0
  elif i == 1:
    c[i] == abs(H[i-1]-H[i])
  else:
    c[i] == min(abs(H[i-1]-H[i]), abs(H[i-2]-H[i]))
print(c[i])
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = 999 #平均気温とAとの最短の差
p = 0 #その差を記録したポイント
for i in range(len(H)):
  if t > abs(A - T + H[i]*0.006):
    t = abs(A - T + H[i]*0.006)
    p = i+1
print(p)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = 999 #平均気温とAとの最短の差
p = 0 #その差を記録したポイント
for i in range(H):
  if t > abs(A - T - H[i]*0.006):
    t = abs(A - T - H[i]*0.006)
    p = i+1
print(p)
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
A = []
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    A.append(c)
if len(A)==0:
  print("TLE")
else:
  print(min(A))
Problem p03280 (python)

Fixed submission:
A, B = map(int, input().split())
print((A-1)*(B-1))

Buggy submission (verdict: Runtime Error):
A, B  map(int, input().split())
print((A-1)*(B-1))
Problem p03285 (python)

Fixed submission:
dp = [0 for i in range(100)]
dp[6] = 1
dp[3] = 1
for i in range(100):
  if i>=4 and dp[i-4]==1:
    dp[i] = 1
  if i>=7 and dp[i-7]==1:
    dp[i] = 1
if dp[int(input())-1]==1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
dp = [0 for i in range(100)]
dp[6] = 1
dp[3] = 1
for i in range(100):
  if i>=4 and dp[i-4]==1:
    dp[i] = 1
  if i>=7 and dp[i-7]==1:
    dp[i] = 1
if dp(int(input())-1)==1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
dp = [0 for i in range(100)]
dp[6] = 1
dp[3] = 1
for i in range(100):
  if i>=4 and dp[i-4]==1:
    dp[i] = 1
  if i>=7 and dp[i-7]==1:
    dp[i] = 1
if dp(int(input()-1))==1:
  print("Yes")
else:
  print("No")
Problem p03328 (python)

Fixed submission:
a, b = map(int, input().split())
c = b-a
#高い方の塔の高さがsum(1,2,...,c)=c(c+1)/2になります
h = c*(c+1)//2
print(h-b)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = b-a
#高い方の塔の高さがsum(1,2,...,c)=c(c+1)/2になります
h = c(c+1)//2
print(h-b)
Problem p03331 (python)

Fixed submission:
N = int(input())
m = 999
M = []
N1 = 0
N2 = 0
for i in range(N-1):
  L1 = list(str(i+1))
  N1 = 0
  N2 = 0
  for j in range(len(L1)):
    N1 += int(L1[j])
  L2 = list(str(N - (i+1)))
  for j in range(len(L2)):
    N2 += int(L2[j])
  M.append(N1+N2)
print(min(M))

Buggy submission (verdict: Runtime Error):
N = int(input())
m = 999
for i in range(N):
  N1 = sum(list(str(i+1)))
  N2 = sum(list(str(N - (i+1))))
  m = min(m, N1+N2)
print(m)
Problem p03472 (python)

Fixed submission:
import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_b = sorted(Swords_b, reverse = True)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  print(k)

Buggy submission (verdict: Runtime Error):
import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
amax = 0
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_a = sorted(Swords_a)
Swords_b = sorted(Swords_b)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    どーん！
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  #こっちでWAになる
  print(k)

Buggy submission (verdict: Runtime Error):
import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
amax = 0
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_a = sorted(Swords_a)
Swords_b = sorted(Swords_b)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  ifeuah
  print(k)
Problem p03544 (python)

Fixed submission:
N = int(input())
L = [0 for i in range(N+1)]
L[0]=2
L[1]=1
for i in range(2, N+1):
  L[i] = L[i-1]+L[i-2]
print(L[N])

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [0 for i in range(N)]
L[0]=2
L[1]=1
for i in range(2, N):
  L[i] = L[i-1]+L[i-2]
print(L[N-1])
Problem p03547 (python)

Fixed submission:
S = input()
X, Y = S[0], S[2]

if X == Y:
  print("=")
elif X > Y:
  print(">")
else:
  print("<")

Buggy submission (verdict: Runtime Error):
X, Y = map(input().split())
if X == Y:
  print("=")
elif X > Y:
  print(">")
else:
  print("<")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
if X==Y:
  print("=")
elif X>Y:
  print(">")
else:
  print("<")
Problem p03711 (python)

Fixed submission:
x, y = map(int, input().split())
group1 = [1, 3, 5, 7, 8, 10, 12]
group2 = [4, 6, 9, 11]
group3 = [2]
if ((x in group1) and (y in group1)) or ((x in group2) and (y in group2)) or ((x in group3) and (y in group3)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
group1 = (1, 3, 5, 7, 8, 10, 12)
group2 = (4, 6, 9, 11)
group3 = (2)
if ((x in group1) and (y in group1)) or ((x in group2) and (y in group2)) or ((x in group3) and (y in group3)):
  print("Yes")
else:
  print("No")
Problem p03737 (python)

Fixed submission:
s1, s2, s3 = input().split()
s = s1[0]+s2[0]+s3[0]
print(s.upper())

Buggy submission (verdict: Runtime Error):
s1, s2, s3 = input().split()
s = s1[0]+s2[0]+s3[0]
print(upper(s))
Problem p03760 (python)

Fixed submission:
O = input()
E = input()
s = ""
if len(O)>len(E):
  for i in range(len(E)):
    s = s + O[i] + E[i]
  print(s + O[len(O)-1])
else:
  for i in range(len(E)):
    s = s + O[i] + E[i]
  print(s)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()
s = ""
if len(O)>len(S):
  for i in range(len(S)):
    s = s + O[i] + E[i]
  print(s + O[len(O)-1])
else:
  for i in range(len(S)):
    s = s + O[i] + E[i]
  print(s)
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)

Buggy submission (verdict: Runtime Error):
A B = map(int, input().split())
print((A+B)%24)
Problem p03797 (python)

Fixed submission:
N, M = map(int, input().split())
M2 = M + N*2
print(min(M2//4, M//2))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
M2 += N*2
print(min(M2//4, M//2))
Problem p03807 (python)

Fixed submission:
N = input()
A = list(map(int, input().split()))
s = sum(A)
if s%2==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int, input()))
s = sum(A)
if s%2==0:
  print("YES")
else:
  print("NO")
Problem p03826 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
print(max(A*B, C*D))

Buggy submission (verdict: Runtime Error):
print(max(A*B, C*D))
Problem p03844 (python)

Fixed submission:
A, op, B = input().split()
if op == "+":
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A op B = input().split()
if op == "+":
  print(int(A)+int(B))
else:
  print(int(A)-int(B))
Problem p03861 (python)

Fixed submission:
a, b, x = map(int, input().split())
print(int(b//x - (a-1)//x))

Buggy submission (verdict: Runtime Error):
a, b, x = map(int input().split())
print(b//x - a//x)
Problem p03910 (python)

Fixed submission:
import math
N = int(input())
M = (math.ceil((math.sqrt(1+8*N)-1)/2))
for m in range(0,M):
  if M-m <= N:
    print(M-m)
    N -= M-m
  else:
    if N!=0:
      print(N)
    break

Buggy submission (verdict: Runtime Error):
import math
print(math.floor((math.sqrt(i+8*int(input()))-1)/2))
Problem p02705 (python)

Fixed submission:
import math

a = int(input())
b = 2 * a * math.pi

print(str(b))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
mod = 10**9+7

def cul(N,K):
  Ans = 0
  for i in range(N+1-K+1):
    t = (K+i-1)*(K+i)/2
    Ans += (K+i)*N - 2*t +1
  return(int(Ans%mod))

print(cul(N,K))
Problem p03699 (python)

Fixed submission:
N = int(input())
s = [int(input()) for i in range(N)]
sums = sum(s)
others = list(filter(lambda x: x % 10, s))
if sums % 10:
    print(sums)
elif others != []:
    print(sums-min(others))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [int(input()) for i in range(N)]
sums = sum(s)
others = filter(lambda x: x% 10, s)
if sums % 10:
    print(sums)
elif list(others) != []:
    print(sums-min(others))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [int(input()) for i in range(N)]
sums = sum(s)
others = filter(lambda x: x% 10, s)
if sums % 10:
    print(sums)
elif others:
    print(sums-min(others))
else:
    print(0)
Problem p03844 (python)

Fixed submission:
A, op, B = input().split()
if op == '+':
    print(int(A) + int(B))
if op == '-':
    print(int(A) - int(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
M = N//2
if N % 2 == 1 and A.count(0) == 1 and all(A.count(i*2+2)==2 for i in range(M)):
    print((2 ** M) % (10**9+7))
elif N % 2 == 0 and all(A.count(i*2+1)==2 for i in range(M)):
    print((2 ** M) % (10**9+7))
else:
    print(0)
Problem p03846 (python)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
M = N//2
c = Counter(A)
if N % 2 == 1 and A.count(0) == 1 and all(c[i*2+2] == 2 for i in range(M)):
    print((2 ** M) % (10**9+7))
elif N % 2 == 0 and all(c[i*2+1]==2 for i in range(M)):
    print((2 ** M) % (10**9+7))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math

N = int(input())
A = list(map(int, input().split()))
if N % 2 == 1 and A.count(0) == 1 and np.all(A.count(i*2+2)==2 for i in range(N//2)):
    print(int(math.fmod(math.pow(2, N//2), (math.pow(10, 9) + 7))))
elif N % 2 == 0 and np.all(A.count(i*2+1)==2 for i in range(N//2)):
    print(int(math.fmod(math.pow(2, N//2), (math.pow(10, 9) + 7))))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math

N = int(input())
A = list(map(int, input().split()))
if N % 2 == 1 and A.count(0) == 1 and np.all(A.count(i*2+2)==2 for i in range(N//2)):
    print(np.int64(np.remainder(math.pow(2, N//2), (math.pow(10, 9) + 7))))
elif N % 2 == 0 and np.all(A.count(i*2+1)==2 for i in range(N//2)):
    print(np.int64(np.remainder(math.pow(2, N//2), (math.pow(10, 9) + 7))))
else:
    print(0)
Problem p02783 (python)

Fixed submission:
h, a = input().split()
h = int(h)
a = int(a)
ans = h // a + (0 if h % a == 0 else 1)
print(ans)

Buggy submission (verdict: Runtime Error):
h, a = input().split()
print(h // a)
Problem p02945 (python)

Fixed submission:
a, b = map(int, input().split())
print(max(a + b, a - b, a * b))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max(a + b, a - b, a * b)
Problem p02999 (python)

Fixed submission:
x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x, a = map(input().split())
if x < a:
  print(0)
else:
  print(10)
Problem p02784 (python)

Fixed submission:
h,n = map(int,input().split())
a = list(map(int,input().split()))
if sum(a)>= h:
         print("Yes")
else:
         print("No")

Buggy submission (verdict: Runtime Error):
h,n = map(int,input().split())
a = list(map(int,input().split()))
x = max(a)
a.remove(x)
y = max(a)
if x+y >= h:
         print("Yes")
else:
         print("No")

Buggy submission (verdict: Runtime Error):
h,n = map(int,input().split())
a = list(map(int,input().split()))
x = max(a)
a.remove(x)
y = max(a)
print(h,x,y)
if x+y >= h:
         print("Yes")
else:
         print("No")
Problem p02921 (python)

Fixed submission:
x = input()
y = input()
num = 0
for i in range(3):
    if x[i] == y[i]:
        num = num + 1
    else:
        num = num
print(num)

Buggy submission (verdict: Runtime Error):
x,y,z = input().split()
a,b,c = input().split()
lst1 = [x,y,z]
lst2 = [a,b,c]
num = 0
for i in range(3):
    if lst1[i] == lst2[i]:
        num = num + 1
    else:
        num = num
print(num)
Problem p02922 (python)

Fixed submission:
A, B = map(int, input().split())
cnt = 1
while A*cnt-(cnt-1) < B:
  cnt +=1
print(cnt if B > 1 else 0)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
cnt = 0
for i in range(1,B+1):
    if  B == 1:
        cnt = 1
        a = 0
        break
    elif count == 0 and A >= B:
        cnt = 1
        a = 1
        break
    elif (A-1)*(i-1)+A >=B:
        a = i
        break
print(a)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
cnt = 0
for i in range(1,B+1):
    if  B == 1:
        cnt = 1
        a = 0
        break
    elif count == 0 and A >= B:
        cnt = 1
        a = 1
        break
    elif (A-1)*(i-1)+A >= B:
        a = i
        break
print(a)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
count = 0
for i in range(1,B):
    if count == 0 and A >= B:
        count = 1
        a = 1
        break
    if (A-1)*(i-1)+A >= B:
        a = i
        break
print(a)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
count = 0
for i in range(1,B):
    if count == 0 and A == B:
        count = 1
        a = 1
        break
    if (A-1)*(i-1)+A >= B:
        a = i
        break
print(a)
Problem p02994 (python)

Fixed submission:
n,l = map(int,input().split())
lst = 0
if l>=0:
    for i in range(1,n+1):
        lst+=l+(i-1)
    a = lst - l
elif l < 0 and l+n-1 >=0:
        for i in range(1,n+1):
            lst+=l+(i-1)
        a = lst
elif l+n-1 <0:
    for i in range(1,n+1):
        lst+=l+(i-1)
    a = lst - (l+n-1)
print(a)

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
lst = 0
if l>=0:
    for i in range(1,n+1):
        lst+=l+(i-1)
    a = lst - l
if l < 0 and l+n >=0:
        for i in range(1,n+1):
            if l+i-1 == 0:
                lst+=l+(i-1)
                a = lst
if l+n <0:
    for i in range(1,n+1):
        lst+=l+(i-1)
        a = lst - (l+n-1)
print(a)
Problem p02705 (python)

Fixed submission:
import math

R = int(input())
print(2 * math.pi * R)

Buggy submission (verdict: Runtime Error):
import math

R = int(input())
return 2 * math.pi * R

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

for line in fileinput.input():
    return 2 * math.pi * line
Problem p02706 (python)

Fixed submission:
#b
n,m=[int(i)for i in input().split()]

arr=[int(i)for i in input().split()]
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)

Buggy submission (verdict: Runtime Error):
#b
n,m=[int(i)for i in input().split()]

  arr=[int(i)for i in input().split()]
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)

Buggy submission (verdict: Runtime Error):
#b
n,m=[int(i)for i in input().split()]
arr=[]
for i in range(m):
  x=int(input())
  arr.append(x)
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)
Problem p02706 (python)

Fixed submission:
n_m = input().rstrip().split(' ')

n = int(n_m[0])
m = int(n_m[1])

a_i = input().rstrip().split(' ')
a_i_list = [int(i) for i in a_i[:m]]

finish_day = sum(a_i_list)

if n >= finish_day:
  ans = n - finish_day
  print(ans)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
n_m = input().rstrip()

n = int(n_m[0])
m = int(n_m[1])

a_i = input().rstrip().split(' ')
a_i_list = [int(i) for i in a_i[m]]

finish_day = sum(a_i_list)

if n >= finish_day:
  ans = n - finish_day
  print(ans)
else:
  print('-1')