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

Fixed submission:
#!/usr/bin/env python
# coding:utf-8
import os, sys
import math

N = input()
K = input()
X=input()
Y=input()
if N <= K:
    print X*N
else:
    print X*K + Y*(N-K)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding:utf-8
import os, sys
import math

N = input()
K = input()
X=input()
Y=input()
if N-K >= 0:
    print X*K + Y*(N-K)
else:
    pritn X*K
Problem p03473 (python)

Fixed submission:
print(48 - int(input()))

Buggy submission (verdict: Runtime Error):
print(48 - input())
Problem p03844 (python)

Fixed submission:
data = input().split()

if data[1] in "+":
    print(int(data[0]) + int(data[2]))
else:
    print(int(data[0]) - int(data[2]))

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

if data[1] = "+":
    print int(data[0] + data[2])
else
    print int(data[0] - data[2])

Buggy submission (verdict: Runtime Error):
data = input().split() # "1 2 3"と入力
 
if data[1]) = "+":
    print int(data[0] + data[2])
else
    print int(data[0] - data[2])

Buggy submission (verdict: Runtime Error):
data = input().split() # "1 2 3"と入力

if data[1]) = "+":
    print data[0] + data[2]
else
    print data[0] - data[2]
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
p = G * 2 - R
print(p)

Buggy submission (verdict: Runtime Error):
R = int(input())
G = int((input))
peform =
Problem p03473 (python)

Fixed submission:
M = input()
print(24 - int(M) + 24)

Buggy submission (verdict: Runtime Error):
M = input()
print(24 - M + 24)
Problem p03474 (python)

