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

Fixed submission:
N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] - B * T > 0:
            num += (H[i] - B * T) // (A - B)
            num += int((H[i] - B * T) % (A - B) != 0)
    return T >= num


left, right = 0, 10 ** 9 + 1
mid = (left + right) // 2
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(right)

Buggy submission (verdict: Runtime Error):
import math
N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] >= B * T:
            num += math.ceil((H[i] - B * T) / (A - B))
    return T > num


left, right = 1, max(H) // B + 1
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(mid)

Buggy submission (verdict: Runtime Error):
import math
N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] >= B * i:
            num += math.ceil((H[i] - B * T) / (A - B))
    return T > num


left, right = 1, max(H) // B + 1
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(mid)
Problem p03773 (python)

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

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

Buggy submission (verdict: Runtime Error):
a, b = map(it, inpput().split())
print((a + b) % 24)
Problem p03921 (python)

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

parent = [i for i in range(N + M)]
rank = [0] * (N + M)


def find(i):
    if parent[i] == i:
        return i
    else:
        parent[i] = find(parent[i])
        return parent[i]


def same(x, y):
    return find(x) == find(y)


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return

    if rank[x] > rank[y]:
        parent[y] = x
    else:
        parent[x] = y
        if rank[x] == rank[y]:
            rank[y] += 1


for i in range(N):
    P = list(map(int, input().split()))
    n = P[0]
    for j in range(1, n + 1):
        unite(i, P[j] - 1 + N)


k = find(0)
for i in range(N):
    if k != find(i):
        print('NO')
        exit()

print('YES')

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

parent = [i for i in range(N + M)]
rank = [0] * (N + M)


def find(i):
    if parent[i] == i:
        return i
    else:
        parent[i] = find(parent[i])
        return parent[i]


def same(x, y):
    return find(x) == find(y)


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return

    if rank[x] > rank[y]:
        parent[y] = x
    else:
        parent[x] = y
        if rank[x] == rank[y]:
            rank[y] += 1


for i in range(N):
    P = list(map(int, input().split()))
    n = P[0]
    for j in range(1, n + 1):
        unite(N + i, P[j] - 1)


k = find(0)
for i in range(N):
    if k != find(i):
        print('NO')
        exit()

print('YES')
Problem p03938 (python)

Fixed submission:
N = int(input())
p = list(map(lambda x: int(x) - 1, input().split()))
r = {}
for i in range(N):
    r[p[i]] = i + 1

A = [30000 * i for i in range(1, N + 1)]
B = [30000 * (N - i) + r[i - 1] for i in range(1, N + 1)]
print(*A)
print(*B)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(lambda x: int(x) - 1, input().split()))
r = {}
for i in range(N):
    r[p[i]] = i

A = [30000 * i for i in range(1, N + 1)]
B = [30000 * (N - i) + r[i] for i in range(1, N + 1)]
print(A)
print(B)
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
print(((a + b) * c) // 2)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(((a + b) * h) // 2)
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(min(k, n) * x + max(0, n - k) * y)

Buggy submission (verdict: Runtime Error):
n, a = map(int, input().split())
x = list(map(int, input().split()))
X = max(max(x), a)
dp = [[[0] * (n * X + 1) for i in range(n + 1)] for j in range(n + 1)]
dp[0][0][0] = 1
for i in range(1, n + 1):
    for j in range(n + 1):
        for s in range(n * X + 1):
            if s < x[i - 1]:
                dp[i][j][s] = dp[i - 1][j][s]
            elif j >= 1 and x[i - 1] <= s:
                dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - x[i - 1]]

num = 0
for i in range(1, n + 1):
    num += dp[n][i][i * a]

print(num)
Problem p04014 (python)

Fixed submission:
N = int(input())
S = int(input())


def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n // b) + n % b


if N == S:
    print(N + 1)
    exit()
elif N < S:
    print(-1)
    exit()

num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)

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


def f(b, n):
    s = 0
    while n > 0:
        s += n % b
        n //= b
    return s


num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)

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


def f(b, n):
    s = 0
    while n > 0:
        s += n % b
        n //= b
    return s


num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(1, int(N ** 0.5) + 1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)
Problem p03481 (python)

Fixed submission:
X, Y = map(int, input().split())
cnt = 0
while X <= Y:
  cnt += 1
  X *= 2
