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

Fixed submission:
N = int(input())

def factorial(n, p):
    if n == 0: return 0
    return n//p + factorial(n//p, p)

def duble_factorial(n, p):
    if n%2 == 1:
        return factorial(n,p) - duble_factorial(n-1, p) # n!! = n!/(n-1)!!だからpで割ると引き算で表せるよね
    else:
        res = factorial(n//2, p)
        if p == 2: 
            res += n//2
        return res

ans = min(duble_factorial(N,2), duble_factorial(N,5))
print(ans)

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

def factorial(n, p):
    if n == 0: return 1
    return n/p + factorial(n/p, p)

def duble_factorial(n, p):
    if n%2 == 1:
        return factorial(n,p) - duble_factorial(n-1, p) # n!! = n!/(n-1)!!だからpで割ると引き算で表せるよね
    else:
        res = factorial(n/2, p)
        if p == 2: 
            res += n/2
        return res

ans = min(duble_factorial(N,2), duble_factorial(N,5))
print(ans)

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

def f(n):
    if n < 2:
        return 1
    if n >= 2:
        return n*f(n-2)

def memoize(f): #メモ化関数
    table = {}
    def func(*args):
        if not args in table:
            table[args] = f(*args)
        return table[args]
    return func
      
@memoize
def memf(n):
    if ( n<=1 ):
        return 1
    else:
        return n*f(n-2)
        
ans = memf(N)
# print(ans)
str_ans = str(ans)
count = 0
for s in reversed(str_ans):
    if s != '0':
        break
    count += 1
print(count)

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

def f(n):
    if n < 2:
        return 1
    if n >= 2:
        return n*f(n-2)

@memoize
def memf(n):
    if ( n<=1 ):
        return 1
    else:
        return n*f(n-2)
        
ans = memf(N)
# print(ans)
str_ans = str(ans)
count = 0
for s in reversed(str_ans):
    if s != '0':
        break
    count += 1
print(count)
Problem p02659 (python)

Fixed submission:
from decimal import *
import math
a,b=map(str,input().split())
c=Decimal(a)
d=Decimal(b)
e=Decimal(c*d)
f=math.floor(e)
print(f)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
import math
a,b=map(str,input().split())
c=Decimal(a)
d=Decimal(b)
e=Decimal(c*d)
f=math.floor(e)
print(f)
from decimal import *
import math
a,b=map(str,input().split())
c=Decimal(a)
d=Decimal(b)
e=Decimal(c*d)
f=math.floor(e)
print(f)

Buggy submission (verdict: Runtime Error):
from decimal import *
import math
a,b=map(str,input().split())
c=Decimal('a')
d=Decimal('b')
e=Decimal('c*d')
f=math.floor(e)
print(f)

Buggy submission (verdict: Runtime Error):
from decimal import *
import math
a,b=map(str,input().split())
c=Decimal("a")
d=Decimal("b")
e=c*d
f=math.floor(e)
print(f)

Buggy submission (verdict: Runtime Error):
from decimal import *
import math
a,b=map(str,input().split())
c=Decimal('a')
d=Decimal('b')
e=c*d
f=math.floor(e)
print(f)

Buggy submission (verdict: Runtime Error):
import decimal
import math
a,b=map(str,input().split())
c=Decimal('a')
d=Decimal('b')
e=c*d
f=math.floor(e)
print(f)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
a,b=map(str,input().split())
c=Decimal('a')
d=Decimal('b')
e=c*d
f=int(e)
print(f)
Problem p02676 (python)

Fixed submission:
K=int(input())
S=input()
D=[]
if len(S)<=K:
  print(S)
else:
  for i in range(K):
    D.append(S[i])
  D.append("...")
  P=''.join(D)  
  print(P)

Buggy submission (verdict: Runtime Error):
K=int(input())
S=input()
D=[]
for i in range(K):
  D.append(S[i])
D.append("...")
P=''.join(D)  
if len(S)<=K:
  print(S)
else:
  print(P)
Problem p02699 (python)

Fixed submission:
s,w=map(int, input().split())
if s<=w:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w=input().split()
if s<=w:
  print(unsafe)
if s>w:
  print(safe)

Buggy submission (verdict: Runtime Error):
s,w=input().split()
if s<=w:
  print(unsafe)
else:
  print(safe)

Buggy submission (verdict: Runtime Error):
S,W=input().split()
if S<=W:
  print(unsafe)
else:
  print(safe)
Problem p02711 (python)

Fixed submission:
N=int(input())
a=str(N)
if '7' in a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
if a in 7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
if 'a' in 7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
if 'a' in 7:
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
if int(a[1])==7:
  print("Yes")
elif int(a[2])==7:
  print("Yes")
elif int(a[3])==7:
  print("Yes)
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
if int(a[1])==7:
  print("Yes")
elif int(a[-2])==7:
  print("Yes")
elif int(a[3])==7:
  print("Yes)
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
if a[1]=7:
  print("Yes")
if a[2]=7:
  print("Yes")
if a[3]=7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
for i in range(1,4):
  if a[i]=7:
    print("Yes")
    break
print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
a=str(N)
for i in range(1,4):
  if a[i]=7:
    print(Yes)
    break
Problem p02723 (python)

Fixed submission:
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
if S[2]=S[3] and S[4]=S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
if s[2]=s[3] and s[4]=s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
if s[2]=s[3] and s[4]=s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
s=str(S)
if s[2]=s[3] and s[4]=s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
if S[2]=S[3] and S[4]=S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
if S[2]=S[3],S[4]=S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=input()
if c=d,e=f:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(str,input().split())
if c=d,e=f:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
if c=d,e=f:
  print("Yes")
else:
  print("No")
Problem p02753 (python)

Fixed submission:
S=input()
if S=="AAA" or S=="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S==AAA or S==BBB:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S=AAA or S=BBB:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S="AAA" or S="BBB":
  print("No")
else:
  print("Yes")
Problem p02627 (python)

Fixed submission:
a = input()

if a.isupper():
    print("A")
else:
    print("a")

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

if a.isUpper():
    print("A")
else:
    print("a")
Problem p02693 (python)

Fixed submission:
K = int(input())

A, B = map(int, input().split())

if A // K == B // K:
    if A % K == 0 or B % K == 0:
        print("OK")
    else:
        print("NG")
elif A // K < B // K:
    print("OK")
else:
    print("NG")

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

A, B = map(int, input())

if A // K <= B // K and B % K == 0:
    print("OK")
else:
    print("NG")
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())

if S > W:
    print("safe")
else:
    print("unsafe")

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

result = []

for i in range(len(S) - 3):
    for j in range(i + 3, len(S)):
        if int(S[i:j+1]) % 2019 == 0:
            result.append([i + 1, j + 1])

print(len(result))

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

result = []

for i in range(len(S) - 3):
    for j in range(i + 3, len(S)):
        if int(S[i:j+1]) % 2019 == 0:
            result.append([i + 1, j + 1])

print(len(result))
Problem p02759 (python)

Fixed submission:
N = int(input())

print( (N + 1) // 2)

Buggy submission (verdict: Runtime Error):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))

A = A1 + A2 + A3
N = int(input())

index = []
for i in range(N):
    inp = int(input())
    if inp in A:
        index.append(A.index(inp))

if (0 in index and 3 in index and 6 in index) or \
   (1 in index and 4 in index and 7 in index) or \
   (2 in index and 5 in index and 8 in index) or \
   (0 in index and 4 in index and 8 in index) or \
   (2 in index and 4 in index and 6 in index) or \
   (0 in index and 1 in index and 2 in index) or \
   (3 in index and 4 in index and 5 in index) or \
   (6 in index and 7 in index and 8 in index):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))

