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

Fixed submission:
import sys
import math
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    ans = 0.0

    for i in range(1, N+1):
        c = 0
        if i < K:
            c = math.ceil(math.log2(K) - math.log2(i))
        # print(i, c, (1.0 / (2 ** c)), 1.0/N)
        ans += (1.0 / (2 ** c)) * 1.0/N

    print("{0:.20f}".format(ans))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    ans = 0.0

    for i in range(1, N+1):
        c = 0
        if i < K:
            c = math.ceil(math.log2(K) - math.log2(i))
        # print(i, c, (1.0 / (2 ** c)), 1.0/N)
        ans += (1.0 / (2 ** c)) * 1.0/N

    print("{0:.20f}".format(ans))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    ans = 0.0

    for i in range(1, N+1):
        c = 0
        if i < K:
            c = math.ceil(math.log2(K) - math.log2(i))
        # print(i, c, (1.0 / (2 ** c)), 1.0/N)
        ans += (1.0 / (2 ** c)) * 1.0/N

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    ans = 0.0

    for i in range(1, N+1):
        c = 0
        if i < K:
            c = math.ceil(math.log2(K) - math.log2(i))
        # print(i, c, (1.0 / (2 ** c)), 1.0/N)
        ans += (1.0 / (2 ** c)) * 1.0/N

    print(ans)


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

Fixed submission:
dic = {
    'A': 'T',
    'T': 'A',
    'C': 'G',
    'G': 'C'
}

n=input()
print(dic[n])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
a = [list(map(int, input().split())) for i in range(q)]

cum=[0]*n
for i in range(1, n):
    cum[i] = cum[i - 1]
    if s[i-1:i+1] == 'AC':
        cum[i]+=1
    print(cum)

for i in range(q):
    print(cum[a[i][1]-1]-cum[a[i][0]-1])
Problem p03086 (python)

Fixed submission:
n=input()
dic = {'A': True, 'C': True, 'G': True, 'T': True}
lens = []

for i in range(0, len(n)):
    length = 0
    s = n[i]

    if s not in dic:
        lens.append(length)
        continue

    length += 1
    for j in range(i+1, len(n)):
        t = n[j]
        if t not in dic:
            break

        length += 1

    lens.append(length)
print(max(lens))

Buggy submission (verdict: Runtime Error):
n=input()
dic = {'A': True, 'C': True, 'G': True, 'T': True}
lens = []

for i in range(0, len(n)):
    length = 0
    s = n[i]

    if s not in dic:
        lens.append(length)
        continue

    length += 1
    for j in range(i+1, len(n)):
        t = n[j]
        if t not in dic:
            lens.append(length)
            continue

        length += 1

print(max(lens))
Problem p03308 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
 
for i in range(N):
  for j in range(i+1, N):
    ans = max(ans, abs(A[i] - A[j]))
 
print(ans)

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

for i in range(N):
  for j in range(i+1, N):
    ans = max(ans, abs(A[i] - A[j]))

print(ans)
Problem p03316 (python)

Fixed submission:
N = input()
SN = sum([int(i) for i in N])
 
if int(N) % SN == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
SN = sum([int(i) for i in N])

if N % SN == 0:
  print('Yes')
else:
  print('No')
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
 
X -= A
print(X % B)

Buggy submission (verdict: Runtime Error):
X = int(input())
A = int(input())
B = int(input())

X -= A
print(x % B)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
N = int(input())
ans = 0
 
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a * 500 + b * 100 + c * 50 == N:
        ans += 1
 
print(ans)

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

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a * 500 + b * 100 + c * 50 == N:
        ans += 1

print(ans)
Problem p03479 (python)

Fixed submission:

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


# show_flg = False
show_flg = True


def main():
    X, Y = MI()
    # tmp = math.log2(Y) - math.log2(X)
    # print(int(tmp) + 1)

    ans = 0
    c = X
    while c <= Y:
        c = c * 2
        ans += 1

    print(ans)



if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


# show_flg = False
show_flg = True


def main():
    X, Y = MI()
    tmp = int(math.log2(Y/X))
    print(tmp + 1)


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

Fixed submission:

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


# show_flg = False
show_flg = True


