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

Fixed submission:
n= int(input())
a = list(int(i) for i in input().split())
import math
import sys

sta=sum(a)/2
sum=0
ans=0
for i in range(0,n-1):
    if sum==sta:
        print(0)
        sys.exit()
    elif sum<sta and sum+a[i]>sta:
        ans=min(sta-sum,sum+a[i]-sta)/0.5
        print(int(ans))
        sys.exit()
    else:
        sum+=a[i]

ans=min(sta-sum,sum+a[n-1]-sta)/0.5
print(abs(int(ans)))

Buggy submission (verdict: Runtime Error):
n= int(input())
a = list(int(i) for i in input().split())
import math
import sys

sta=sum(a)/2
sum=0
ans=0
for i in range(0,n-1):
    if sum==sta:
        print(0)
        sys.exit()
    elif sum<sta and sum+a[i]>sta:
        ans=min(sta-sum,sum+a[i]-sta)/0.5
        print(int(ans))
        sys.exit()
    else:
        sum+=a[i]

ans=min(sta-sum,sum+a[n]-sta)/0.5
print(abs(int(ans)))

Buggy submission (verdict: Runtime Error):
n= int(input())
a = list(int(i) for i in input().split())
import math
import sys

sta=sum(a)/2
sum=0
ans=0
for i in range(0,n-1):
    if sum==sta:
        print(0)
        sys.exit()
    elif sum<sta and sum+a[i+1]>sta:
        ans=min(sta-sum,sum+a[i]-sta)/0.5
        print(int(ans))
        sys.exit()
    else:
        sum+=a[i]

ans=min(sta-sum,sum+a[n]-sum)/0.5
print(ans)
Problem p02687 (python)

Fixed submission:
x=input()
print('ARC' if x == 'ABC' else 'ABC')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
high_list=list(map(int,input().split()))
pathlist=[]
for i in range(M):
    pathlist.append(list(map(int,input().split())))
waylist=[0]*N
ans=0
#i行目にi番目から行ける展望台をすべて入れる
for n in range(1,N+1):
    for m in pathlist:
        if(n in m):#もし経路に入っていたら
            if(m[0]==n):#自身じゃない方の高さを代入
                if(high_list[n-1]>high_list[m[1]-1]):
                    ans=ans+1
            else:
                if(high_list[n-1]>high_list[m[0]-1]):
                    ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
high_list=list(map(int,input().split()))
pathlist=[]
for i in range(M):
    pathlist.append(list(map(int,input().split())))
waylist=[0]*N
#i行目にi番目から行ける展望台をすべて入れる
for n in range(1,N+1):
    for m in pathlist:
        if(n in m):#もし経路に入っていたら
            if(m[0]==n):#自身じゃない方の高さを代入
                if(waylist[n-1],high_list[m[1]-1]):
                    waylist[n-1]=high_list[m[1]-1]
            else:
                if( waylist[n-1]<high_list[m[0]-1]):
                    waylist[n-1]=high_list[m[0]-1]

answer=0
for n in range(N):
    if(waylist[n]<high_list[n]):
        answer=answer+1

print(answer)

Buggy submission (verdict: Runtime Error):
import numpy  as np
N,M=map(int,input().split())
high_list=list(map(int,input().split()))
pathlist=[]
for i in range(M):
    pathlist.append(list(map(int,input().split())))
waylist=np.array([[0]*N]*N)
#i行目にi番目から行ける展望台をすべて入れる
for n in range(1,N+1):
    for m in pathlist:
        if(n in m):#もし経路に入っていたら
            if(m[0]==n):#自身じゃない方の高さを代入
                waylist[n-1][m[1]-1]=high_list[m[1]-1]
            else:
                waylist[n-1][m[0]-1]=high_list[m[0]-1]

answer=0
for n in range(N):
    if(waylist[n].max()<high_list[n]):
        answer=answer+1

print(answer)
Problem p04015 (python)

Fixed submission:
if __name__ == '__main__':
    N, A = map(int, input().split())
    x = list(map(int, input().split()))

    x.insert(0, 0)

    dp = [[[0 for _ in range(N * A + 1)] for _ in range(N + 1)] for _ in range(N + 1)]
    for i in range(N + 1):
        dp[i][0][0] = 1

    for i in range(1, N + 1):
        for j in range(1, i + 1):
            for k in range(1, N * A + 1):
                dp[i][j][k] = dp[i - 1][j][k]
                if k >= x[i]:
                    dp[i][j][k] += dp[i - 1][j - 1][k - x[i]]

    ans = 0
    for j in range(1, N + 1):
        ans += dp[N][j][A * j]

    print(ans)