A = A1 + A2 + A3
N = int(input())

index = []
for i in range(N):
    index.append(A.index(int(input())))

if (0 in index and 3 in index and 6 in index) or \
   (1 in index and 4 in index and 7 in index) or \
   (2 in index and 5 in index and 8 in index) or \
   (0 in index and 4 in index and 8 in index) or \
   (2 in index and 4 in index and 6 in index) or \
   (0 in index and 1 in index and 2 in index) or \
   (3 in index and 4 in index and 5 in index) or \
   (6 in index and 7 in index and 8 in index):
    print("Yes")
else:
    print("No")
Problem p02753 (python)

Fixed submission:
S=input()
if S[0]==S[1]==S[2]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
a=A+B
x=N//a
y=N%a
if y<=A:
    print(x*A+y)
else:
    print(x*(A+1))
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split())
m=A+B
x=int(N/m)
y=int(N%m)
if y<=A:
    print(x*A+y)
else:
    print(A*(x+1))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
m=A+B
x=int(N/m)
y=int(N%m)
if y<=A:
    print(x*A+y)
else:
    print(A*(X+1))
Problem p02862 (python)

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

_x, _y = map(int, input().split())


def nCk(n, k, m=10 ** 9 + 7):
    a = b = 1
    k = min(k, n - k)
    for i in range(k):
        a = (a * (n - i)) % m
        b = (b * (i + 1)) % m

    return (a * pow(b, m - 2, m)) % m


