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

Fixed submission:
set = input()
words = []
for i in range(len(set)):
    if set[i] == "0":
        words.append("0")
    if set[i] == "1":
        words.append("1")
    if set[i] == "B":
        try:
            words.pop(-1)
        except:
            pass
word = ""
for i in words:
    word += i
print(word)

Buggy submission (verdict: Runtime Error):
set = input()
words = []
for i in range(len(set)):
    if set[i] == "0":
        words.append("0")
    if set[i] == "1":
        words.append("1")
    if set[i] == "B":
        words.pop(-1)
word = ""
for i in words:
    word += i
print(word)
Problem p02921 (python)

Fixed submission:
a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[i]:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
    a = input()
    b = input()
    c = 0
    for i in range(3):
      if a[i] == b[i]:
        c += 1
    print(c)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = 0
for i in range(3):
  if a[a] == b[i]:
    c += 1
print(c)
Problem p02960 (python)

Fixed submission:
from sys import exit, stderr, stdin
input = stdin.readline


def main():
    MOD = 10**9 + 7
    S = input()[:-1]
    L = len(S)
    # 余り
    memo = [0 for _ in range(13)]
    memo[0] = 1

    for i in range(L):
        memo_prev = [x for x in memo]
        memo = [0 for _ in range(13)]
        # 数字なら以前までの余りにたす
        if S[i].isnumeric():
            n = int(S[i])
            for m in range(13):
                cur = (10*m+n)%13
                memo[cur] += memo_prev[m]
        # ?なら1~10の余りのケース全てをためす
        else:
            for n in range(10):
                for m in range(13):
                    cur = (10*m+n)%13
                    memo[cur] += memo_prev[m]
            for m in range(13):
                memo[m] %= MOD
    print(memo[5])


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)


# def debug(var, name="hoge"):
#     print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
#     return


def main():
    MOD = 10**9 + 7
    S = list(input()[:-1])
    L = len(S)
    modsum = 0
    # 余り
    memo_prev = [0 for _ in range(13)]
    memo_prev[0] = 1
    memo = [0 for _ in range(13)]

    for i in range(L):
        memo = [0 for _ in range(13)]
        # 数字なら以前までの余りにたす
        if S[i].isnumeric():
            for m in range(13):
                cur = (10*m+int(S[i]))%13
                memo[cur] += memo_prev[m]
        # ?なら1~10の余りのケース全てをためす
        else:
            for n in range(10):
                for m in range(13):
                    cur = (10*m+n)%13
                    memo[cur] += memo_prev[m]
                    memo[cur] %= MOD
        memo_prev = memo.copy()
    print(memo[5])


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)


# def debug(var, name="hoge"):
#     print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
#     return


def main():
    MOD = 10**9 + 7
    S = list(input()[:-1])
    # print(S)
    L = len(S)
    modsum = 0
    # 余り
    memo_prev = [0 for _ in range(13)]
    memo_prev[0] = 1
    memo = [0 for _ in range(13)]

    for i in range(L):
        memo = [0 for _ in range(13)]
        # 数字なら以前までの余りにたす
        if S[i].isnumeric():
            for m in range(13):
                cur = (10*m+int(S[i]))%13
                memo[cur] += memo_prev[m]
        # ?なら1~10の余りのケース全てをためす
        else:
            for n in range(10):
                for m in range(13):
                    cur = (10*m+n)%13
                    memo[cur] += memo_prev[m]
                    memo[cur] %= MOD
        memo_prev = memo.copy()


    print(memo[5])
    # print(memo)








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