print(cnt)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
cnt = 0
while X <= Y
  cnt += 1
  X *= 2
print(cnt)
Problem p04043 (python)

Fixed submission:
A = sorted(list(map(int, input().split())))
print("YES" if A == [5,5,7] else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if 5, 7, 5 == map(int, input().split()) else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if 5, 7, 5 == map(int, input().split()) else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" is 5, 7, 5 == list(map(int, input().split())) else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" is 5, 7, 5 == map(int, input().split()) else "NO")
Problem p02928 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

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

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

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    if(a[i] > a[j]):
      c += 1
      d += 1
    elif(a[i] < a[j]):
      d += 1


ans = int(c * k % MOD) + int( (k *(k-1)//2) % MOD * d)
ans = int(ans%MOD)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**30)

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

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

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    if(a[i] > a[j]):
      c += 1
      d += 1
    elif(a[i] < a[j]):
      d += 1


ans = int(c * k % MOD) + int( (k *(k-1)/2) % MOD * d)
ans = int(ans%MOD)

print(ans)

Buggy submission (verdict: Runtime Error):

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

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
    for j in range(i+1,n):
      if(a[i] > a[j]):
        c += 1
        d += 1
      elif(a[i] < a[j]):
        d += 1


ans = int(c * k % MOD) + int( int((k *(k-1)/2) % MOD) * d)
ans = int(ans%MOD)

print(ans)
Problem p02936 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

def addc(p,b):
  for i in e[p]:
    if(i == b):
      continue
    c[i] += c[p]
    addc(i,p)

n,q = map(int,input().split())

e = [ [] for i in range(n + 1)]
c = [0]*(n+1)

for i in range(n-1):
  a,b = map(int,input().split())
  e[a].append(b)
  e[b].append(a)

for i in range(q):
  p,x = map(int,input().split())
  c[p] += x

addc(1,-1)

print(*c[1:])

Buggy submission (verdict: Runtime Error):
def addc(p,ko,c,total):
  c[p] += total
  total = c[p]
  if(len(ko[p]) == 0):
    return 0

  else:
    for i in ko[p]:
      addc(i,ko,c,total)

  return 0

n,q = map(int,input().split())

ko = [ [] for i in range(n + 1)]
c = [0 for i in range(n + 1)]

for i in range(n-1):
  a,b = map(int,input().split())
  ko[a].append(b)

for i in range(q):
  p,x = map(int,input().split())
  c[p] += x

_ = addc(1,ko,c,0)

c.pop(0)

print(*c)

Buggy submission (verdict: Runtime Error):
def addc(p,ko,c,total):
  c[p] += total
  total = c[p]
  if(len(ko[p]) == 0):
    return 0

  else:
    for i in ko[p]:
      addc(i,ko,c,total)

  return 0

n,q = map(int,input().split())

ko = [ [] for i in range(n + 1)] # 各頂点に紐づく子
c = [0 for i in range(n + 1)] # 各頂点のCの値

for i in range(n-1):
  a,b = map(int,input().split())
  ko[a].append(b) # 親a -> 子bに向かう辺がある

for i in range(q):
  p,x = map(int,input().split())
  c[p] += x # 操作により指定されている頂点にxを加える

_ = addc(1,ko,c,0)

c.pop(0)

print(*c)

Buggy submission (verdict: Runtime Error):
def adx(p,oya,tox,total):
  tox[p] += total
  total = tox[p]
  if(len(oya[p]) == 0):
    return 0

  else:
    for i in oya[p]:
      adx(i,oya,tox,total)

  return 0

n,q = map(int,input().split())

oya = [ [] for i in range(n + 1)]
tox = [0 for i in range(n + 1)]

for i in range(n-1):
  a,b = map(int,input().split())
  oya[a].append(b)

for i in range(q):
  p,x = map(int,input().split())
  tox[p] += x

_ = adx(1,oya,tox,0)

tox.pop(0)

print(*tox)

Buggy submission (verdict: Runtime Error):
def adx(p,oya,tox,total):
  tox[p] += total
  total = tox[p]
  if(len(oya[p]) == 0):
    return 0

  else:
    for i in oya[p]:
      adx(i,oya,tox,total)

  return 0

n,q = map(int,input().split())

oya = [ [] for i in range(n + 1)]
tox = [0 for i in range(n + 1)]

hit = list(range(1,n+1))

for i in range(n-1):
  a,b = map(int,input().split())
  oya[a].append(b)

for i in range(q):
  p,x = map(int,input().split())
  tox[p] += x


adx(1,oya,tox,0)

tox.pop(0)

print(*tox)

Buggy submission (verdict: Runtime Error):
def adx(p,oya,tox,total):
  tox[p] += total
  total = tox[p]
  if(len(oya[p]) == 0):
    return 0

  else:
    for i in oya[p]:
      adx(i,oya,tox,total)

  return 0

n,q = map(int,input().split())

oya = [ [] for i in range(n + 1)]
tox = [0 for i in range(n + 1)]

hit = list(range(1,n+1))

for i in range(n-1):
  a,b = map(int,input().split())
  oya[a].append(b)

for i in range(q):
  p,x = map(int,input().split())
  tox[p] += x


adx(1,oya,tox,0)

tox.pop(0)

print(*tox)
Problem p02981 (python)

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

print(min(n*a,b))

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())
diff = r - l