def main():
    S = input()
    center = len(S) // 2

    if len(S) % 2 == 0:
        c = 1
        while True:
            if (center - 1 + c) < len(S) and S[center - c] == S[center - 1 + c] and S[center - c] == S[center]:
                # if S[center - c] == S[center]:
                # print(c, center - c, center - 1 + c, S[center - c], S[center])
                c += 1
            else:
                # print(c, S[center - c], S[center - 1 + c])
                # c -= 1
                break
        print(c + center - 1)
    else:
        c = 0
        while True:
            if (center + c) < len(S) and S[center - c] == S[center + c] and S[center] == S[center - c]:
                c += 1
            else:
                break
        print(c + center)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


# show_flg = False
show_flg = True


def main():
    S = input()
    center = len(S) // 2

    if len(S) % 2 == 0:
        c = 1
        while True:
            if S[center - c] == S[center + c] and S[center - c] == S[center - 1]:
                c += 1
            else:
                break
        print(c + center - 1)
    else:
        c = 1
        while True:
            if S[center - c] == S[center + c] and S[center] == S[center - c]:
                c += 1
            else:
                break
        print(c + center)


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

Fixed submission:
s = input()
print(len([i for i in s if i == '1']))

Buggy submission (verdict: Runtime Error):
s = input()
print(len([i for i in s i == '1']))
Problem p03544 (python)

Fixed submission:
N = int(input())
L = [0] * (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] * 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 p03569 (python)

Fixed submission:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    s = S()
    d = deque(s)
    ans = 0

    # print(d)

    while len(d) > 1:
        if d[0] == d[-1]:
            d.popleft()
            d.pop()
        elif d[0] == 'x':
            d.append('x')
            ans += 1
        elif d[-1] == 'x':
            d.appendleft('x')
            ans += 1
        else:
            print(-1)
            return

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def base_10_to_n(X, n):
    if int(X / n):
        return base_10_to_n(int(X/n), n) + str(X % n)
    return str(X % n)


def main():
    A = I()

    for i in range(10, 10000+1):
        print(i, base_10_to_n(A, i))
        if str(i) == base_10_to_n(A, i):
            print(i)
            return

    print(-1)


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

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

print(max(a) - min(a))

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

print(max(a) - min(a))
Problem p03698 (python)

Fixed submission:
from collections import defaultdict 

N = input()
dic = defaultdict(int)
 
for s in N:
  dic[s] += 1
  
  if dic[s] > 1:
    print('no')
    exit()
 
print('yes')

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

for s in N:
  dic[s] += 1
  
  if dic[s] > 1:
    print('no')
    exit()

print('yes')
Problem p03773 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = input(int, input().split())

print((A + B) % 24)
Problem p03777 (python)

Fixed submission:
a, b = map(str, input().split())
m = {'D': 'H', 'H': 'D'}
 
if a == 'H':
  print(b)
else:
  print(m[b])

Buggy submission (verdict: Runtime Error):
a, b = map(str, input().split())
m = {'D': 'H', 'H': 'D'}

if a == 'H':
  print(b)
else a == 'D':
  print(m[b])
Problem p03957 (python)

Fixed submission:
s = input()
ans = []

for i in range(len(s)):
  if len(ans) == 0 and s[i] == 'C':
    ans.append(s[i])
  elif len(ans) == 1 and s[i] == 'F':
    ans.append(s[i])

if len(ans) == 2 and ans[0] == 'C' and ans[1] == 'F':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
ans = []

for i in range(len(s)):
  if len(s) < 2 and (s[i] == 'C' or s[i] == 'F'):
    ans.append(s)

if ans[0] == 'C' and ans[1] == 'F':
  print('Yes')
else:
  print('No')
Problem p04043 (python)

Fixed submission:
L = sorted(list(map(int, input().split())))
 
if L[0] == 5 and L[1] == 5 and L[2] == 7:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
L = sort(list(map(int, input().split())))
 
if L[0] == 5 and L[1] == 5 and L[2] == 7:
  print('YES')
else:
  print('NO')
Problem p03697 (python)

Fixed submission:
# -*- coding: utf-8 -*-

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