Buggy submission (verdict: Runtime Error):
import * as fs from 'fs'

function main(input: string) {
  let lines = input.split('\n');
  let tmp = lines[0].split(' ');

  let N = Number(tmp[0]);
  let A = Number(tmp[1]);

  let x = [0];
  x = x.concat(lines[1].split(' ').map(Number));

  let dp = new Array(N + 1);
  for (let i = 0; i <= N; ++i) {
    dp[i] = new Array(N + 1);
    for (let j = 0; j <= N; ++j) {
      dp[i][j] = new Array(A * N + 1).fill(0);
    }
  }

  for (let i = 0; i < N; ++i) dp[i][0][0] = 1;

  for (let i = 1; i <= N; ++i) {
    for (let j = 1; j <= i; ++j) {
      for (let k = 1; k <= A * N; ++k) {
        if (k < x[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
        }
      }
    }
  }

  let ans = 0;
  for (let j = 1; j <= N; ++j) {
    ans += dp[N][j][j * A];
  }

  console.log(ans);
}

main(fs.readFileSync('/dev/stdin', 'utf8').toString());

Buggy submission (verdict: Runtime Error):
def main():
    N, A = map(int, input().split())
    x = [0].extend(list(map(int, input().split())))

    dp = [[[0 for _ in range(N * A + 1)] for _ in range(N + 1)] for _ in range(N + 1)]
    for i in range(N + 1):
        dp[i][0][0] = 1

    for i in range(1, N + 1):
        for j in range(1, i + 1):
            for k in range(1, N * A + 1):
                if k < x[k]:
                    dp[i][j][k] = dp[i - 1][j][k]
                else:
                    dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]]

    ans = 0
    for j in range(1, N + 1):
        ans += dp[N][j][A * j]

    print(ans)


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

Fixed submission:
import sys

MAX = 1000000