if(diff >= 2019):
  print(0)
else:
  lmod = l % 2019
  rmod = r % 2019
  if(rmod  < lmod):
    print(0)
  else:
    ans =2020
    for i in range(l,r+1):
      for j in range(i+1,r+1):
        print("{} {}".format(i,j))
        if((i*j) % 2019 < ans):
          ans = (i*j) % 2019
    print(ans)
Problem p03079 (python)

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

if(a == b == c):
  print("Yes")
else:
  print("No")

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

if(a = b = c):
  print("Yes")
else:
  print("No")
Problem p03241 (python)

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

max_num = int(m/n)
ans = -1
for i in reversed(range(max_num + 1)):
  if(m % i == 0):
    ans = i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,m =map(int,input().split())
a = int(m/n)
b = m%n
print(math.gcd(a,b))
Problem p03266 (python)

Fixed submission:
import math

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

ans = int(math.pow(int(n/k),3))

if(k % 2 == 0):
  m = int( (n+int(k/2))/ k )
  ans += int(math.pow(m,3))

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())
a = int(n/k)
if(a < 2):
    b = 0
else:
    b = math.factorial(a) // (math.factorial(a - 2) * 2)
if(a < 3):
    c = 0
else:
    j = math.factorial(a-3)
    c = math.factorial(a) // j * 6
ans = a + b * 6 + c * 6
if(k % 2 == 0):
    t = int(k / 2)
    if(a * k + t > n):
      ans = ans * 2
    else:
      d = a + 1
      if(d < 2):
          e = 0
      else:
          e = math.factorial(d) // j * 2
      if(d < 3):
          f = 0
      else:
          f = math.factorial(d) // (math.factorial(d - 3) * 6)
      ans += (d + e * 6 + f * 6)
print(ans)
Problem p03352 (python)

Fixed submission:
x = int(input())

num = list(range(2,32))

ans = 1
for i in range(len(num)):
  now = num[i]
  while now < x:
    now = now*num[i]
    if(now <= x and ans <= now):
      ans = now
print(ans)

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

sosu = [2,3,5,7,11,13,17,19,23,29,31]

if(x==1):
  print(1)
else:
  ans = 1
  for i in range(len(sosu)):
    now = sosu[i]
    for j in range(1,11):
      now = now*sosu[i]
      if(now <= x and ans <= now):
        ans = now
      elif(now >= x):
        break

print(ans)
Problem p02848 (python)

Fixed submission:
def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            0: 'A',
            1: 'B',
            2: 'C',
            3: 'D',
            4: 'E',
            5: 'F',
            6: 'G',
            7: 'H',
            8: 'I',
            9: 'J',
            10: 'K',
            11: 'L',
            12: 'M',
            13: 'N',
            14: 'O',
            15: 'P',
            16: 'Q',
            17: 'R',
            18: 'S',
            19: 'T',
            20: 'U',
            21: 'V',
            22: 'W',
            23: 'X',
            24: 'Y',
            25: 'Z',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


n = int(input().strip())
s = input().strip()
print(solve(n, s))

