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

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
K = int(input())
X = int(input())
print ('Yes' if 500 * K => X else 'No')

Buggy submission (verdict: Runtime Error):
K,X=int(input( ))
print ('Yes' if 500 * K => X else 'No')

Buggy submission (verdict: Runtime Error):
K,X=map(int,input( ).split( ))
print ('Yes' if 500 * K => X else 'No')

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
if (a => X):
    print ('Yes')
else:
    print ('No')

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
if a => X:
    print ('Yes')
else:
    print ('No')

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
print ('Yes' if a => X else 'No')

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
print ('Yes' if a => X else 'No')

Buggy submission (verdict: Runtime Error):
K,X=map(int,input().split())
print ('Yes' if 500 * K =< X else 'No')
Problem p02789 (python)

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

if a[0] == a[1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
if(a[0] == a[1])
	print('Yes')
else:
  print('No')
Problem p02789 (python)

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

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

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

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

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

if n = m:
  return 'Yes'
else:
  return 'No'
Problem p02801 (python)

Fixed submission:
print(chr(ord(input()) + 1))

Buggy submission (verdict: Runtime Error):
print(chr(ord(C) + 1))
Problem p02814 (python)

Fixed submission:
import math
from functools import reduce
from fractions import gcd

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
#! //Users/daigofujiwara/anaconda3/bin python3

#h行で列和がyかy+1であるかどうかとサンプルを出力

input1=input()

input2=input()

x,y=input1.split(" ")
N,M=int(x),int(y)

A=input2.split(" ")

A=[int(a) for a in A ]

B=[]
for a in A:
    B.append(a//2)


Mb=lcm_list(B)
gmp=None


T=1
for b in B:
    if not (Mb//b)%2==1:
        T=0
if T==1:
    gmp=Mb




if gmp is None:
    print(0)
else:
    print(int(math.floor(M/gmp+1.0)/2.0))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
#! //Users/daigofujiwara/anaconda3/bin python3

#h行で列和がyかy+1であるかどうかとサンプルを出力

input1=input()

input2=input()

x,y=input1.split(" ")
N,M=int(x),int(y)

A=input2.split(" ")

A=[int(a) for a in A ]

B=[]
for a in A:
    B.append(a//2)


Mb=lcm_list(B)
gmp=None

i=1
while True:
    m=Mb*i
    if m>M:
        break
    T=1
    for b in B:
        if not ((m//b)%2==1):
            T=0
    if T==1:
        gmp=m
        break
    
    i+=1


if gmp is None:
    print(0)
else:
    print(int(math.floor(M/gmp+1.0)/2.0))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
#! //Users/daigofujiwara/anaconda3/bin python3

#h行で列和がyかy+1であるかどうかとサンプルを出力

input1=input()

input2=input()

x,y=input1.split(" ")
N,M=int(x),int(y)

A=input2.split(" ")

A=[int(a) for a in A ]

B=[]
for a in A:
    B.append(a//2)


Mb=lcm_list(B)
gmp=None

i=1
while True:
    m=Mb*i
    if m>M:
        break
    T=1
    for b in B:
        if not ((m//b)%2==1):
            T=0
    if T==1:
        gmp=m
        break
    
    i+=1


if gmp is None:
    print(0)
else:
    print(int(math.floor(M/gmp+1.0)/2.0))

Buggy submission (verdict: Runtime Error):
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
#! //Users/daigofujiwara/anaconda3/bin python3

#h行で列和がyかy+1であるかどうかとサンプルを出力

input1=input()

input2=input()

x,y=input1.split(" ")
N,M=int(x),int(y)

A=input2.split(" ")

A=[int(a) for a in A ]

B=[]
for a in A:
    B.append(a//2)


Mb=lcm_list(B)
gmp=None

i=1
while True:
    m=Mb*i
    if m>M:
        break
    T=1
    for b in B:
        if not ((m//b)%2==1 and m%b==0):
            T=0
    if T==1:
        gmp=m
        break
    
    i+=1


if gmp is None:
    print(0)
else:
    print(int(math.floor(M/gmp+1.0)/2.0))
Problem p02866 (python)

Fixed submission:
#inputは文字列として取得
input1=input()
input2=input()
#splitする必要がある
input2=input2.split(" ")

N=int(input1)
D=[int(s) for s in input2]

ans=None


if D.count(0)==1 and D[0]==0:

    L=[0]*(max(D)+1)

    for i in range(len(D)):
        L[D[i]]+=1

    mul=1

    for i in range(len(L)-1):
        mul*=L[i]**L[i+1]%998244353
    
    ans=mul%998244353

else:
    ans=0

print(int(ans))

Buggy submission (verdict: Runtime Error):
#inputは文字列として取得
input1=input()
input2=input()
#splitする必要がある
input2=input2.split(" ")

N=int(input1)
D=[int(s) for s in input2]

dp=[[0] * max(D) for i in range(max(D))]

def pow(a,b):
    
    if dp[a-1][b-1]!=0:
        return dp[a-1][b-1]

    else:
        if b==1:
            return a
        else:
            ans=pow(a,b-1)*a
            ans=ans%998244353
            dp[a-1][b-1]=ans
            return ans

ans=None

if D.count(0)==1 and D[0]==0:

    mul=1
    n=1

    for i in range(1,max(D)+1):
        m=D.count(i)
        mul*=pow(n,m)
        n=m
    
    ans=mul%998244353

else:
    ans=0

print(int(ans))

Buggy submission (verdict: Runtime Error):
#inputは文字列として取得
input1=input()
input2=input()
#splitする必要がある
input2=input2.split(" ")

N=int(input1)
D=[int(s) for s in input2]

dp=[[0] * max(D) for i in range(max(D))]

def pow(a,b):
    
    if dp[a-1][b-1]!=0:
        return dp[a-1][b-1]

    else:
        if b==1:
            return a
        else:
            ans=pow(a,b-1)*a
            dp[a-1][b-1]=ans
            return ans

ans=None

if D.count(0)==1 and D[0]==0:

    mul=1
    n=1

    for i in range(1,max(D)+1):
        m=D.count(i)
        mul*=pow(n,m)
        n=m
    
    ans=mul%998244353

else:
    ans=0

print(int(ans))

Buggy submission (verdict: Runtime Error):
#inputは文字列として取得
input1=input()
input2=input()
#splitする必要がある
input2=input2.split(" ")

N=int(input1)
D=[int(s) for s in input2]

dp=[[0] * max(D) for i in range(max(D))]

def pow(a,b):
    
    if dp[a-1][b-1]!=0:
        return dp[a-1][b-1]

    else:
        ans=a**b
        dp[a-1][b-1]=ans
        return ans

ans=None

if D.count(0)==1 and D[0]==0:

    mul=1
    n=1

    for i in range(1,max(D)+1):
        m=D.count(i)
        mul*=pow(n,m)
        n=m
    
    ans=mul%998244353

else:
    ans=0

print(int(ans))
Problem p02789 (python)

Fixed submission:
nm = list(map(int, input().split()))
if nm[0]==nm[1]:
  print('Yes')
else:
  print('No')

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

c = [True for i in range(n)]
for i in range(1,n):
  p[0:i].sort()
  if p[i]>p[i-1]:
      c[i] = False
print(sum(c))
Problem p02909 (python)

Fixed submission:
def weather_prediction():
    today = input()
    print(tomorrow_weather_q(today))

def tomorrow_weather_q(today):
    if today == "Sunny":
        return "Cloudy"
    elif today == "Cloudy":
        return "Rainy"
    elif today == "Rainy":
        return "Sunny"
    else:
        return 0

weather_prediction()

Buggy submission (verdict: Runtime Error):
def weather_prediction():
    today = input()
    print(tomorrow_weather_q today)

def tomorrow_weather_q(today):
    if today == "Sunny":
        return "Cloudy"
    elif today == "Cloudy":
        return "Rainy"
    elif today == "Rainy":
        return "Sunny"
    else:
        return 0

weather_prediction()
Problem p02814 (python)

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


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = list(map(lambda x: x // 2, A))

    t = f(A[0])
    for i in range(len(A)):
        if f(A[i]) != t:
            print(0)
            return 0
        A[i] >>= t
    M >>= t

    l = 1
    for i in range(N):
        l = lcm(l, A[i])
        if l > M:
            print(0)
            return 0

    M /= l
    ans = (M + 1) // 2
    print(int(ans))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
import fractions
import sys
input = sys.stdin.readline


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = np.array(A) // 2

    t = f(A[0])
    for i in range(len(A)):
        if f(A[i]) != t:
            print(0)
            return 0
        A[i] >>= t
    M >>= t

    l = 1
    for i in range(N):
        l = lcm(l, A[i])
        if l > M:
            print(0)
            return 0

    M /= l
    ans = (M + 1) // 2
    print(int(ans))


if __name__ == "__main__":
    main()
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(float, input().split())


if x <= (a**2 * b) / 2:
    print(math.degrees(math.atan(a * b**2 / (2 * x))))
else:
    print(math.degrees(math.atan(2 * (a**2 * b - x) / a**3)))

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


if x <= a**2 * b / 2:
    print(math.degrees(math.atan(a * b**2 / 2 * x)))
else:
    print(math.degrees(math.atan(2(a**2 * b - x) / a**3)))
Problem p02888 (python)

Fixed submission:
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += right - left

print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += max(right - left)

print(ans)
Problem p03796 (python)

Fixed submission:
N = int(input())

Ans = 1
for i in range(1, N+1):
    Ans *= i
    Ans %= (10**9+7)

print(Ans)

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


def time_memo(n):
    memo = [0]*(n+1)

    def _time(n):
        if n <= 0:
            return 0
        elif n == 1:
            return 1
        elif memo[n] != 0:
            return memo[n]
        else:
            memo[n] = _time(n-1)*n
            return memo[n]
    return _time(n)


print(time_memo(N) % (10 ^ 9+7))

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


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N) % (10 ^ 9+7))

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


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N))
Problem p02804 (python)

Fixed submission:
mod_base = (10 ** 9) + 7
n, k = map(int, input().split(" "))
a = map(int, input().split(" "))
sa = sorted(a, reverse=True)

fac = fac_inv = inv = list()


def comb_init(n_in, mod):
    global fac, fac_inv, inv
    fac = [1 for x in range(0, n_in + 1)]
    fac_inv = [1 for x in range(0, n_in + 1)]
    inv = [1 for x in range(0, n_in + 1)]
    # fac[0] = fac[1] = 1
    # fac_inv[0] = fac_inv[1] = 1
    # inv[0] = inv[1] = 1

    for i in range(2, n_in + 1):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        fac_inv[i] = fac_inv[i - 1] * inv[i] % mod


def comb(n_in, r, mod):
    if n_in < r:
        return 0
    elif n_in < 0 or r < 0:
        return 0
    else:
        return fac[n_in] * (fac_inv[r] * fac_inv[n_in - r] % mod) % mod


comb_init(n, mod_base)

sum_max = 0
sum_min = 0
for i in range(0, n):
    sai = sa[i]

    if (n - i - 1) >= (k - 1):
        # print("max: sai:%d comb:%d" % (sai, comb(n - i - 1, k - 1)))
        sum_max = (sum_max + sai * comb(n - i - 1, k - 1, mod_base)) % mod_base

    if i >= (k - 1):
        sum_min = (sum_min + sai * comb(i, k - 1, mod_base)) % mod_base
        # print("min: sai:%d comb:%d" % (sai, comb(i, k - 1)))

# print("%d %d" % (sum_max, sum_min))
print((sum_max - sum_min) % mod_base)

Buggy submission (verdict: Runtime Error):
import math

mod_base = (10 ** 9) + 7
n, k = map(int, input().split(" "))
a = map(int, input().split(" "))
sa = sorted(a, reverse=True)

fact = list()
fact.append(1)

for i in range(1, n + 1):
    fact.append(fact[i - 1] * i)


def comb(a, b):
    return int(fact[a] / (fact[b] * fact[a - b]))

sum_max = 0
sum_min = 0
for i in range(0, n):
    sai = sa[i]

    if (n - i - 1) >= (k - 1):
        # print("max: sai:%d comb:%d" % (sai, comb(n - i - 1, k - 1)))
        sum_max = (sum_max + sai * comb(n - i - 1, k - 1)) % mod_base

    if i >= (k - 1):
        sum_min = (sum_min + sai * comb(i, k - 1)) % mod_base
        # print("min: sai:%d comb:%d" % (sai, comb(i, k - 1)))

# print("%d %d" % (sum_max, sum_min))
print((sum_max - sum_min) % mod_base)
Problem p03289 (python)

Fixed submission:
import sys

s = input()

if s[0] != "A":
    print("WA")
    sys.exit(0)

if s[1] < "a" or s[1] > "z":
    print("WA")
    sys.exit(0)


sub = s[2:-1]
has = False
for c in sub:
    if not has and c == "C":
        has = True

    elif "a" <= c <= "z":
        continue

    else:
        has = False
        break

if not has:
    print("WA")
    sys.exit(0)

if "a" <= s[-1] <= "z":
    print("AC")
else:
    print("WA")

Buggy submission (verdict: Runtime Error):
import sys

s = input()

if s[0] != "A":
    print("WA")
    sys.exit(0)

if s[1] < "a" or s[1] > "z":
    print("WA")
    sys.exit(1)


sub = s[2:-1]
has = False
for c in sub:
    if not has and c == "C":
        has = True

    elif "a" <= c <= "z":
        continue

    else:
        has = False
        break

if not has:
    print("wA")
    sys.exit(0)

if "a" <= s[len(s) - 1] <= "z":
    print("AC")
else:
    print("WA")
Problem p03290 (python)

Fixed submission:
import itertools
import math

d, g = map(int, input().split(" "))

all = set()
for x in range(0, d):
    all.add(x)

pl = list()
for i in range(0, d):
    p, c = map(int, input().split(" "))
    pl.append((i, p, c))

ans = 100000000
for n in range(0, d + 1):
    for select in itertools.combinations(pl, n):
        full_sum = 0
        full_count = 0
        full_list = set()

        for fp, fn, fc in select:
            full_sum += (fp + 1) * 100 * fn + fc
            full_count += fn
            full_list.add(fp)
        
        if full_sum >= g:
            ans = min(ans, full_count)
            # print("full: %s rest: None score: %d ans: %d" % (str(full_list), full_sum, ans))

        elif len(all - full_list) > 0:
            rest = max(all - full_list)
            rest_n, rest_p, rest_c = pl[rest]

            if g - full_sum <= (rest_n + 1) * 100 * (rest_p - 1):
                ans = min(ans, full_count + math.ceil((g - full_sum) / ((rest_n + 1) * 100)))
                # print("full: %s rest: %d score: %d ans: %d" % (str(full_list), rest_n, full_sum + rest_n * (rest_p - 1), ans))
        

print(ans)

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

d, g = map(int, input().split(" "))

all = set()
for x in range(0, d):
    all.add(x)

pl = list()
for i in range(0, d):
    p, c = map(int, input().split(" "))
    pl.append((i, p, c))

ans = 100000000
for n in range(0, d + 1):
    for select in itertools.combinations(pl, n):
        full_sum = 0
        full_count = 0
        full_list = set()

        for fp, fn, fc in select:
            full_sum += (fp + 1) * 100 * fn + fc
            full_count += fn
            full_list.add(fp)
        
        if full_sum > g:
            ans = min(ans, full_count)
            # print("full: %s rest: None score: %d ans: %d" % (str(full_list), full_sum, ans))

        else:
            rest = max(all - full_list)
            rest_n, rest_p, rest_c = pl[rest]

            if g - full_sum <= (rest_n + 1) * 100 * (rest_p - 1):
                ans = min(ans, full_count + math.ceil((g - full_sum) / ((rest_n + 1) * 100)))
                # print("full: %s rest: %d score: %d ans: %d" % (str(full_list), rest_n, full_sum + rest_n * (rest_p - 1), ans))
        

print(ans)
Problem p03289 (python)

Fixed submission:
s=input()
print('AC' if 'C' in s[2:-1] and 'A' in s and s[1:].replace('C','',1).islower() else 'WA')

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

if s[0]=='A':
    if s[2:-1].count('C')==1:
        index=s[2:-1].index('C')
        if tmp==tmp.lower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
Problem p03308 (python)

Fixed submission:
n=int(input())
a=sorted(map(int,input().split()))
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=sorted(map(int,input()))
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=sorted(map(int,input()))
print(a[:-1]-a[0])
Problem p03573 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(a if [a,b,c].count(a)==1 else b if [a,b,c].count(b)==1 else c)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(a if [a,b,c].count(a)==1 else b if [a,b,c].count@(b)==1 else c)
Problem p03645 (python)

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

sa=set()
sb=set()

for i in range(m):
    a,b=map(int,input().split())
    if a==1:sb.add(b)
    if b==n:sa.add(a)

print('IMPOSSIBLE' if len(sa&sb)==0 else 'POSSIBLE')

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

sa=set()
sb=set()

for i in range(m):
    a,b=map(int,input().split())
    if a==1:sb.add(b)
    if b==N:sa.add(a)

print('IMPOSSIBLE' if len(sa&sb)=0 else 'POSSIBLE')
Problem p03673 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
print(' '.join(map(str,A[::-2]+A[N%2::2])))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])
Problem p02848 (python)

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

N = int(a)
S = b

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)

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

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)

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

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""
o = []
for c in S:
    # print(c)
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    # print(n)
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    #o.append(keys)
    # print(alpha_dict[n])


print(st)

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

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""
o = []
for c in S:
    # print(c)
    n = alpha_dict[c]
    n = n + 2
    if (n > 26):
        n = n - 26
    # print(n)
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    #o.append(keys)
    # print(alpha_dict[n])


print(st)
Problem p03477 (python)

Fixed submission:
abcd=input().split()
a=int(abcd[0])
b=int(abcd[1])
c=int(abcd[2])
d=int(abcd[3])
if a+b==c+d:
  print('Balanced')
else:
    if a+b>c+d:
      print('Left')
    else:
        print('Right')

Buggy submission (verdict: Runtime Error):
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b==c+d:
  print('Balanced')
else:
    if a+b>c+d:
      print('Left')
    else:
        print('Right')

Buggy submission (verdict: Runtime Error):
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b==c+d:
  print('Balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')

Buggy submission (verdict: Runtime Error):
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b=c+d:
  print('Balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')

Buggy submission (verdict: Runtime Error):
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b=c+d:
  print('balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')
Problem p02853 (python)

Fixed submission:
raw_input = input()
input_list = raw_input.split()   
 
coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])


if coding_contest_rank == 3:
    coding_money = 100000
if robot_rank == 3:
    robot_money = 100000
if coding_contest_rank == 2:
    coding_money = 200000
if robot_rank == 2:    
    robot_money = 200000
if coding_contest_rank == 1:
    coding_money = 300000
if robot_rank == 1:    
    robot_money = 300000
if coding_contest_rank > 3:
    coding_money = 0
if robot_rank > 3:
    robot_money = 0

if coding_contest_rank == 1 and robot_rank == 1: 
    print(coding_money + robot_money + 400000)
else:
    print(coding_money + robot_money)

Buggy submission (verdict: Runtime Error):
raw_input = input()
input_list = inp.split()   

coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])

if coding_contest_rank == 3 or robot_rank == 3:
  coding_money = 100000
  robot_money = 100000
elif coding_contest_rank == 2 or robot_rank == 2:
  coding_money = 200000
  robot_moeny = 200000
elif coding_contest_rank == 1 or robot_rank == 1:
  coding_money = 300000
  robot_moeny = 300000
elif coding_contest_rank == 1 and robot_rank == 1:
  print(1000000)
  break

print(coding_money + robot_money)
Problem p02917 (python)

Fixed submission:
N = int(input())
B =  [int(i) for i in input().split()]

A = [0] * N
sub= [0] * N
ans = 0

A[0] = B[0]
A[-1] = B[-1] 

# A[N-3]まで
for i in range(1, N-2):
    A[i] = min(B[i], B[i-1])

A[0] = B[0]
A[-1] = B[-1] 
A[N-2] = min(B[N-2], B[N-3])

for i in range(N):
    ans = ans + A[i]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
B =  [int(i) for i in input().split()]

A = [0] * N
sub= [0] * N
ans = 0

A[0] = B[0]
A[-1] = B[-1] 

for i in range(1, N-2):
    A[i]   = B[i]
    A[i+1] = B[i]
    if B[i] >= B[i+1]:
        A[i] = B[i-1]

if B[N-2] > B[N-1]:
    A[N-2] = B[N-3]
        
for i in range(N):
    ans = ans + A[i]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
B =  [int(i) for i in input().split()]

A = [0] * N
sub= [0] * N
ans = 0

A[0] = B[0]
A[-1] = B[-1] 

if N > 2:
    for i in range(1, N-1):
        A[i]   = B[i]
        A[i+1] = B[i]
        if B[i] > B[i+1]:
            A[i] = B[i-1]

    for i in range(N):
        ans = ans + A[i]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
B =  [int(i) for i in input().split()]

A = [0] * N
sub= [0] * N
ans = 0

A[0] = B[0]
A[-1] = B[-1] 

for i in range(1, N-1):
    A[i]   = B[i]
    A[i+1] = B[i]
    if B[i] > B[i+1]:
        A[i] = B[i-1]
    
for i in range(N):
    ans = ans + A[i]

print(ans)