Fixed submission:
a,b=map(int,input().split())
s=str(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
s=str(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
s=list(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
    print("Yes")
else:
    print("No")
Problem p03479 (python)

Fixed submission:
x,y=map(int,input().split())
len=1
while True:
  if x*2<=y:
    len+=1
  else:
    break
  x*=2
print(len)

Buggy submission (verdict: Runtime Error):
x,y=map(int,inout().split())
len=0
flag=False
while flag:
  if x*2<y:
    len+=1
print(len)
Problem p03502 (python)

Fixed submission:
n=int(input())
m=n
s=0
while True:
  q,mod=divmod(m,10)
  s+=mod
  m=q
  if q<=0:
    break
if n%s==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
m=n
s=0
while True:
  q,mod=divmod(m,10)
  s+=mod
  m=q
  if q<=0:
    break
if n%s==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
m=n
s=0
while true:
  q,mod=divmod(m,10)
  s+=mod
  m=q
  if q<=0:
    break
if n%s==0:
  print("Yes")
else:
  print("No")
Problem p03473 (python)

Fixed submission:
M = input()
print 48-M

Buggy submission (verdict: Runtime Error):
d1 = 24 - M
ans = d1 + 24
print ans
Problem p03474 (python)

Fixed submission:
A ,B = map(int, raw_input().split())
S = raw_input().split("-")
print  "Yes" if len(S) == 2 and len(S[0]) == A and len(S[1]) == B else "No"

Buggy submission (verdict: Runtime Error):
A ,B = map(int, raw_input().split())
S = raw_input().split("-")
print len(S) == 2 and len(S[0]) == A and len(S[1]) == B ? "Yes" : "No"
Problem p03475 (python)

Fixed submission:
# C - Special Trains
import math

N = int(raw_input())
C, S, F = [0]*(N-1), [0]*(N-1), [0]*(N-1)
for i in range(N-1):
  C[i], S[i], F[i] = map(int, raw_input().split())
result = [0] * N

for station in range(N):
  now = station
  time = 0
  while now != N-1:
    time = S[now] + C[now] if time <= S[now] else int(math.ceil(float(time)/float(F[now])))*F[now] + C[now]
    now += 1
  result[station] = time

for i in result: print i

Buggy submission (verdict: Runtime Error):
# C - Special Trains
import math

N = int(raw_input())
C, S, F = [0]*(N-1), [0]*(N-1), [0]*(N-1)
for i in range(N-1):
  C[i], S[i], F[i] = map(int, raw_input().split())
result = [0] * N

for station in range(N):
  now = station
  time = 0
  while now != N-1:
    time = S[now] + C[now] if time <= S[now] else int(math.floor(time/F[now])*F[now] + C[now]
    now += 1
  result[station] = time

for i in result: print i
Problem p03477 (python)

Fixed submission:
# A - Libra
# coding: utf-8
A, B, C, D = map(int, raw_input().split())
if A+B > C+D:
  print "Left"
elif A+B < C+D:
  print "Right"
else:
  print "Balanced"

Buggy submission (verdict: Runtime Error):
# A - Libra
# coding: utf-8
A, B, C, D = map(int, raw_input())
if A+B > C+D:
  print "Left"
elif A+B < C+D:
  print "Right"
else:
  print "Balanced"
Problem p03485 (python)

Fixed submission:
A, B = map(int, raw_input().split())
print (A+B+1)/2

Buggy submission (verdict: Runtime Error):
# B - Two Anagrams
# coding: utf-8

A = list(raw_input())
B = list(raw_input())
A.sort()
B.sort(), B.reverse()

print "Yes" if A < B else "No"
Problem p03493 (python)

Fixed submission:
# A - Placing Marbles
# coding: utf-8

s1, s2 ,s3 = map(int, raw_input())
s = [s1, s2, s3]

print s.count(1)

Buggy submission (verdict: Runtime Error):
# A - Placing Marbles
# coding: utf-8

s1, s2 ,s3 = map(int, raw_input().split())
s = [s1, s2, s3]

print s.count(1)
Problem p03495 (python)

Fixed submission:
# C - Not so Diverse
# coding: utf-8

import collections

N, K = map(int, raw_input().split())
A = map(int, raw_input().split())
A_dict = collections.Counter(A)
A_common = A_dict.most_common(K)

if len(A_dict) <= K:
  result = 0
else:
  result = N
  for i in range(K): result -= A_common[i][1]

print result

Buggy submission (verdict: Runtime Error):
import collections

N, K = map(int, raw_input().split())
A = map(int, raw_input().split())
A_dict = collections.Counter(A)
A_common = A_dict.most_common(K)
result = N

for i in range(K): result -= A_common[i][1]

print result
Problem p03501 (python)

Fixed submission:
# A - Parking

N, A, B = map(int, raw_input().split())

print min(N*A, B)

Buggy submission (verdict: Runtime Error):
# A - Parking

N, A, B = map(int, raw_input().split)

print min(N*A, B)

Buggy submission (verdict: Runtime Error):
# A - Parking

N, A, B = map(int, raw_input().split)

print mint(N*A, B)
Problem p03719 (python)

Fixed submission:
a,b,c=map(int,input().split())
print('Yes' if a <= c <= b else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print('Yes' if a <= c <= b else ''No')
Problem p03994 (python)

Fixed submission:
s=list(input())
k=int(input())
for i in range(len(s)):
    c = (ord('z') - ord(s[i]) + 1)%26
    if c <= k:
        k -= c
        s[i] = 'a'
s[-1] = chr(ord('a') + ((ord(s[-1]) - ord('a') + k) % 26))
print(''.join(s))

Buggy submission (verdict: Runtime Error):
    s=list(input())
    k=int(input())
    for i in range(len(s)):
        c = ord('z') - ord(s[i]) + 1
        if c > k:
            continue
        else:
            k -= c
            s[i] = 'a'
    if k > 0:
        s[-1] = chr(ord('a') + ((ord(s[-1]) - ord('a') + k) % 26))
    print(''.join(s))
Problem p03473 (python)

Fixed submission:
print str(48 - int(raw_input()))

Buggy submission (verdict: Runtime Error):
print str(48 - int(raw_input))
Problem p03606 (python)

Fixed submission:
N=int(input())
c=0
for i in range(N):
    l,r=(int(i) for i in input().split())
    c+=r-l+1
print(c)

Buggy submission (verdict: Runtime Error):
N=input()
c=0
for i in range(N):
    l,r=(int(i) for i in input().split())
    c+=r-l+1
print(c)
Problem p03633 (python)

Fixed submission:
# your code goes here
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    a1=a
    b1=b
    while b1>0:
        r=a1%b1
        a1=b1
        b1=r
    a//=a1
    a*=b
    return a
N=int(input())
T=[int(input()) for i in range(N)]
if N==1:
    print (T[0])
else:
    m=gcd(T[0],T[1])
    i=2
    while i <N:
        m=gcd(m,T[i])
        i+=1
    print(m)

Buggy submission (verdict: Runtime Error):
# your code goes here
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    a1=a
    b1=b
    while b1>0:
        r=a1%b1
        a1=b1
        b1=r
    a//=a1
    a*=b
    return a
N=int(input())
T=[int(input()) for i in range(N)]
m=gcd(T[0],T[1])
i=2
while i <N:
    m=gcd(m,T[i])
    i+=1
print(m)

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    while b>0:
        r=a%b
        a=b
        b=r
    return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
i=2
while i <N:
    g=gcd(T[i],g)
    i+=1
M=g
for i in range(N):
    M*=T[i]//g
print(M)

Buggy submission (verdict: Runtime Error):
# your code goes here
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    while b>0:
        r=a%b
        a=b
        b=r
    return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
i=2
while i <N:
    g=gcd(T[i],g)
M=g
for i in range(N):
    M*=T[i]//g
print(M)

Buggy submission (verdict: Runtime Error):
# your code goes here
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    while b>0:
        r=a%b
        a=b
        b=r
    return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
for i in range(1,N-1):
    g=gcd(T[i],g)
M=g
for i in range(N):
    M*=T[i]//g
print(M)
Problem p03694 (python)

Fixed submission:
N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[0]
ma=a[0]
i=0
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[0]
ma=a[0]
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[i]
ma=a[i]
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)
Problem p03698 (python)

Fixed submission:
S=list(input())
S.sort()
nd=0
i=0
while nd==0 and i<len(S)-1:
    if S[i]==S[i+1]:
         nd=1
    i+=1
if nd==1:
    print ("no")
else:
    print ("yes")

Buggy submission (verdict: Runtime Error):
S=list(input())
sorted(S)
nd=0
while nd==0 and i<len(S):
    if S[i]==S[i+1]:
         nd=1
    i+=1
if nd==1:
    print ("no")
else:
    print ("yes")
Problem p03759 (python)

Fixed submission:
a,b,c=(int(i) for i in input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
so=input()
se=input()
sol=list(so)
sel=list(se)
i=0
while i<len(sol) or i<len(sel):
    s.append(sol[i])
    s.append(sel[i])
    i=i+1
print "".join(s)

Buggy submission (verdict: Runtime Error):
s=[int(input()) for i in range(3)]
a=0
if i[1]-i[0]==i[2]-i[1]:
    print("YES")
else:
    print("NO")
Problem p03473 (python)

Fixed submission:
M = int(input())
print(48 - M)

Buggy submission (verdict: Runtime Error):
data = input().split()
A = int(data[0])
B = int(data[1])
S = input()
s1 = S[:A]
s2 = S[A:A+1]
s3= S[len(S)-B:]
if s1.isdigit() == True:
    if s2 == "-":
        if s3.isdigit() == True:
            print("Yes")
        else : 
            print("No")
    else:
        print("No")
else :
    print("No")
Problem p03474 (python)

Fixed submission:
data = input().split()
A = int(data[0])
B = int(data[1])
S = input()
s1 = S[:A]
s2 = S[A:A+1]
s3= S[len(S)-B:]
if s1.isdigit() == True:
    if s2 == "-":
        if s3.isdigit() == True:
            print("Yes")
        else : 
            print("No")
    else:
        print("No")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
A= int(input())
B = int(input())
S = input()
s1 = S[:A]
s2 = S[A:A+1]
s3= S[len(S)-B:]
if s1.isdigit() == True:
    if s2 == "-":
        if s3.isdigit() == True:
            print("Yes")
        else : 
            print("No")
    else:
        print("No")
else :
    print("No")
Problem p03473 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(raw_input())
print str(48-a)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(raw_input())
print str(48-a)
Problem p03474 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  n = s.count('-')
  if n == 1:
    x,y = map(str, s.split('-'))
    if len(x) == a:
      if len(y) == b:
        ok = True

if ok:
  print 'Yes'
else:
  print 'No'

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  n = s.count('-')
  if n = 1:
    x,y = map(str, s.split('-'))
    if len(x) == a:
      if len(y) == b:
        ok = True

if ok:
  print 'Yes'
else:
  print 'No'

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  n = s.count('-')
  if n <= 1:
    x,y = map(str, s.split('-'))
    if len(x) == a:
      if len(y) == b:
        ok = True

if ok:
  print 'Yes'
else:
  print 'No'

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  x,y = map(str, s.split('-'))
  if len(x) == a:
    if len(y) == b:
      print ok
Problem p03474 (python)

Fixed submission:
a,b = map(int,raw_input().split())
valid = True
s = raw_input()
for ind in range(len(s)):
        if ind == a:
            if s[ind] != "-":
                valid = False
        else:
            if s[ind].isalpha() or s[ind] == "-":
                valid = False        
if valid: print "Yes"
else: print "No"

Buggy submission (verdict: Runtime Error):
a,b = map(int,raw_input().split())
if s[a+1] == "-" and len(s.strip("-")) == len(s) - 1:
    print "Yes"
else: print "No"
Problem p03609 (python)

Fixed submission:
l = raw_input().split()
x = l[0]
t = l[1]
if int(x) - int(t) > 0:
    print int(x) - int(t)
else:
    print 0

Buggy submission (verdict: Runtime Error):
import sys
x = sys.argv[0]
t = sys.argv[1]
print x - t

Buggy submission (verdict: Runtime Error):
import sys
x = sys.argv[0]
t = sys.argv[1]
print X - t

Buggy submission (verdict: Runtime Error):
X,t = map(int,rawinput().split)
return X-t
Problem p03644 (python)

Fixed submission:
n = int(input())
pow = n
ans = 0
while 2**pow > n:
    pow-=1
print(2**pow)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
while 2**n > n
	n-=1
ans = 2**n
print(ans)
Problem p03813 (python)

Fixed submission:
a = int(input())
if a < 1200:
	print("ABC")
else: print("ARC")

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
if a < 1200:
  	print('ABC')
else:
  	print('ARC)
Problem p03496 (python)

Fixed submission:
n = int(input())
A = [int(i) for i in input().split()]

C = []
max_A = max(A)
max_idx = A.index(max_A)
min_A = min(A)
min_idx = A.index(min_A)

if abs(max_A) >= abs(min_A):
    for i in range(n):
        #A[i] += max_A
        C.append([max_idx+1, i+1])
    for i in range(1, n):
        #A[i] += A[i-1]
        C.append([i, i+1])
else:
    for i in range(n):
        #A[i] += min_A
        C.append([min_idx+1, i+1])
    for i in range(n, 1, -1):
        #A[n-i+2] += A[n-i+1]
        #C.append([n-i+2, n-i+3])
        C.append([i, i-1])

print(len(C))
for i, j in C:
    print('{0} {1}'.format(i, j))

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

C = []
max_A = max(A)
max_idx = A.index(max_A)
min_A = min(A)
min_idx = A.index(min_A)

if abs(max_A) >= abs(min_A):
    for i in range(n):
        A[i] += max_A
        C.append([max_idx+1, i+1])
    for i in range(1, n):
        A[i] += A[i-1]
        C.append([i, i+1])
else:
    for i in range(n):
        A[i] += min_A
        C.append([min_idx+1, i+1])
    for i in range(n-1):
        A[n-i+2] += A[n-i+1]
        C.append([n-i+2, n-i+3])

print(len(C))
for i, j in C:
    print('{0} {1}'.format(i, j))
Problem p03475 (python)

Fixed submission:
def c_SpecialTrains(N, STATION):
    ans = []
    for i in range(N):
        t = 0  # 駅iからNまでにかかる時間
        for j in range(i, N - 1):
            c, s, f = STATION[j]
            if t < s:
                t = s  # まだ運行していないので、運行するまで待つ必要がある
            elif t % f == 0:
                # tがfで割り切れるなら、すぐに鉄道に乗ればよい
                # sはfで割り切れることが保証されているので、この条件式でよい
                pass
            else:
                t += f - (t % f)  # この分だけ駅で待つ必要がある
            t += c  # 次の駅までかかる時間
        ans.append(t)
    return '\n'.join(map(str, ans))
 
N = int(input())
STATION = [[int(i) for i in input().split()] for j in range(N-1)]
print(c_SpecialTrains(N, STATION))

Buggy submission (verdict: Runtime Error):
n = input('input N: ')

c, s, f = [], [], []
for i in range(int(n) - 1):
    tmp = input('input C, S, F: ').split()
    c.append(tmp[0])
    s.append(tmp[1])
    f.append(tmp[2])

# n = 3
# c = [6, 1]
# s = [5, 10]
# f = [1, 1]
# n = 4
# c = [12, 52, 99]
# s = [24, 16, 2]
# f = [6, 4, 2]
# n = 4
# c = [12, 44, 66]
# s = [13, 17, 4096]
# f = [1, 17, 64]

a = [None] * n
for i in reversed(range(int(n))):

    if i == n - 1:
        a[i] = 0
        continue

    ta = s[i] + c[i]
    if i == n - 2:
        a[i] = ta
        continue

    for j in range(i, n - 2):
        nn = j + 1
        if ta <= s[nn]:
            ta = a[nn]
        else:
            yo = ta % f[nn]
            add = 0 if yo == 0 else f[nn] - yo
            ta += add + c[nn]
    a[i] = ta


[print(aa) for aa in a]
Problem p03998 (python)

Fixed submission:
a = list(input())
b = list(input())
c = list(input())
# print('a',a)
# print('b',b)
# print('c',c)
# exit()
ptr = 'a'
while (True):
	if ptr == 'a':
		if a == []:
			print('A')
			break
		ptr = a.pop(0)
	if ptr == 'b':
		if b == []:
			print('B')
			break
		ptr = b.pop(0)
	if ptr == 'c':
		if c == []:
			print('C')
			break
		ptr = c.pop(0)

Buggy submission (verdict: Runtime Error):
a = list(input())
b = list(input())
c = list(input())
# print('a',a)
# print('b',b)
# print('c',c)
# exit()
ptr = 'a'
while (True):
	if ptr == 'a':
		ptr = a.pop(0)
	if ptr == 'b':
		ptr = b.pop(0)
	if ptr == 'c':
		ptr = c.pop(0)

	if ptr == 'a' and a == []:
		print('A')
		break
	elif ptr == 'b' and  b == []:
		print('B')
		break
	elif ptr == 'c' and c == []:
		print('C')
		break
Problem p03477 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
print("Left" if A+B > C+D else "Balanced" if A+B == C+D else "Right")

Buggy submission (verdict: Runtime Error):
C,D=map(int,input().split())
print("Left" if A+B > C+D else "Balanced" if A+B == C+D else "Right")
Problem p03493 (python)

Fixed submission:
S = input()

cout = 0
for i in range(0,len(S)):
    if S[i] == '1':
        cout += 1

print(cout)

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

N = int(input())
data = np.array([int(i) for i in input().split()])
cout = 0
while 1:
    index = np.where(data%2 == 0)
    data_even = data[index]
    # print(data_even)
    # print(len(data_even) == len(data))
    if len(data_even) == len(data):
        cout += 1
        data = data_even / 2
    else:
        break


print(cout)

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

cout = 0
for i in range(0,len(S)):
    if S[i] == '1':
        cout += 1

return cout
Problem p03477 (python)

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

l = a+b
r = c+d
msg = "Balanced"
if l > r:
   msg = "Left"
elif l < r:
   msg = "Right"
print(msg)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
 
num = 0
while x < y:
    num += 1
    x *= 2
    
print(num)

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

num = 1
while x < y:
    x *= 2
    num += 1

print(num)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
tot = 0
for num in range(1, n+1):
     sum_dgt = sum(map(int, str(num)))
     if sum_dgt >= a and sum_dgt <= b:
         tot += num
print(tot)
Problem p03477 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
#a, b, c, d = 3,4,5,2
if a + b > c + d:
    result = "Left"
elif a + b == c + d:
    result = "Balanced"
elif a + b < c + d:
    result = "Right"
print(result)

Buggy submission (verdict: Runtime Error):
#a = 314159265
#b = 358979323846264338
a, b = map(int, input().split())
count = 1
x = a
#print(x)
while x * 2 <= b:
    x = x * 2
    #print(x)
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
#a = 314159265
#b = 358979323846264338
a, b = map(int, input().split())
count = 1
x = a
print(x)
while x * 2 <= b:
    x = x * 2
    #print(x)
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
count = 1
x = a
print(x)
while x * 2 <= b:
    x = x * 2
    print(x)
    count += 1
print(count)
Problem p03477 (python)

Fixed submission:

a,b,c,d = map(int, input().split(" "))

if a+b < c+d :
    print("Right\n")
elif a+b > c+d:
    print("Left\n")
else :
    print("Balanced\n")

Buggy submission (verdict: Runtime Error):

def sum_dig(num):
    nsum = 0
    while(num):
        dig = num % 10
        nsum = nsum + dig
        num = num // 10
#        print (dig,sum,num)
    return nsum


lim, nmin, nmax = map(int, input().split(" "))
chk_sum = 0
for i in range(1,lim+1) :
    chk = sum_dig(i)
#    print(chk,type(chk))
    if (chk >= nmin and chk <= nmax) :
        chk_sum += i

print (chk_sum)

Buggy submission (verdict: Runtime Error):

def sum_dig(num):
    sum = 0
    while(num):
        dig = num % 10
        sum = sum + dig
        num = num // 10
#        print (dig,sum,num)
    return sum


lim, min, max = map(int, input().split(" "))
chk_sum = 0
for i in range(1,lim+1) :
    chk = sum_dig(i)
#    print(chk,type(chk))
    if (chk >= min and chk <= max) :
        chk_sum += i

print (chk_sum)

Buggy submission (verdict: Runtime Error):
import sys

def sum_dig(num):
    sum = 0
    while(num):
        dig = num % 10
        sum = sum + dig
        num = num // 10
#        print (dig,sum,num)
    return sum


lim, min, max = map(int, input().split(" "))
chk_sum = 0
for i in range(1,lim+1) :
    chk = sum_dig(i)
#    print(chk,type(chk))
    if (chk >= min and chk <= max) :
        chk_sum += i

print (chk_sum)
Problem p03555 (python)

Fixed submission:
li_a=list(input())
li_b=list(input())
li_a.reverse()
if li_a == li_b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
li_a=list(input())
li_b=list(input())
li_a.reverse()
if li_a==li_b:
    print(YES)
else:
    print(NO)
Problem p03555 (python)

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

a_list = list(a)
b_list = list(b)

if a_list[0] == b_list[2] and a_list[1] == b_list[1] and a_list[2] == b_list[0]:
    print('YES')
else:
    print('NO')

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

A = [int(i) for i in input().split()]

B = [int(i) for i in input().split()]

C = [int(i) for i in input().split()]

can_make = 0
for upp in range(N):
    for midd in range(N):
        for loww in range(N):
            if A[upp] < B[midd] < C[loww]:
                can_make += 1

print　can_make

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

A = [int(i) for i in input().split()]

B = [int(i) for i in input().split()]

C = [int(i) for i in input().split()]

can_make = 0
for upp in range(N):
    for midd in range(N):
        for loww in range(N):
            if A[upp] < B[midd] < C[loww]:
                can_make += 1

print(can_make)

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

A = [int(i) for i in input().split()]

B = [int(i) for i in input().split()]

C = [int(i) for i in input().split()]

can_make = 0
for upp in range(N):
    for midd in range(N):
        for loww in range(N):
            if A[upp] < B[midd] < C[loww]:
                can_make += 1

print(can_make)