Fixed submission:
from sys import exit, stderr, stdin
input = stdin.readline
def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    L, R = [int(n) for n in input().split()]
    if (L//2019)<(R//2019):
        print(0)
    else:
        l = L%2019
        r = R%2019
        res = 2019**2
        for i in range(l,r+1):
            for j in range(i+1,r+1):
                res = min(res,(i*j)%2019)
        print(res)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import exit, stderr, stdin
input = stdin.readline
def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    L, R = [int(n) for n in input().split()]
    if (L//2019)<(R//2019):
        print(0)
    else:
        l = L%2019
        r = R%2019
        res = 2019**2
        for i in range(l,r+1):
            for j in range(i+1,r+1):
                res = min(res,(i*j)%MOD)
        print(res)


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

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

kakeru=a*b
minus=a-b
plus=a+b


if kakeru > minus:
    grater=kakeru
else:
    grater=minus

if grater > plus:
    max=grater
else:
    max=plus

print(max)

Buggy submission (verdict: Runtime Error):
if kakeru > minus:
    grater=kakeru
else:
    grater=minus

if grater > plus:
    max=grater
else:
    max=plus

print(max)
Problem p02983 (python)

Fixed submission:
l,r = map(int, input().split())
waruL = l // 2019
waruR = r // 2019
if waruL < waruR :
    modMin = 0
else:
    modMin = 2018
    modL = l%2019
    modR = r%2019

    for i in range(modL,modR):
        for j in range(i+1,modR+1):
            modIJ = (i*j)%2019

            if modIJ < modMin:
                modMin = modIJ
print(modMin)

Buggy submission (verdict: Runtime Error):
if(modR <= modL):
    modMin = 0
else:
    modMin = 2018

for i in range(modL,modR):
    for j in range(i+1,modR+1):
        modIJ = (i*j)%2019
        # print(i)
        # print(j)
        # print('----')
        #print(modMin)
        #print(modIJ)
        #print('---')
        if modIJ < modMin:
            modMin = modIJ
print(modMin)
Problem p02995 (python)

Fixed submission:
from fractions import gcd

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

Buggy submission (verdict: Runtime Error):
import math

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//math.gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

Buggy submission (verdict: Runtime Error):
import math

def calcAns(n,x,y):
    print(math.gcd(x,y))
    return n - ((n//x) + (n//y) - (n//((x*y)//math.gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)
Problem p02957 (python)

Fixed submission:
import math
a, b = (int(x) for x in input().split(' '))

a = abs(a)
b = abs(b)

c = a + b

if c % 2 == 0:
    print(int(c / 2))
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
a,b = (int(x) for x in input().split(' '))

c = math.fabs(a)
d = math.fabs(b)
f = (c + b) % 2

if f = 0:
  print((c+b)/2)
if f >0:
  print('IMPOSSIBLE')
Problem p03029 (python)

Fixed submission:
a, p = list(map(int, input().split()))
print('{}'.format((a * 3 + p) // 2))

Buggy submission (verdict: Runtime Error):
a, p = [*map(int, input().split())]
print('{}'.format((a * 3 + p) // 2))

Buggy submission (verdict: Runtime Error):
a, p = [*map(int, input().split())]
print((a * 3 + p) // 2)
Problem p02921 (python)

Fixed submission:
import sys

s = sys.stdin.readline()
t = sys.stdin.readline()

c = 0
for i in range(3):
  if s[i] == t[i]:
    c += 1
    
print(c)

Buggy submission (verdict: Runtime Error):
import sys

s = sys.stdin.gets()
t = sys.stdin.gets()

c = 0
for i in range(3):
  if s[i] == t[i]:
    c += 1
    
print(c)
Problem p02921 (python)

Fixed submission:
S = list(input())
T = list(input())
count = 0
for i in range(len(S)):
    if S[i] == T[i]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
list = []
for i in range(N - 1):
    if H[i] < H[i + 1]:
        list.append('A')
    else:
        list.append('B')
W = ''.join(list)
Wlist = W.split('A')
anslist =[]
for i in range(len(Wlist)):
    anslist.append(len(Wlist[i]))
print(max(anslist))
Problem p02945 (python)

Fixed submission:
A, B = map(int, input().split())
print(max([A + B, A - B, A * B]))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]
A = []
cnt = 0
for k in S:
   A.append(''.join(sorted(k)))
for i in A[:]:
    cnt += A.count(i) - 1
    A.remove(i)
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]
A = []
cnt = 0
for k in S:
   B = sorted(k)
   C = ''.join(B)
   A.append(C)
for i in range(N):
    for j in range(N):
        if i >= j:
            continue
        elif A[i] == A[j]:
            cnt += 1
print(cnt)
Problem p02921 (python)

Fixed submission:
import sys
weather_forecast = input()
weather_real = input()
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Buggy submission (verdict: Runtime Error):
import sys
s = input().split()
weather_forecast = s[0]
weather_real = s[1]
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Buggy submission (verdict: Runtime Error):
import sys
s = input().split()
weather_forecast = s[0]
weather_real  = s[1]
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Buggy submission (verdict: Runtime Error):
import sys
s = input().split()
weather_forecast = s[0]
weather_real  = s[1]
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)
Problem p02921 (python)

Fixed submission:
s1=list(input())
s2=list(input())
count=0
for i in range(len(s1)):
    if(s1[i]==s2[i]):
        count+=1
print(count)

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

count = [0] * n
dif=0
start=0

for start in range(n-1):
#     print("start"+str(start))

    for i in range(start,n-1):
        dif=li[i]-li[i+1]
#         print(dif)
        if(dif<0):
            break
        count[start]+=1
#     print(count[start])

print(max(count))

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

while(c<B):
    if(count<1):
        c+=A
        count+=1
    else:
        c+=(A-1)
        count+=1
if(B<1.2):
    count*=0
print(count)
Problem p04043 (python)

Fixed submission:
x,y,z = map(int,input().split())
 
if(x==5):
  if(y==5):
    if(z==7):
      print("YES")
    else:
      print("NO")
  elif(y==7):
    if(z==5):
      print("YES")
    else:
      print("NO")
elif(x==7):
  if(y==5):
    if(z==5):
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")

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

if(x=5):
  if(y=5):
    if(z=7):
      print("YES")
    else:
      print("NO")
  elif(y=7):
    if(z=5):
      print("YES")
    else:
      print("NO")
elif(x=7):
  if(y=5):
    if(z=5):
      print("YES")
    else:
      print("NO")
else:
  print("NO")

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

if(x=5 and y=7 and z=5):
  print("YES")
  
else:
  print("NO")
Problem p03408 (python)

Fixed submission:

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(set(s))
a = max (s.count(l[i]) - t.count(l[i]) for i in range(len(l)))

print(a if a > 0 else 0)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(set(s))
a = max (n.count(l[i]) - m.count(l[i]) for i in range(len(l)))

print(a if a > 0 else 0)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(s)
a = max (n.count(l[i]) - m.count(l[i]) for i in range(len(l)))

print(a)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
print("Even" if a*b%2==0 else "Odd")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print("Even"if a*b%2==0: else: "Odd")

Buggy submission (verdict: Runtime Error):
input(a,b)

c = a * b
if c % 2 == 0:
  print("Even")
  else:
    print("Odd")
Problem p03469 (python)

Fixed submission:
bun = input()
bunbun = bun.replace("2017", "2018")
print(bunbun)

Buggy submission (verdict: Runtime Error):
bun = input()
str_bun = list(bun)
str_bun[0,1,2,3,] = "2","0","1","8"
str_changed = "".join(str_bun)
print(str_bun)
Problem p03470 (python)

Fixed submission:
n = int(input())
d = [input() for i in range(n)]

d = set(d)

ans = len(d)
print(ans)

Buggy submission (verdict: Runtime Error):
n, y = map(int,input().split())
a = -1
b = -1
c = -1

for i in range(n+1):
    for j in range(n+1):
        if 0 <= n - i - j <= 2000 and y == 10000*i + 5000*j + 1000*(n - i - j):
            a = i
            b = j
            c = n - i -j
            break
print(a,b,c)
Problem p03493 (python)

Fixed submission:
print(int(input())%9)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
l = []

for i in a:
	s = 0
	while i % 2 == 0:
		i = i/2
		s += 1
	l.append(s)

print(min(l))
Problem p03623 (python)

Fixed submission:
x,a,b = map(int,input().split())
s = abs(a - x)
t = abs(b - x)
ans = "A"
if s > t:
    ans = "B"

print(ans)

Buggy submission (verdict: Runtime Error):
x,a,b = map(int,input().split())
s = abs(a - x)
t = abs(b - x)

print(min[s, t])
Problem p03644 (python)

Fixed submission:
l = list()
n = int(input())
original_list = list(range(1,n+1))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)

a = l.index(max(l))
print(original_list[a])

Buggy submission (verdict: Runtime Error):
l = list()
n = int(input())
original_list = list(range(1,n))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))

Buggy submission (verdict: Runtime Error):
l = list()
original_list = list()
n = int(input())
original_list = list(range(1,n))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))

Buggy submission (verdict: Runtime Error):
l = list()
n = int(input())
original_list = list(range(1,n))
for num in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))