Buggy submission (verdict: Runtime Error):
def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            0: 'A',
            1: 'B',
            2: 'C',
            3: 'D',
            4: 'E',
            5: 'F',
            6: 'G',
            7: 'H',
            8: 'I',
            9: 'J',
            10: 'K',
            11: 'L',
            12: 'M',
            13: 'N',
            14: 'O',
            15: 'P',
            16: 'Q',
            17: 'R',
            18: 'S',
            19: 'T',
            20: 'U',
            21: 'V',
            23: 'W',
            24: 'X',
            25: 'Y',
            26: 'Z',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


n = int(input().strip())
s = input().strip()
print(solve(n, s))
Problem p02888 (python)

Fixed submission:
import bisect


def solve(ls) -> int:
  n = len(ls)
  assert(3 <= n <= 2 * 10**3)

  def n_possible_cs(a: int, b: int, first_ic: int) -> int:
    # def bin_search_le_rightmost(s: int, e: int, target: int):
    #   if s == e:
    #     if ls[s] > target:
    #       return None
    #     else:
    #       return s
    #
    #   mid = s + (e - s) // 2
    #
    #   if ls[mid] <= target and (mid + 1 < n and ls[mid + 1] > target):
    #     return mid
    #   elif ls[mid] <= target:
    #     return bin_search_le_rightmost(mid + 1, e, target)
    #   else:
    #     return bin_search_le_rightmost(s, mid, target)

    idx = bisect.bisect_left(ls, a + b, first_ic)
    return 0 if idx == first_ic else idx - first_ic

  ret = 0
  for ia in range(0, n - 2):
    for ib in range(ia + 1, n - 1):
      a, b = (ls[ia], ls[ib])
      x = n_possible_cs(a, b, ib + 1)
      ret += x
  return ret


n = int(input().strip())
ls = [int(l) for l in input().split()]

print(solve(sorted(ls)))

Buggy submission (verdict: Runtime Error):
import bisect
from typing import List


def solve(ls: List[int]) -> int:
  n = len(ls)
  assert(3 <= n <= 2 * 10**3)

  def n_possible_cs(a: int, b: int, first_ic: int) -> int:
    # def bin_search_le_rightmost(s: int, e: int, target: int):
    #   if s == e:
    #     if ls[s] > target:
    #       return None
    #     else:
    #       return s
    #
    #   mid = s + (e - s) // 2
    #
    #   if ls[mid] <= target and (mid + 1 < n and ls[mid + 1] > target):
    #     return mid
    #   elif ls[mid] <= target:
    #     return bin_search_le_rightmost(mid + 1, e, target)
    #   else:
    #     return bin_search_le_rightmost(s, mid, target)

    idx = bisect.bisect_left(ls, a + b, first_ic)
    return 0 if idx == first_ic else idx - first_ic

  ret = 0
  for ia in range(0, n - 2):
    for ib in range(ia + 1, n - 1):
      a, b = (ls[ia], ls[ib])
      x = n_possible_cs(a, b, ib + 1)
      ret += x
  return ret


# n = int(input().strip())
# ls = [int(l) for l in input().split()]
#
# print(solve(sorted(ls)))

print(solve(sorted([218, 786, 704, 233, 645, 728, 389])))
Problem p03110 (python)

Fixed submission:

n = int(input())

xlist=[]
sum=0
for i in range(n):
    xlist.append(input().split())
    if xlist[i][1] == "BTC":
        sum = sum + float(xlist[i][0])*380000
    else:
        sum = sum + float(xlist[i][0])

print(sum)

Buggy submission (verdict: Runtime Error):

n = int(input())

xlist=[]
sum=0
for i in range(n):
    xlist.append(input().split())
    if xlist[i][1] == "BTC":
        sum = sum + int(xlist[i][0])*380000
    else:
        sum = sum + int(xlist[i][0])

print(sum)
Problem p03146 (python)

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

i=0
while(True):
    if mlist[i] % 2 == 0:
        mlist.append(mlist[i]/2)
    else:
        mlist.append(3*mlist[i]+1)
    
    breakFlg = False
    for num in range(0,i):
        if int(mlist[num])==int(mlist[i]):
            if num!=i:
                breakFlg = True
    i=i+1
    if(breakFlg):
        break
print(i)

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

i=0
while(True):
    i=i+1
    if mlist[i] % 2 == 0:
        mlist.append(mlist[i]/2)
    else:
        mlist.append(3*mlist[i]+1)
    for item in range(1,i):
        if mlist[0]==item:
            break