A, B = map(int, input().split())
if A + B >= 10: print("error")
else: print(A+B)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

A, B = map(int, input().split())
if A + B >= 10: print("error")
else print(A+B)
Problem p03814 (python)

Fixed submission:
s = input()
     
a = s.find("A")
b = s.rfind("Z")
     
print(b-a+1)

Buggy submission (verdict: Runtime Error):
-*- coding: utf-8 -*-

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

s = input()
print(1)

Buggy submission (verdict: Runtime Error):
-*- coding: utf-8 -*-

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

s = input()
print(s.rfind("Z") - s.find("A") + 1)

Buggy submission (verdict: Runtime Error):


     -*- coding: utf-8 -*-
     
    import sys
    import subprocess
    import json
    import time
    import math
    import re
    import sqlite3
     
    s = input()
    print(s.rfind("Z") - s.find("A") + 1)

Buggy submission (verdict: Runtime Error):
 -*- coding: utf-8 -*-

s = input()
print(s.rfind('Z') - s.find('A') + 1)

Buggy submission (verdict: Runtime Error):
 -*- coding: utf-8 -*-
 
import sys
import subprocess
import json
import time
import math
import re
import sqlite3
 
s = input()
print(s.rfind('Z') - s.find('A') + 1)
Problem p04030 (python)

Fixed submission:
s=[]
a=list(input())

for i in a:
    if i=='0':
        s.append('0')
    elif i=='1':
        s.append('1')
    else:
        if len(s)==0:
            pass
        else:
            s.pop()

b="".join(s)
print(b)

Buggy submission (verdict: Runtime Error):
s=[]
a=int(input())

if a==0:
    s.append(0)
elif a==1:
    s.append(1)
else:
    if len(s)>0:
        s.pop()
        
for l in s:
    print(l)
Problem p03241 (python)

Fixed submission:

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

ans_list = []
m,n = map(int, input().split())
if m == 1 and n == 1:
    print(1)