Buggy submission (verdict: Runtime Error):
l = list()
n = int(input())
original_list = list(range(1,n))

for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))
Problem p02921 (python)

Fixed submission:
import sys

S = str(sys.stdin.readline())
T = str(sys.stdin.readline())

# Neglect the last newline character
num_correct = sum(1 if S[i] == T[i] else 0 for i in range(len(S[:-1])))

print(num_correct)

Buggy submission (verdict: Runtime Error):
import sys

N = int(sys.stdin.readline())
print(sum(n + 1 for n in range(N - 1)))
Problem p02924 (python)

Fixed submission:
import sys

N = int(sys.stdin.readline())
print(int((N - 1) * N // 2))

Buggy submission (verdict: Runtime Error):
import sys

N = int(sys.stdin.readline())
Ns = list(range(1, N + 1))

print(sum(Ns[i] for i in range(N - 1)))

Buggy submission (verdict: Runtime Error):
import sys

N = int(sys.stdin.readline())
Ns = list(range(1, N + 1))
Ps = list(Ns[i + 1] for i in range(0, N - 1))
Ps.extend([Ns[0]])
#print(Ns)
#print(Ps)
mod_sum = sum(Ns[i] % Ps[i] for i in range(len(Ns)))
print(mod_sum)
#print()

Buggy submission (verdict: Runtime Error):
import sys

N = int(sys.stdin.readline())
Ns = list(range(1, N + 1))

Ps = list(Ns[i + 1] for i in range(0, N - 1))
Ps.extend([Ns[-1]])
#print(Ns)
#print(Ps)
mod_sum = sum(Ns[i] % Ps[i] for i in range(len(Ns)))
print(mod_sum)
Problem p03455 (python)

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

if num % 2 == 0:
    print("Even")
else:
    print("Odd")

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

num = a * b

if num % 2 == 0:
    print("Even")
else
    print("Odd")
Problem p03943 (python)

Fixed submission:
a, b, c = map(int, input().split())
nyuryoku = [a, b, c]
saidai = max(nyuryoku)
nyuryoku.remove(saidai)

if saidai == sum(nyuryoku):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
input = [a, b, c]
saidai = max(input)
nokori = input.remove(saidai)

if saidai == sum(nokori):
    print('Yes')
else:
    print('No')
Problem p02921 (python)

Fixed submission:
print(sum(s == t for s, t in zip(input(), input())))

Buggy submission (verdict: Runtime Error):
n=int(input())
print(n*(n-1)//2)
Problem p02927 (python)

Fixed submission:
m,d = map(int, input().split(' '))
mlist = list(range(m+1))
c = 0
for _d in range(d+1):
	d1 = _d // 10
	d0 = _d % 10
	if d1 > 1 and d0 > 1 and d1*d0 in mlist:
		c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
count = [0]*2000
A = (10**9)+7
c_in = 0
for i in range(n):
  for j, t in enumerate(a[:i]):
    c_in += int(t > a[i])
  count[a[i]-1] += 1
c_out = 0
for i in range(n):
  c_out += sum(count[:a[i]-1])
N = (c_in*k)%A + (k*(k-1)//2)*c_out%A
print(N)
Problem p02928 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=0
for i in range(n):
    for j in range(i+1,n):
        if a[i]>a[j]:
            x+=1
y=0
for i in range(n):
    for j in range(n):
        if a[i]>a[j]:
            y+=1
cnt=(x*k)+(k*(k-1)//2*y)
print(cnt%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
A = (10**9)+7
c_in = 0
for i in range(n):
  for j, t in enumerate(a[:i]):
    c_in += int(t > a[i])
  count[a[i]-1] += 1
c_out = 0
for i in range(n):
  for j, t in enumerate(a):
    c_out += int(t > a[i])
N = (k*c_in)%A + ((k*(k-1)//2)*c_out)%A
print(int(N))

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
amax = max(a)
count = [0]*2000
c_in = 0
for i in range(n):
  for j, t in enumerate(a[:i]):
    c_in += int(t > a[i])
    if t > a[i]:
  count[a[i]-1] += 1
c_out = 0
for i in range(n):
  c_out += sum(count[:a[i]-1])
res = int(c_in*k + c_out*k*(k-1)/2)
print(res%(10**9+7))
Problem p02945 (python)

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
else:
  print(z)

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

x = max([A + B, A - B, A * B])

print(x)

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reverse)
print(aaa[0])

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reseve)
print(aaa[0])

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x > y and x > z:
  print('x')
elif y > x and y > z:
  print('y')
else:
  print('z')
Problem p02923 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split(" ")))
D=[0]*N
M=[0]*N
D[N-1]=0
M[N-1]=0
for i in reversed(range(N-1)):  
  if H[i] >= H[i+1]:
    D[i]=D[i+1]+1
  else:
    D[i]=0
  M[i]=max(D[i],M[i+1])
#print(H)
#print(D)
#print(M)
print(M[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split(" ")))
D=[0]*N
M=[0]*N

D[N-1]=H[N-1]
M[N-1]=1
for i in reversed(range(N-1)):
  if H[i] > H[i-1]:
    D[i]=D[i-1]+1
  else:
    D[i]=1
  M[i]=max(D[i],M[i-1])
return M[0]
Problem p02952 (python)

Fixed submission:
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) - A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p <= n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main2()

Buggy submission (verdict: Runtime Error):
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) % A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p<n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main1()
Problem p03139 (python)

Fixed submission:
N, A, B = map(int, raw_input().split())
m=A+B
print min(A, B), max(0,m-N)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
m=A+B
print(min(A, B), max(0,m-N))

Buggy submission (verdict: Runtime Error):
import sys
file= lambda location: {True:sys.stdin, False:open(location,"r")}[location==""]

location="subs.txt"#Enter location here
sys.stdin=file(location)
raw_input=sys.stdin.readline

for i in xrange(int(raw_input())):
N,A,B=map(int,raw_input().split())
m=A+B
if A==B==N:
	print N,N
elif(m>N):
	if A==B:
		print A,1
	else:
		print min(A,B),abs(A-B)
else:
	print min(A,B),0
Problem p03359 (python)

Fixed submission:
#for i in xrange(15):
a,b=map(int,raw_input().split())
if(a>b): print "%d"%(a-1)
else: print "%d"%(a)

Buggy submission (verdict: Runtime Error):
a,b=map(int,raw_input().split())
it(a>b): print(a-1)
else: print a