def chker(x, y):
    if (x + y) % 3 != 0 or x > 2 * y or y > 2 * x:
        print(0)
        return

    if x == y:
        b = x // 3
        print(nCk(2 * b, b))
        return

    x, y = (x, y) if x < y else (y, x)

    b = 2 * x - y
    if b % 3 != 0:
        print(0)
        return

    d1, d2 = b // 3, x - 2 * (b // 3)
    u = d1 + d2

    print(nCk(u, d1))


chker(_x, _y)

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

_x, _y = map(int, input().split())


def combination(n, r, mod=10 ** 9 + 7):
    n1, r = n + 1, min(r, n - r)
    numer = denom = 1
    for i in range(1, r + 1):
        numer = numer * (n1 - i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod - 2, mod) % mod


X, Y = map(int, input().split())
if (X + Y) % 3 != 0 or not (X <= 2 * Y and Y <= 2 * X):
    print(0)
    exit()

n = (X + Y) // 3
r = Y - n
print(combination(n, r))


def nCk(n, k, m=10 ** 9 + 7):
    a = b = 1
    k = min(k, n - k)
    for i in range(k):
        a = (a * (n - i)) % m
        b = (b * (i + 1)) % m

    return (a * pow(b, m - 2, m)) % m


def chker(x, y):
    if (x + y) % 3 != 0 or x > 2 * y or y > 2 * x:
        print(0)
        return

    if x == y:
        b = x // 3
        print(nCk(2 * b, b))
        return

    x, y = (x, y) if x < y else (y, x)

    b = 2 * x - y
    if b % 3 != 0:
        print(0)
        return

    d1, d2 = b // 3, x - 2 * (b // 3)
    u = d1 + d2

    print(nCk(u, d1))


chker(_x, _y)

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

_x, _y = map(int, input().split())


def modinv(a, mod=10**9 + 7):
    return pow(a, mod - 2, mod)


def combination(n, r, mod=10**9 + 7):
    r = min(r, n - r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i + 1, mod) % mod
    return res


def chker(x, y):
    if x == y:
        if x % 3 != 0:
            print(0)
            return

        b = x // 3
        print(combination(2 * b, b))
        return

    x, y = (x, y) if x > y else (y, x)

    b = y - x / 2
    if 2 * b % 3 != 0:
        print(0)
        return

    d1, d2 = 2 * b // 3, int(x / 2 - b / 3)
    u = d1 + d2

    print(combination(u, min(d1, d2)))


chker(_x, _y)
Problem p02873 (python)

Fixed submission:
import sys
from operator import itemgetter
input = sys.stdin.readline

_s = input()


def chker(s):
    l, r, minisum = 0, 0, 0
    if s[0] == '<':
        l += 1
    elif s[0] == '>':
        r += 1
    for i in range(1, len(s)):
        if s[i - 1] == '>' and s[i] == '<':
            l, r = (l, r) if l > r else (r, l)
            minisum += l * (l + 1) / 2 + r * (r - 1) / 2
            l, r = 1, 0
        else:
            if s[i] == '<':
                l += 1
            elif s[i] == '>':
                r += 1

    l, r = (l, r) if l > r else (r, l)
    minisum += l * (l + 1) / 2 + r * (r - 1) / 2

    print(int(minisum))


chker(_s)