else:
    fct = factorize(n)
    for div in divisorize(fct):
        ans_list.append(num(div))
    ans_list.sort()
    for number in ans_list:
        if number <= (n//m):
            ans = number
    print(ans)

Buggy submission (verdict: Runtime Error):
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

ans_list = []
m,n = map(int, input().split())
fct = factorize(n)
for div in divisorize(fct):
    ans_list.append(num(div))
ans_list.sort()
for number in ans_list:
    if number <= (n//m):
        ans = number
print(ans)
Problem p03262 (python)

Fixed submission:
def gcd(x,y):
    if x < y:
        (x,y) = (y,x)
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

n,x = map(int, input().split())
list_x = list((map(int, input().split())))
list_x.append(x)
list_x.sort()
list_dist = []
for i in range(0,n):
    list_dist.append(list_x[i+1] - list_x[i])
gcd1 = list_dist[0]
for i in range(1,n):
    gcd1 = gcd(gcd1, list_dist[i])
print(gcd1)

Buggy submission (verdict: Runtime Error):
import math
n,x = map(int, input().split())
list_x = list((map(int, input().split())))
list_x.append(x)
list_x.sort()
list_dist = []
for i in range(0,n):
    list_dist.append(list_x[i+1] - list_x[i])
gcd1 = list_dist[0]
for i in range(1,n):
    gcd1 = math.gcd(gcd1, list_dist[i])
print(gcd1)

Buggy submission (verdict: Runtime Error):
import math
n,x = map(int, input().split())
list_x = list((map(int, input().split())))
list_x.append(x)
list_x.sort()
list_dist = []
for i in range(0,n):
    list_dist.append(list_x[i+1] - list_x[i])
gcd = list_dist[0]
for i in range(1,n):
    gcd = math.gcd(gcd, list_dist[i])
print(gcd)

Buggy submission (verdict: Runtime Error):
import math,functools
n,x = map(int, input().split())
list_x = list((map(int, input().split())))
list_x.append(x)
list_x.sort()
list_dist = []
for i in range(0,n):
    list_dist.append(list_x[i+1] - list_x[i])
print(functools.reduce(math.gcd,list_dist))

Buggy submission (verdict: Runtime Error):
import math
import functools
n,x = map(int, input().split())
list_x = list((map(int, input().split())))
list_x.append(x)
list_x.sort()
list_dist = []
for i in range(0,n):
    list_dist.append(list_x[i+1] - list_x[i])
print(functools.reduce(math.gcd,list_dist))
Problem p03274 (python)

Fixed submission:
def binarySearch(list_a, key):
    left = 0
    right = len(list_a)
    while left < right:
        mid = (left + right) // 2
        if list_a[mid] == key:
            return mid
            break
        elif key < list_a[mid]:
            right = mid
        else:
            left = mid+1
    else:
        return mid

n,k = map(int, input().split())
list_x = list((map(int, input().split())))
ans = 10**9
key_point = binarySearch(list_x,0)
for i in range(key_point-k,key_point+1):
    if i < 0:
        continue
    try:
        dist = min(abs(list_x[i]),abs(list_x[i+k-1])) + (list_x[i+k-1] - list_x[i])
        if ans > dist:
            ans = dist
    except:
        pass
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
list_x = list((map(int, input().split())))
ans = 10**9
for i in range(0,n-k+1):
    prob_list = list_x[i:i+k]
    if list_x[i+k-1] < 0 and list_x[i+k] < 0 and i != n-k-1 :
        continue
    elif list_x[i] > 0 and list_x[i-1] > 0 and i != 0:
        continue
    dist = min(abs(list_x[i]),abs(list_x[i+k-1])) + (list_x[i+k-1] - list_x[i])
    if ans > dist:
        ans = dist
print(ans)
Problem p03282 (python)

Fixed submission:
list_s = list(str(input()))
k = int(input())
bord = 10 **9
for i in range(len(list_s)):
    if list_s[i] != "1":
        bord = i
        break
if k <= bord:
    print(1)
else:
    print(list_s[i])

Buggy submission (verdict: Runtime Error):
list_s = list(str(input()))
k = int(input())
for i in range(len(list_s)):
    if list_s[i] != "1":
        bord = i
        break
if k <= bord:
    print(1)
else:
    print(list_s[i])
Problem p03331 (python)

Fixed submission:
n = str(input())
len = len(n)
list = list(n)
ans = 0
if len == 1:
  ans = int(n)
elif n.count("0") != len - 1:
  for element in list:
    ans += int(element)
else:
  ans = 10
print(ans)

Buggy submission (verdict: Runtime Error):
n = str(input())
len = len(n)
list = list(n)
ans = 0
if n.count("0") != len - 1:
  for element in list:
    ans += int(element)
elif len(n) == 1:
  ans = int(n)
else:
  ans = 10
print(ans)
Problem p03337 (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 p03352 (python)

Fixed submission:
x = int(input())
p = 2
list_prob = []
ind = 0
i = 1
while p < 11:
    ind = i ** p
    while ind < 1001:
        list_prob.append(int(i ** p))
        i += 1
        ind = i ** p
    i = 1
    p += 1
list_prob.append(1001)
list_prob.sort()
while i < len(list_prob):
    if list_prob[i] <= x and list_prob[i+1] > x:
        print(list_prob[i])
        break
    i += 1

Buggy submission (verdict: Runtime Error):
import sys
import os
f = open("input.txt", "r")
sys.stdin = f

x = int(input())
p = 2
list_prob = []
ind = 0
i = 1
while p < 11:
    ind = i ** p
    while ind < 1001:
        list_prob.append(int(i ** p))
        i += 1
        ind = i ** p
    i = 1
    p += 1
list_prob.append(1001)
list_prob.sort()
while i < len(list_prob):
    if list_prob[i] <= x and list_prob[i+1] > x:
        print(list_prob[i])
        break
    i += 1

Buggy submission (verdict: Runtime Error):
x = int(input())
p = 2
list_prob = []
ind = 0
i = 1
while p < 11:
    ind = i ** p
    while ind < 1001:
        list_prob.append(int(i ** p))
        i += 1
        ind = i ** p
    i = 1
    p += 1
list_prob.sort()
while i < len(list_prob):
    if list_prob[i] <= x and list_prob[i+1] > x:
        print(list_prob[i])
        break
    i += 1