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

Fixed submission:
import sys

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
print(0, flush=True)
re[0] = input()
if re[0] == "Vacant":
  sys.exit()
print(n-1, flush=True)
re[n-1] = input()
if re[n-1] == "Vacant":
  sys.exit()
print(mid, flush=True)
re[mid] = input()
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  print(mid, flush=True)
  re[mid] = input()
else:
  sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush

# クエリ: "? x1 x2" を出力
def query(x1):
    write("? %d\n" % (x1))
    flush()
    # ジャッジから返される値を取得
    return input()

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
re[0] = query(0)
if re[0] == "Vacant":
  sys.exit()
re[mid] = query(mid)
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  re[mid] = query(mid)
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush

# クエリ: "? x1 x2" を出力
def query(x1):
    write("? %d\n" % (x1))
    flush()
    # ジャッジから返される値を取得
    return readline().split()

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
re[0] = query(0)
if re[0] == "Vacant":
  exit()
re[mid] = query(mid)
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  re[mid] = query(mid)
exit()

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush

# クエリ: "? x1 x2" を出力
def query(x1):
    write("? %d\n" % (x1))
    flush()
    # ジャッジから返される値を取得
    return readline()

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
re[0] = query(0)
if re[0] == "Vacant":
  exit()
re[mid] = query(mid)
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  re[mid] = query(mid)
exit()
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500+j*100+k*50 == x:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i+*500+j*100+k*50 == x:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i+*500+j*100+k*50 == x:
        ans += 1
Problem p03455 (python)

Fixed submission:
a,b = map(int, input().split())
print("Even") if (a * b) % 2 == 0 else print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
print("Even") if (a * b) % 2 == 0: else print("Odd")
Problem p03456 (python)

Fixed submission:
a,b = input().split()
c = int(a + b)
d = []
for i in range(400):
  d.append(i**2)
if c in d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b = input(),input()
c = int(a+b)
d = math.sqrt(c)
if c / d == d:
  print("Yes")

Buggy submission (verdict: Runtime Error):
import math
a,b = input(),input()
c = int(a+b)
d = math.sqrt(c)
if c / d = d:
  print("Yes")
Problem p03463 (python)

Fixed submission:
n,a,b = map(int, input().split())
c = b-a
if c % 2 == 0:
  print("Alice")
elif c % 2 == 1:
  print("Borys")

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
if b - a % 2 == 0:
  print("Alice")
elif b - a % 2 == 1
  print("Borys")

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
if b - a % 2 == 0:
  print("Alice")
elif b - a % 2 == 1
  print("Borys")
Problem p03471 (python)

Fixed submission:
n, y = map(int, input().split())
for i in range(0, n+1):
  for j in range(0, n+1-i):
    k = n - i - j
    if 10000 * i + 5000 * j + 1000 * k == y:
      print(i, j, k)
      exit()
print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(0, n+1):
  for j in range(0, n+1-a):
    k = n - i - j
    if 10000 * i + 5000 * j + 1000 * k == y:
      print(i, j, k)
      exit()
print(-1, -1, -1)
Problem p03472 (python)

Fixed submission:
import math
n,h = map(int, input().split())
a = []
b = []
for i in range(n):
  a1,b1 = map(int, input().split())
  a.append(a1)
  b.append(b1)
b.sort()
max_a = max(a)
ans = 0
for i in b[::-1]:
  if i > max_a:
    h -= i
    ans += 1
  else:
    break
  if h <= 0:
    print(ans)
    exit()
ans += math.ceil(h/max_a)
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
n,h = map(int, input().split())
a = []
b = []
for i in range(n):
  a1,b1 = map(int, input().split())
  a.append(a1)
  b.append(b1)
b.sort()
max_a = max(a)
ans = 0
for i in b[::-1]:
  if i > max_a:
    h -= i
    ans += 1
  else:
    break
  if h <= 0:
    print(ans)
    exit()
ans += math.ceil(h/max_a)
print(ans)
Problem p03548 (python)