Buggy submission (verdict: Runtime Error):
import sys
from operator import itemgetter
input = sys.stdin.readline

_s = input()


def chker(s):
    l, r, minisum = 0, 0, 0
    if s[0] == '<':
        l += 1
    elif s[i] == '>':
        r += 1
    for i in range(1, len(s)):
        if s[i - 1] == '>' and s[i] == '<':
            l, r = (l, r) if l > r else (r, l)
            minisum += l * (l + 1) / 2 + r * (r - 1) / 2
            l, r = 1, 0
        else:
            if s[i] == '<':
                l += 1
            elif s[i] == '>':
                r += 1

    l, r = (l, r) if l > r else (r, l)
    minisum += l * (l + 1) / 2 + r * (r - 1) / 2

    print(int(minisum))


chker(_s)
Problem p02891 (python)

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

_s = input()[:-1]
_k = int(input())


def chker(S, K):
    s3 = [item for item in S * 3]
    for i in range(1, len(s3)):
        if s3[i - 1] == s3[i]:
            s3[i] = 1

    s3 = [0 if item != 1 else item for item in s3]

    ls = len(S)
    cnt_0 = sum(s3[:ls])
    cnt_1 = sum(s3[ls:2 * ls])
    cnt_2 = sum(s3[2 * ls:3 * ls])

    print(cnt_0 + cnt_1 * (K // 2) + cnt_2 * ((K - 1) // 2))


chker(_s, _k)

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

_s = input()[:-1]
_k = int(input())


def chker(S, K):
    s3 = S * 3
    for i in range(1, len(s3)):
        if s3[i - 1] == s3[i]:
            s3[i] = '0'

    ls = len(S)
    cnt_0 = s3[:ls].count('0')
    cnt_1 = s3[ls:2 * ls].count('0')
    cnt_2 = s3[2 * ls:3 * ls].count('0')

    print(cnt_0 + cnt_1 * (K // 2) * cnt_2 * ((K - 1) // 2))


chker(_s, _k)
Problem p02711 (python)

Fixed submission:
s = input()

if '7' in s:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = intput()

if ('7' in s):
  print('Yes')
Problem p02753 (python)

Fixed submission:
s = input()

if s == 'AAA':
	print('No')
elif s == 'BBB':
	print('No')
else:
	print('Yes')

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

if s == 'AAA':
	print('No')
  elif s == 'BBB':
      print('No')
  else:
      print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'AAA':
	print('Yes')
if s == 'BBB'
	print('Yes')
else:
	print('No')
Problem p02754 (python)

Fixed submission:
n,a,b = map(int,input().split())
c = a + b
ans = n//c*a + min(n%c,a)

print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input())
c = a + b
ans = n/(a+b) + min(n%c,b)

print(ans)
Problem p02627 (python)

Fixed submission:
a = input()
 
if a.islower():
  print('a')
else:
  print('A')

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

if a.islower():
  print('A')
else:
  print('a')
Problem p02711 (python)

Fixed submission:
N = input()
YN = False
for i in N:
    if int(i) == 7:
        YN = True
if YN:
    print("Yes")
else:
    print("No")

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

Rs = []
Gs = []
Bs = []
for i, il in enumerate(S):
    if il == 'R':
        Rs.append(i)
    if il == 'G':
        Gs.append(i)
    if il == 'B':
        Bs.append(i)
num = 0
for i in Rs:
    for j in Gs:
        for k in Bs:
            if (2*i - j - k)*(2*j - k - i)*(2*k - i - j):
                num += 1
print(num)
Problem p02627 (python)

Fixed submission:
_in = input()

result = _in.isupper()

if result:
  print('A')
else:
  print('a')

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

result = _in.isupper()

if result ? :
  print('A')
else:
  print('a')
Problem p02860 (python)

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

print('Yes') if S[:len(S)//2] == S[len(S)//2:] else print('No')

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

print('Yes') if S[:len(S)/2] == S[len(S)/2:] else print('No')
Problem p02879 (python)

Fixed submission:
x, y = map(int, input().split())
if 0 < x < 10 and 0 < y < 10:
    print(x * y)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
    x, y = map(int, input().split())
    if 0 < x < 10 and 0 < y < 10:
        print(x * y)
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
    x, y = map(int, input().split())
    if 0 < x < 10 and 0 < y < 10:
        print(x * y)
    else:
        print(-1)
Problem p03207 (python)

Fixed submission:
N = int(input())
prices = [int(input()) for _ in range(N)]

print(sum(prices) - max(prices) // 2)

Buggy submission (verdict: Runtime Error):
L, H = map(int, input().split())
N = int(input())
worked_time = [int(input()) for _ in range(N)]

for time in worked_time:
    result = L - time if L > time else "0" if H >= time else "-1"
    print(result)
Problem p02831 (python)

Fixed submission:
import fractions

A, B = map(int, input().split())

print(A * B // fractions.gcd(A, B))

Buggy submission (verdict: Runtime Error):
import fraction

A, B = map(int, input().split())

print(A * B // fraction.gcd(A, B))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())

print(A * B // math.gcd(A, B))
Problem p02833 (python)

Fixed submission:
N = int(input())

count = 0
div = 10

if N % 2 == 0:
    for i in range(1, 26):
        count += N // div
        div *= 5

print(count)

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

count = 0
div = 10

if N % 2 == 0:
    for i in range(1, 26):
    count += N // div
    div *= 5

print(count)
Problem p02862 (python)

Fixed submission:
x, y = map(int, input().split())

MOD = int(1.0e+9 + 7)
DP_max = 3333334

DP = []

X = int((2 * y - x) / 3)
Y = int((2 * x - y) / 3)

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

if((2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0 or
   (2 * y - x) < 0 or (2 * x - y) < 0):
    print(0)
else:
    print(cmb(X + Y, Y, MOD))

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

MOD = int(1.0e+9 + 7)
DP_max = 3333334

DP = []
if(2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
    print(0)

if(2 * y - x) < 0 or (2 * x - y) < 0:
    print(0)

X = int((2 * y - x) / 3)
Y = int((2 * x - y) / 3)

for i in range(X + 1):
    DP.append([1])

for i in range(Y + 1):
    DP[0].append(1)


for i in range(1, X + 1):
    for j in range(1, Y + 1):
        DP[i].append((DP[i][j - 1] + DP[i - 1][j]) % MOD)

print(DP[X][Y])
Problem p02916 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

count = 0

for i in range(N):
    count += B[i]

    if  i >= 1 and A[i] == A[i - 1] + 1:
        count += C[A[i - 1] - 1]

print(count)

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

count = 0

for i in range(N):
    count += B[i]

for i in range(0, N - 1):
    count += C[i]

if N > 2:
    count -= C[A[N - 1] - 1]

print(count)
Problem p02725 (python)

Fixed submission:
K,N = map(int, input().split())
AN = max = i = j = 0
c = []

A = [int(N) for N in input().split()]
while i+1 != N:
    c.append(A[i+1] - A[i])
    if c[i] > max:
        max = c[i]
    i = i+1

c.append(A[0] - 0 + K - A[N-1])

if A[0] - 0 + K - A[N-1] > max:
    max = A[0] - 0 + K - A[N-1]

while j != N:
    AN = AN + c[j]
    j = j + 1

AN = AN - max

print(AN)

Buggy submission (verdict: Runtime Error):
,N = map(int, input().split())
AN = max = i = j = 0
c = []

A = [int(N) for N in input().split()]
while i+1 != N:
    c.append(A[i+1] - A[i])
    if c[i] > max:
        max = c[i]
    i = i+1

c.append(A[0] - 0 + K - A[N-1])

if A[0] - 0 + K - A[N-1] > max:
    max = A[0] - 0 + K - A[N-1]

while j != N:
    AN = AN + c[j]
    j = j + 1

AN = AN - max

print(AN)
Problem p02659 (python)

Fixed submission:
import math
def main():
    A, B = input().split()
    A = int(A)
    B = round(100 * float(B))
    out = (A * B) // 100
    
    print(out)

main()

Buggy submission (verdict: Runtime Error):
import math
def main():
    A, B = input().split()
    A = int(A)
    B = round(100 * (B))
    out = (A * B) // 100
    
    print(out)

main()