print(i)

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

mlist=[n]
i=0
while(True):
    i=i+1
    if n % 2 == 0:
        mlist.append(n/2)
    else:
        mlist.append(3*n+1)
    for item in mlist:
        if mlist[0]==item:
            break

print(i)
Problem p02861 (python)

Fixed submission:
import numpy
import itertools
import math

n = int(input())
town_list = []
for i in range(n):
	x, y = map(int, input().split())
	town_list.append([x, y])

pattern_list = list(itertools.permutations(town_list, n))

a = int(math.factorial(n))

sum = 0
for j in range(a):
	for k in range(n-1):
		# sum += numpy.linalg.norm(pattern_list[j][k+1] - pattern_list[j][k])
		x1 = pattern_list[j][k][0]
		x2 = pattern_list[j][k+1][0]
		y1 = pattern_list[j][k][1]
		y2 = pattern_list[j][k+1][1]
		sum += math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

print(sum/a)

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

n = int(input())
town_list = []
for i in range(n):
	x, y = map(int, input().split())
	town_list.append(numpy.array([x, y]))

pattern_list = list(itertools.permutations(town_list, n))

a = int(math.factorial(n))

sum = 0
for j in range(a):
	for k in range(n-1):
		x1 = pattern_list[j][k][0]
		x2 = pattern_list[j][k+1][0]
		y1 = pattern_list[j][k][1]
		y2 = pattern_list[j][k+1][1]
		sum += math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

print(sum/a)
Problem p03151 (python)

Fixed submission:
import numpy as np

n=int(input())
a=np.array(list(map(int,input().split())))
b=np.array(list(map(int,input().split())))

c=[]
for i in range(n):
    c.append(a[i] - b[i])

c.sort(reverse=True)
d=np.array(c)
z=np.sum(d < 0)

x=np.sum(d[ d < 0])
y=np.sum(d[ d > 0])

if x == 0:
    print("0")
    exit()

if x + y < 0:
    print("-1")
    exit()    

for i,num in enumerate(c):
    x += num
    if x >= 0:
        print(z+i+1)
        exit()

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

n=int(input())
a=np.array(list(map(int,input().split())))
b=np.array(list(map(int,input().split())))

c=[]
for i in range(n):
    c.append(a[i] - b[i])

c.sort(reverse=True)
d=np.array(c)
z=np.sum(d < 0)

x=np.sum(d[ d < 0])
y=np.sum(d[ d > 0])

if x == 0:
    print("0")
    exit()

if x + y < 0:
    print("-1")
    exit()    

for i,num in enumerate(c)
    x += num
    if x >= 0:
        print(z+i+1)
Problem p03155 (python)

Fixed submission:
n=int(input())
h=int(input())
w=int(input())

print( (n - h + 1) * (n - w + 1))

Buggy submission (verdict: Runtime Error):
n,h,w=map(int, input() for i in range(3))
 
print( (n - h + 1) * (n - w + 1))
Problem p03192 (python)

Fixed submission:
print(input().count("2"))

Buggy submission (verdict: Runtime Error):
import math

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

def C(N,P):
    if N == 1: return P
    b=int(math.log2(N))
    a=P**(1/b)

    res=1
    for i in range(2,int(a)+2):
        if i**N > P : break
        if P % i**N == 0 : res = i

    return res

print(C(n,p))

Buggy submission (verdict: Runtime Error):
import math

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

def C(N,P):
    if N == 1: return P
    a=P
    N1=2
    while N >= N1:
        N1*=2
        a=math.sqrt(a)

    res=1
    for i in range(2,int(a)+2):
        if i**N > P : break
        if P % i**N == 0 : res = i

    return res

print(C(n,p))

Buggy submission (verdict: Runtime Error):
import math

N,P=map(int,input().split())
a=math.sqrt(P)
if N > 3 :
    b=math.sqrt(a)
    a=b

res=1
for i in range(1,int(a)+1):
    if P % i**N: continue
    res = i

print(res)

Buggy submission (verdict: Runtime Error):
import math

N,P=map(int,input().split())
a=math.sqrt(P)
if N > 3 : a=math.sqrt(a)

res=1
for i in range(1,int(a)+1):
    if P % i**N: continue
    res = i

print(res)