Fixed submission:
x,y,z = map(int, input().split())
print((x-z)//(y+z))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
print((x-z)//(y+z))
Problem p03583 (python)

Fixed submission:
N = int(input())
for h in range(1,3501):
  for n in range(1,3501):
    a = 4 * h * n - N * (h + n)
    if a > 0:
      w,b = divmod(N * h * n, a)
      if b == 0:
        print(h,n,w)
        exit()

Buggy submission (verdict: Runtime Error):
N = int(input())
for h in range(1,3501):
  for n in range(1,3501):
    a = 4 * h * n - N * (h + n)
    if a > 0:
      w,b = divmod(N * h * n, mod)
      if b == 0:
        print(h,n,w)
        exit()
Problem p03632 (python)

Fixed submission:
a,b,c,d = map(int, input().split())
print(max(0,min(b,d)-max(a,c)))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
print(max(0,min(b,d)-max(a,c))
Problem p03645 (python)

Fixed submission:
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
one=[0 for i in range(n)]
ans = "IMPOSSIBLE"
for i in a:
  if i[0] == 1:
    if one[i[1]] == 1:
      ans = "POSSIBLE"
      break
    else:
      one[i[1]] = 1
  elif i[1] == n:
    if one[i[0]] == 1:
      ans = "POSSIBLE"
      break
    else:
      one[i[0]] = 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
one = [0 for i in range(n)]
ans = "IMPOSSIBLE"
for i in a:
  if i[0] == 1:
    if one[i[1]] == 1:
      ans = "POSSIBLE"
      break
    else:
      one[i[1]] = 1
  elif i[1] == n:
    if one[i[0]] == 1:
      ans = "POSSIBLE"
      break
    else:
      one[i[0]] = 1
print(ans)
Problem p03646 (python)

Fixed submission:
k = int(input())
n = 50
b,c = k % n, k // n
ans = [n + c] * (b) + [n + c - b - 1] * (n - b)
print(n)
print(*ans)

Buggy submission (verdict: Runtime Error):
N=50;k,s=divmod(int(input()),N);d=n-s;print(N);print(*[N+k]*s+[d+k-1]*d)
Problem p03658 (python)

Fixed submission:
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a.reverse()
print(sum(a[:m]))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a.reversed()
print(sum(a[:m]))
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
now = 0
ans = -1
for i in range(n):
  value = a[now]
  if value == 2:
    ans = i+1
    break
  now = value - 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
now = 0
ans = -1
for i in range(n):
  value = a[now]
  if value == 2:
    ans = i+1
    break
  now = value
print(ans)
Problem p03693 (python)

Fixed submission:
a,b,c = input().split()
d = int(a+b+c)
print("YES") if d % 4 == 0 else print("NO")

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
colored = [0,0,0,0,0,0,0,0]
god = 0
for i in a:
  if i >= 3200:
    god += 1
  else:
    colored[i // 400] += 1
color = 8 - colored.count(0)
if color == 0:
  print(1,god)
else:
  print(color, color+god)

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
d = a+b+c
print("YES") if d % 4 == 0 else print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
print(s[-1]-s[0])
Problem p03697 (python)

Fixed submission:
a,b = map(int,input().split())
print ("error") if a+b >=10 else print(a+b)

Buggy submission (verdict: Runtime Error):
s = input()
a = [i for i in s]
s = sorted(a)
b = 1
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    b = 0
print("yes") if b = 1 else print("no")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print "error" if a+b >=10 else print(a+b)
Problem p03698 (python)

Fixed submission:
s = input()
a = [i for i in s]
s = sorted(a)
b = 1
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    b = 0
print("yes") if b == 1 else print("no")

Buggy submission (verdict: Runtime Error):
s = input()
a = [i for i in s]
s = sorted(a)
b = 1
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    b = 0
print("yes") if b = 1 else print("no")

Buggy submission (verdict: Runtime Error):
s = input()
a = [i for i in s]
s = sorted(a)
b = 1
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    b = 0
    break
print("yes") if b = 1 else print("no")
Problem p03711 (python)

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

Buggy submission (verdict: Runtime Error):
x,y = map(int, input().split())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
if (x in a and y in a) or x (in b and y in b):
  print("Yes")
else:
  print("No")
Problem p03720 (python)

Fixed submission:
n,m = map(int, input().split())
c = [0]*n
for i in range(m):
  a,b = map(int, input().split())
  c[a-1] += 1
  c[b-1] += 1
for i in c:
  print(i)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
c = [0]*n
for i in range(m):
  a,b = map(int, input().split())
  c[a] += 1
  c[b] += 1
for i in c:
  print(i)
Problem p03795 (python)

Fixed submission:
n = int(input())
print(800 * n - (n // 15) * 200)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
seed1 = ["S","W"]
ans = ["SS","SW","WS","WW"]
for i in s[1:]:
    for k,v in enumerate(ans):
        now = 0 if i == "o" else 1
        now = (now + seed1.index(v[-1]) + seed1.index(v[-2])) % 2
        if now:
            ans[k] += "W"
        else:
            ans[k] += "S"
for i in ans:
    now = 0 if i[0] == "o" else 1
    if (i[0] == i[-1]) and ((i[1] == i[-2]) ^ now):
        print(i[:-1])
        exit()
print(-1)
Problem p03830 (python)

Fixed submission:
import array
import textwrap
import math
mod = 10 ** 9 + 7
def prime(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes.tolist()

n = int(input())
a = prime(n+1)
ans = 1
for i in a:
  b = 0
  c = i
  while c <= n:
    b += n // c
    c = c * i
  b += 1
  ans *= b
  ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
import array
import textwrap
import math
mod = 10 ** 9 + 7
def prime(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes.tolist()

n = int(input())
a = prime(n)
ans = 1
for i in a:
  b = 0
  c = i
  while c <= n:
    b += n // c
    c = c * i
  b += 1
  ans *= b
  ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
import array
import textwrap
import math
mod = 10 ** 9 + 7
def prime(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes.tolist()

n = int(input())
a = prime(n)
ans = 1
print(a)
for i in a:
  b = 0
  c = i
  while c <= n:
    b += n // c
    c = c * i
  ans *= b + 1
  ans %= mod
print(ans)
Problem p03844 (python)

Fixed submission:
a,b,c = input().split()
a,c = int(a),int(c)
if b == "+":
  print(a+c)
else:
  print(a-c)

Buggy submission (verdict: Runtime Error):
a = int(input())
op = input()
b = int(input())
if op == "+":
  print(a+b)
else:
  print(a-b)
Problem p03848 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = True
mod = 10 ** 9 + 7
for i,j in enumerate(a):
  if n % 2:
    if j != ((i+1) // 2) * 2:
      b = False
      break
  else:
    if j != (i // 2) * 2 + 1:
      b = False
      break
if b == True:
  print(pow(2,n//2,mod))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = True
for i,j in enumerate(a):
  if n % 2:
    if j != ((i+1) // 2) * 2:
      b = False
      break
  else:
    if j != (i // 2) * 2 + 1:
      b = False
      break
if b == True:
  print(((n // 2) ** 2) % mod)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
mod = 10 ** 9 + 7
b = True
for i,j in enumerate(a):
  if n % 2:
    if j != ((i+1) // 2) * 2:
      b = False
      break
  else:
    if j != (i // 2) * 2 + 1:
      b = False
      break
print((n // 2) ** 2) % mod if b == True else print(0)
Problem p03852 (python)

Fixed submission:
a = input()
if a == "a" or a == "i" or a == "u" or a == "e" or a == "o":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
c = [input() for i in range(h)]
for i in c:
  print(i)
  print(i)
Problem p03853 (python)

Fixed submission:
h,w = map(int, input().split())
c = [input() for i in range(h)]
for i in c:
  print(i)
  print(i)

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
c = [list(map(int, input().split())) for i in range(h)]
for i in range(2):
  for j in c:
    print(*j)
Problem p03919 (python)

Fixed submission:
h,w = map(int, input().split())
s = [list(input().split()) for i in range(h)]
for key_i,i in enumerate(s):
  key_i += 1
  for key_j,j in enumerate(i):
    if j == "snuke":
      print(chr(ord("A")+key_j)+str(key_i))
      exit()

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
s = [list(map(int, input().split())) for i in range(h)]
for key_i,i in enumerate(s):
  key_i += 1
  for key_j,j in enumerate(i):
    if j == "snuke":
      print(chr(ord("A")+key_j)+str(key_i))
      exit()
Problem p03951 (python)

Fixed submission:
n = int(input())
a = input()
b = input()

for i in range(n):
  if i == 0:
    if a == b:
      print(n)
      exit()
  if a[i:] == b[:-i]:
    print(n+i)
    exit()
print(n*2)

Buggy submission (verdict: Runtime Error):
n,x = map(int, input().split())
if n != x:
  print("No")
else:
  print("Yes")
  for i in range(1, 2 * n):
    print(i)
Problem p03957 (python)

Fixed submission:
s = input()
c = len(s)
f = 0
for x,i in enumerate(s):
  if i == "C":
    c = min(c,x)
  elif i == "F":
    f = max(f,x)
if c < f:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
c = len(s)
f = 0
for i in s:
  if i == "C":
    c = min(c,i)
  elif i == "F":
    f = max(f,i)
if c < f:
  print("Yes")
else:
  print("No")
Problem p03967 (python)

Fixed submission:
s = input()
t_s = s.count("p")
a_s = len(s) // 2
print(a_s-t_s)

Buggy submission (verdict: Runtime Error):
s = input()
t_s = n.count("p")
a_s = len(s) // 2
print(a_s-t_s)
Problem p04019 (python)

Fixed submission:
n = set(list(input()))
if n == set(["N","S"]) or n == set(["W","E"]) or n == set(["N","S","W","E"]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
b = sorted(a[::2])
a.sort()
now = 0
ans = 0
br = (n+1) // 2
for k,v in enumerate(a):
  if b[now] == v:
    ans += abs(k-now*2)
    now += 1
  if now == br:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
n = set(list(input()))
if n == set("N","S") or n == set("W","E") or n == set("N","S","W","E")
  print("Yes")
else:
  print("No")
Problem p04043 (python)

Fixed submission:
a = list(map(int, input().split()))
if a.count(5) == 2 and a.count(7) == 1:
  print("YES")
else:
  print("NO")

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

mod = 10**9 + 7
n = 10**5 * 2 + 1

fact = [1]*(n+1)
rfact = [1]*(n+1)
r = 1
for i in range(1, n+1):
  fact[i] = r = r * i % mod
rfact[n] = r = pow(fact[n], mod-2, mod)
for i in range(n, 0, -1):
  rfact[i-1] = r = r * i % mod

# nPk (mod MOD) を求める
def perm(n, k):
  return fact[n] * rfact[n-k] % mod

# nCk (mod MOD) を求める
def comb(n, k):
  return fact[n] * rfact[k] * rfact[n-k] % mod 
ans = 0
for i in range(b,w):
  ans = (ans + comb(h-a-1+i,i) * comb(w-i+a-2,a-1)) % mod
print(ans)
Problem p02646 (python)

Fixed submission:
A,V=map(int,input().split())
B,W=map(int,input().split())
t=input()
T=int(t)

if abs(B-A)-(V-W)*T <=0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A,V=map(int,input().split())
B,W=map(int,input().split())
t=input()
T=int(t)

if (B-A)+(V-W)T <=0:
  print('YES')
else:
  print('NO')
Problem p02700 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
while a > 0 and c > 0:
  c -= b
  if c > 0:
    a -= d
    if a <= 0:
      print('No')
  else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while a > 0 and c > 0:
  c -= b
  if c > 0:
    a -= d
  else:
    print('Yes')
  if a <= 0
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while a > 0 and c > 0:
  c -= b
  if c > 0:
    a -= d
    if a <= 0:
    print('No')
  else:
    print('Yes')
Problem p02705 (python)

Fixed submission:
import math

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

Buggy submission (verdict: Runtime Error):
import math
r = input()
print(2 * math.pi * r)

Buggy submission (verdict: Runtime Error):
r = int(input())
print(2 * π * r)

Buggy submission (verdict: Runtime Error):
r = int(input())
print(2 * pi * r)

Buggy submission (verdict: Runtime Error):
r = int(input())
print(2 * pi * r)

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

print(2 * pi * r)
Problem p02717 (python)

Fixed submission:
X, Y, Z = input().split()
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X, Y, Z = input()
print(Z, X, Y)
Problem p02724 (python)

Fixed submission:
x = int(input())
HP = 0
FUCK = False

if x < 5:
  print(0)
  FUCK = True

while x >= 500:
  x -= 500
  HP += 1000

while x >= 5:
  x -= 5
  HP += 5

if not FUCK:
    print(HP)

Buggy submission (verdict: Runtime Error):
#include<iostream>
using namespace std;

int main() {
    int x;
    int HP = 0;
    bool FUCK = false;
    
    cin >> x;

    if(x < 5){
        cout << 0 << endl;
        FUCK = true;
    }
    
    while(x >= 500){
        HP += 1000;
        x -= 500;
    }
    
    while(x >= 5){
        HP += 5;
        x -= 5;
    }
        
    if(FUCK == false){
        cout << HP << endl;
    }
    
}

Buggy submission (verdict: Runtime Error):
x = input()
HP = 0
while x > 500:
  x -= 500
  HP += 1000
while x > 5:
  x -= 5
  HP += 5
if x < 5:
  print(0)
print(HP)
Problem p02767 (python)

Fixed submission:
# Initializing variables
people = int(input())
coordinates = list(map(int, input().split()))
max_ = max(coordinates)
min_ = min(coordinates)
ans = 0

# Calculating the minimum total of stamina
for i in range(min_, max_ + 1):
    currentMin = 0
    for j in range(people):
        currentMin += (coordinates[j] - i) ** 2
    if i == min_:
        ans = currentMin
    elif currentMin < ans:
        ans = currentMin
        
print(ans)

# Check out my Youtube channel! https://www.youtube.com/channel/UCMOKVyAbTZOpKikTrX5dy_A

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))
max_X = max(x)
maximum = 0

for i in range(0, max_X):
  for j in range(n):
    maxi += (x[j] - i) ** 2
  if maxi > maximum:
    maximum = maxi

print(maximum)
Problem p02783 (python)

Fixed submission:

h, a = input().split()
h = int(h)
a = int(a)
x = a
attack = 1

while h > x :
    h -= x
    attack += 1

print(attack)

Buggy submission (verdict: Runtime Error):
h = int(input())  # Monster health
a = int(input())  # Servant attack
x = a
attack = 1

while h > x :
    h -= x
    attack += 1

print(attack)
Problem p02783 (python)

Fixed submission:
import math
H,A = map(int,input().split())
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
H,A = int(input()),int(input())
if(H%A != 0): print((H//A) + 1)
else: print(H/A)
Problem p02582 (python)

Fixed submission:
S=input()
Sc=S.count("R")
SSc=S.count("RR")
if Sc==3:
  print(3)
elif SSc==1:
  print(2)
elif Sc==0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
S=input()
Sc=S.count("R")
SSc=S.count("RR")
if Sc==3:
  print(3)
elif SSc=1:
  print(2)
elif Sc==0:
  print(0)
else:
  print(1)
Problem p02952 (python)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1, N+1):
  	if len(str(i)) % 2 == 1:
        ans += 1

print(ans)
Problem p02993 (python)

Fixed submission:
S = input()

result = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        result += 1

if result == 0:
    print("Good")
else:
    print("Bad")

Buggy submission (verdict: Runtime Error):
S = input()
 
result = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        print("Bad")
    	break
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
S = input()
 
result = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        print("Bad")
    	break 
	else:
    	print("Good")

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

result = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        result += 1

if result == 0:
    print("Good")
else:
    print("Bad")
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0 for i in range(N + 1)]
bounding = 0
for i in range(N):
    D[i + 1] = D[i] + L[i]

for d in D:
    if d <= X:
        bounding += 1

print(bounding)

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

D = 0
bound_count = 0

i = 0
while D <= X:
    D += L[i]
    bound_count += 1
    i += 1

print(bound_count)