def digit_sum(n, b):
    if n == 0:
        return 0
    else:
        return digit_sum(n // b, b) + n % b


def main():
    n = int(input())
    s = int(input())

    if n < s:
        print(-1)
        sys.exit()

    ans = -1

    for b in range(2, min(n + 1, MAX) + 1):
        sm = digit_sum(n, b)
        if sm == s:
            ans = b
            break

    if ans != -1:
        print(ans)
        sys.exit()

    if n + 1 <= MAX:
        print(-1)
        sys.exit()

    for p in reversed(range(1, MAX)):
        if (n - s) % p != 0:
            continue
        b = (n - s) // p + 1
        if b < 2:
            continue
        sm = digit_sum(n, b)
        if sm == s:
            ans = b
            break

    if ans != -1:
        print(ans)
        sys.exit()

    if n == s:
        print(n+1)
        sys.exit()

    print(-1)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

MAX = 1000000


def digit_sum(n, b):
    if n == 0:
        return 0
    else:
        return digit_sum(n // b, b) + n % b


def main():
    n = int(input())
    s = int(input())

    if n < s:
        print(-1)
        sys.exit()

    ans = -1

    for b in range(2, min(n + 1, MAX) + 1):
        sm = digit_sum(n, b)
        if sm == s:
            ans = b
            break

    if not ans == -1:
        print(ans)
        sys.exit()

    if n + 1 <= MAX:
        print(-1)
        sys.exit()

    for p in reversed(range(MAX)):
        if (n - s) % p != 0:
            continue
        b = (n - s) // p + 1
        sm = digit_sum(n, b)
        if sm == s:
            ans = b
            break

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

MAX = 1000000


def digit_sum(n, b):
    if n == 0:
        return 0
    else:
        return digit_sum(n // b, b) + n % b


def main():
    n = int(input())
    s = int(input())

    if n < s:
        print(-1)
        sys.exit()

    ans = -1

    for b in range(2, min(n + 1, MAX) + 1):
        sm = digit_sum(n, b)
        if sm == s:
            ans = b
            break

    if not ans == -1:
        print(ans)
        sys.exit()

    if n + 1 <= MAX:
        print(-1)
        sys.exit()

    for p in reversed(range(MAX)):
        if (n - s) % p != 0:
            continue
        b = (n - s) / p + 1
        sm = digit_sum(n, b)
        if sm == s:
            ans = b
            break

    print(ans)


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

Fixed submission:
s = input()
ret = ""
if s=="ARC":
    ret = "ABC"
elif s=="ABC":
    ret = "ARC"
print(ret)

Buggy submission (verdict: Runtime Error):
import copy
n,m = map(int,input().split())
ht = [x for x in input().split()]
hl = {x + 1 : int(ht[x]) for x in range(len(ht))}
mx = {h:0 for h in hl}
for i in range(m):
    l,r = map(int,input().split())
    mx[l] = max(mx[l],hl[r])
    mx[r] = max(mx[r],hl[l])
cnt = 0
for h in hl:
    if mx[h] < hl[h]:
        cnt += 1
print(cnt)
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
X = input().split(" ")
print(f"{X[2]} {X[0]} {X[1]}")
Problem p02700 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
x=(a+d-1)//d
y=(c+b-1)//b
if x>=y:
    print('Yes')
else:
    print('No')

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

Fixed submission:
S,T=input().split()
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T=input().split
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T=input()
print(T+S)
Problem p03288 (python)

Fixed submission:
r=int(input())
if r<1200:
    print('ABC')
elif r<2800:
    print('ARC')
else:
    print('AGC')

Buggy submission (verdict: Runtime Error):
r=int(input())
if r<1200:
    print('ABC')
elif　r<2800:
    print('ARC')
else:
    print('AGC')

Buggy submission (verdict: Runtime Error):
r=int(input())
if r<1200:
  print('ABC')
elif　r<2800:
  print('ARC')
else:
  print('AGC')

Buggy submission (verdict: Runtime Error):
r=int(input())
if r<1200:
  print('ABC')
elif　1200<=r<2800:
  print('ARC')
else:
  print('AGC')
Problem p03302 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b==15:
    print('+')
elif a*b==15:
    print('*')
else:
    print('x')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b==15:
    print('+')
elif a*b=15:
    print('*')
else:
    print('x')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b=15:
    print('+')
elif a*b=15:
    print('*')
else:
    print('x')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input()split())
if a+b=15:
    print('+')
elif a*b=15:
    print('*')
else:
    print('x')
Problem p03623 (python)

Fixed submission:
x,a,b=map(int,input().split())
y=abs(x-a)
z=abs(b-x)
if y<z:
    print('A')
else:
    print('B')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
y=abs(x-a)
z=abs(b-x)
    if y<z:
        print('A')
    else:
        print('B')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
    if abs(x-a)<abs(b-x):
        print('A')
    else:
        print('B')
Problem p03997 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,h=map(int,input())
print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
a,b,h=map(int,input().split())
print((a+b)*h//2)
Problem p02765 (python)

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

if a >= 10:
    print(b)
else:
    print(b + 100*(10 - a))

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

if n > 10:
    print(n)
else:
    R = 100*(10 - n)
    print(R)
Problem p02789 (python)

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

if N == M:
  print("Yes")
else:
  print("No")

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

if n == m:
  print("Yes")
else:
  print("No")

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

if n == m:
  print("Yes")
else:
  print("No")
Problem p02801 (python)

Fixed submission:
C = input()

print(chr(ord(C)+1))

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

print(chr(ord(C)+1)

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

print(chr(ord(C)+1)
Problem p02885 (python)

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

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

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
print(len(list(filter(lambda x: x >= k, h))))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
print(len(filter(lambda x: x >= k, h)))
Problem p02918 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
grp = 0
now = ""
for c in s:
  if c != now:
    grp += 1
    now = c
hap = 0
for i in range(n):
  if (i>0 and s[i]=='L' and s[i-1]=='L') or (i<n-1 and s[i]=='R' and s[i+1]=='R'):
    hap += 1
p_2 = (grp - 1) // 2
p_1 = (grp + 1) % 2
print(hap + 2 * min(k, p_2) + int(k > p_2) * p_1)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
l = s.count('L')
r = s.count('R')
now = 0
for i in range(len(s)-1):
  if s[i] == 'R' and s[i+1] == 'L':
    now += 1
print(min(now + K, min(l, r)))

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
s = input()
l = s.count('L')
r = s.count('R')
now = 0
for i in range(len(s)-1):
  if s[i] == 'R' and s[i+1] == 'L':
    now += 1
print(min(now + K, min(l, r)))

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
s = input()
l = s.count('L')
r = s.count('R')
now = 0
for i in range(len(s)-1):
  if s[i] == 'R' and s[i+1] == 'L':
    res += 1
print(min(now + K, min(l, r)))

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
s = input()
l = s.count('L')
r = s.count('R')
now = 0
for i in range(len(s)):
  if s[i] == 'R' and s[i+1] == 'L':
    res += 1
print(min(now + K, min(l, r)))
Problem p02934 (python)

Fixed submission:
n = int(input())
a = [1 / int(x) for x in input().split()]
print(1 / sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [1 / int(input()) for _ in range(n)]
print(1 / sum(a))
Problem p03006 (python)

Fixed submission:
n = int(input())
cnt = dict()
xy = [tuple(map(int, input().split())) for _ in range(n)]
if n == 1:
    print(1)
    exit()
for x1, y1 in xy:
    for x2, y2 in xy:
        if x1 == x2 and y1 == y2:
            continue
        dx = x1 - x2
        dy = y1 - y2
        if (dx, dy) not in cnt:
            cnt[(dx, dy)] = 1
        else:
            cnt[(dx,dy)] += 1
print(n - max(cnt.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = dict()
xy = [tuple(map(int, input().split())) for _ in range(n)]
if n == 1:
    print(1)
for x1, y1 in xy:
    for x2, y2 in xy:
        if x1 == x2 and y1 == y2:
            continue
        dx = x1 - x2
        dy = y1 - y2
        if (dx, dy) not in cnt:
            cnt[(dx, dy)] = 1
        else:
            cnt[(dx,dy)] += 1
print(n - max(cnt.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = dict()
xy = [tuple(map(int, input().split())) for _ in range(n)]
for x1, y1 in xy:
    for x2, y2 in xy:
        if x1 == x2 and y1 == y2:
            continue
        dx = x1 - x2
        dy = y1 - y2
        if (dx, dy) not in cnt:
            cnt[(dx, dy)] = 1
        else:
            cnt[(dx,dy)] += 1
print(n - max(cnt.values()))
Problem p03035 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A >= 13:
  print(B)
else A >= 6:
  print(B//2)
else:
  print(0)
Problem p03061 (python)

Fixed submission:
from fractions import gcd
N = int(input())
aa = list(map(int, input().split()))
front = [0]*N
back = [0]*N
front[0] = aa[0]
back[-1] = aa[-1]
for i in range(1, N):
    front[i] = gcd(front[i-1], aa[i])
    back[-1-i] = gcd(back[-i], aa[-1-i])
ans = back[1]
for i in range(2, N):
    ans = max(gcd(front[i-2], back[i]), ans)
ans = max(front[-2], ans,)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
N = int(input())
aa = list(map(int, input().split()))
front = [0]*N
back = [0]*N
front[0] = aa[0]
back[-1] = aa[-1]
for i in range(1, N):
    front[i] = gcd(front[i-1], aa[i])
    back[-1-i] = gcd(back[-i], aa[-1-i])
ans = back[1]
for i in range(2, N):
    ans = max(gcd(front[i-2], back[i]), ans)
ans = max(front[-2], ans,)
print(ans)
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
if sum(L[:-1]) > L[-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
if L[:-1] > L[-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
     N= int(input())
    L = list(map(int, input().split()))
    L.sort()
    if sum(L[:-1]) > L[-1]:
      print("Yes")
    else:
      print("No")

Buggy submission (verdict: Runtime Error):
 = int(input())
L = list(map(int, input().split()))
L.sort()
if sum(L[:-1]) > L[-1]:
  print("Yes")
else:
  print("No")
Problem p03145 (python)

Fixed submission:
a, b, c = sorted(map(int, input().split()))
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a, b, c = sort(map(int, input().split()))
print(a*b//2)
Problem p03146 (python)

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

tab = [False]*1000001
now = int(input())
ind = 1
while not tab[now]:
    tab[now] = True
    now = func(now)
    ind += 1

print(ind)

Buggy submission (verdict: Runtime Error):
def func(a):
    if a % 2 == 0:
        return a//2
    else:
        return 3*a + 1

tab = [False]*1000_001
now = int(input())
ind = 1
while not tab[now]:
    tab[now] = True
    now = func(now)
    ind += 1

print(ind)
Problem p03194 (python)

Fixed submission:
N, P = map(int, input().split())
if N == 1:
  print(P)
  exit()
if N > 40:
  print(1)
  exit()
res = []
for i in range(1,P+1):
  x = i**N
  if i**N > P:
    break
  if P%x == 0:
    res.append(i)
print(max(res))

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())
if N == 1:
  print(P)
  exit()
if N > 40:
  print(1)
  exit()
res = []
for i in range(1,P):
  x = i**N
  if i**N > P:
    break
  if P%x == 0:
    res.append(i)
print(max(res))

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())
if N == 1:
  print(P)
  exit()
if N > 40:
  print(1)
  exit()
res = []
for i in range(P):
  x = i**N
  if i**N > P:
    break
  if P%x == 0:
    res.append(i)
print(max(res))
Problem p03195 (python)

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
if all(list(map(lambda x: x%2==0, a))):
  print("second")
else:
  print("first")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for _ in range(N)]
if all(list(map(x%2==0, a))):
  print("second")
else:
  print("first")
Problem p03212 (python)

Fixed submission:
N = int(input())
li = ['']
so = 0
for _ in range(9):
  l = len(li)
  for i in range(so, l):
    li.append(li[i] + '3')
    li.append(li[i] + '5')
    li.append(li[i] + '7')
  so = l
cnt = 0
for x in li:
  if '3' in x and '5' in x and '7' in x and int(x) <= N:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
li = ['']
so = 0
for _ in range(9):
  l = len(li)
  for i in range(so, l):
    li.append(li[i] + '3')
    li.append(li[i] + '5')
    li.append(li[i] + '7')
  so = l
cnt = 0
for x in li:
  if int(x) <= N and '3' in x and '5' in x and '7' in x:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
li = ['']
so = 0
for _ in range(9):
  l = len(li)
  for i in range(so, l):
    li.append(li[i] + '3')
    li.append(li[i] + '5')
    li.append(li[i] + '7')
  so = l
cnt = 0
for x in li:
  if int(x) <= N and 3 in x and 5 in x and 7 in x:
    cnt += 1
print(cnt)
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 = int(input())
A = int(input())
B = int(input())
if N == 1:
    print('Hello World')
else:
    print(A+B)
Problem p03239 (python)

Fixed submission:
N, T = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
x.sort(key=lambda y:y[0], reverse=True)
ans = 0
for (c, t) in x:
    if t <= T:
        ans = c
if ans == 0:
    print('TLE')
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
x = [map(int, input().split()) for _ in range(N)]
x.sort(key=lambda y:y[0], reverse=True)
ans = 0
for (c, t) in x:
    if t <= T:
        ans = c
print(ans)
Problem p03240 (python)

Fixed submission:
N = int(input())
pos = [list(map(int, input().split())) for _ in range(N)]
for cx in range(101):
    for cy in range(101):
        minH = 1 << 30
        se = set()
        for x,y,h in pos:
            a = -abs(x-cx)-abs(y-cy)
            if h == 0 and a == 0:
                break
            elif h == 0:
                minH = min(minH, -a)
            else:
                se.add(h-a)
        else:
            if len(se) == 0 and minH == 1:
                print(cx, cy, minH)
            elif len(se) == 1:
                hh = se.pop()
                if hh <= minH:
                   print(cx, cy, hh)

Buggy submission (verdict: Runtime Error):
N = int(input())
pos = [list(map(int, input().split())) for _ in range(N)]
for cx in range(101):
    for cy in range(101):
        minH = 1 << 29
        se = set()
        for x,y,h in pos:
            a = -abs(x-cx)-abs(y-cy)
            if h <= a:
                break
            elif h == 0:
                minH = min(minH, -a)
            else:
                se.add(h-a)
        else:
            if len(se) == 0 and minH == 1:
                print(cx, cy, hh)
            elif len(se) == 1:
                hh = se.pop()
               if hh <= minH:
                   print(cx, cy, hh)
Problem p02885 (python)

Fixed submission:
A, B = [int(x) for x in input().split()]
print(max(0, A - B*2))

Buggy submission (verdict: Runtime Error):
A, B = [int(x) for x in innput().split()]
print(max(0, A - B*2))
Problem p02887 (python)

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

prev = None
count = 0

for i in S:
  if prev != i:
    prev = i
    count += 1
    
print(count)

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

prev = None
count = 0

for i in S:
  if prev != i:
  	prev = i
    count += 1
print(count)

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

prev = None
for i in S:
  if prev != i:
  	prev = i
    count += 1
print(count)