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

Fixed submission:
a,b=map(int,raw_input().split())
print (a+b)%24

Buggy submission (verdict: Runtime Error):
import math
n=int(raw_input())
sq=math.sqrt(n)
ans=None



if str(sq)[-2]=='.':
    print len(str(sq))-2
else:
    nu=[]
    while sq>1:
        sq=int(sq)
        if n%sq==0:
            nu.append(str(sq))
            nu.append(str(n/sq))
            sq-=1
            break
        else:
            sq-=1
    if len(nu)!=0:
        nu.sort()
        print len((nu[1]))
    else:
        print len(str(n))
Problem p03962 (python)

Fixed submission:
l=map(int,raw_input().split())
c=3
for i in l:
    if l.count(i)==3:
        c= 1
        break
    elif l.count(i)==2:
        c= 2
        break
print c

Buggy submission (verdict: Runtime Error):
l=map(int,raw_input().split())
c=3
for i in l:
    if l.count(i)==3:
        c= 1
        break
    elif l.count(i)==2:
        c= 2
        break
print c
vvvvv
Problem p04043 (python)

Fixed submission:
l=map(int,raw_input().split())
if l.count(5)==2 and l.count(7)==1  :
    print 'YES'
else:
    print 'NO'

Buggy submission (verdict: Runtime Error):
n,l=map(int,raw_input().split())
l=[]
for i in range(n):
    l.append(raw_input())
l.sort()
print ''.join(l)
Problem p02727 (python)

Fixed submission:
from collections import deque


def main():
    X, Y, A, B, C = map(int, input().split(' '))
    a_list = list(map(int, input().split(' ')))
    b_list = list(map(int, input().split(' ')))
    c_list = list(map(int, input().split(' ')))
    a_deq = deque(sorted(a_list, reverse=True)[:X])
    b_deq = deque(sorted(b_list, reverse=True)[:Y])
    c_deq = deque(sorted(c_list, reverse=True))
    result = sum(a_deq) + sum(b_deq)
    while len(c_deq) > 0:
        try:
            if a_deq[-1] < b_deq[-1]:
                min_ab = a_deq.pop()
            else:
                min_ab = b_deq.pop()
        except IndexError:
            if len(a_deq) > 0:
                min_ab = a_deq.pop()
            elif len(b_deq) > 0:
                min_ab = b_deq.pop()
            else:
                break

        if min_ab >= c_deq[0]:
            break
        result += c_deq.popleft() - min_ab

    print(result)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from collections import deque


def main():
    X, Y, A, B, C = map(int, input().split(' '))
    a_list = list(map(int, input().split(' ')))
    b_list = list(map(int, input().split(' ')))
    c_list = list(map(int, input().split(' ')))
    a_deq = deque(sorted(a_list, reverse=True)[:X])
    b_deq = deque(sorted(b_list, reverse=True)[:Y])
    c_deq = deque(sorted(c_list, reverse=True))
    result = sum(a_deq) + sum(b_deq)
    while len(c_deq) != 0:
        min_ab = 0
        if a_deq[-1] < b_deq[-1]:
            min_ab = a_deq.pop()
        else:
            min_ab = b_deq.pop()
        if min_ab >= c_deq[0]:
            break
        result += c_deq.popleft() - min_ab

    print(result)


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

Fixed submission:
def main():
    N = input()
    S = input()
    print(S.count('ABC'))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N, S = open(0).read().split('\n')
    print(S.count('ABC'))


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

Fixed submission:
i= int(input())
s = input()
en = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
s_list = [(en[(en.index(k)+i)%26]) for k in s]
print(''.join(s_list))

Buggy submission (verdict: Runtime Error):
i= int(input())
s = input()
en = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
s_list = [(en[(en.index(k)+i)%26]) for k in s]
print(''.join(s_list)

Buggy submission (verdict: Runtime Error):
#i = int(input())
#s = input()
i = 13
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
en = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
s_list = [(en[(en.index(k)+i)%26]) for k in s]
print(''.join(s_list)

Buggy submission (verdict: Runtime Error):
i = int(input())
s = input()
en = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
ans = [en[(en.index(x) + 26) % 26 + i] for x in s]
print(ans.join(''))
Problem p02952 (python)

Fixed submission:
def main():
    N = input()
    cnt = 9
    len_n = len(N)
    if len_n == 1:
        cnt = int(N)
    elif len_n % 2 == 0:
        len_n -= 1
    else:
        cnt += int(N[1:]) + 1
        if int(N[0]) > 1:
            cnt += (int(N[0])-1) * 10 ** (len_n-1)
        len_n -= 2
    while len_n > 1:
        cnt += 10 ** (len_n - 1) * 9
        len_n -= 2
    print(cnt)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = input()
    cnt = 9
    len_n = len(N)
    if len_n == 1:
        cnt = int(N)
    elif len_n % 2 == 0:
        len_n -= 1
    else:
        cnt += int(N[1:]) + 1
        len_n -= 2
    while len_n > 1:
        print(f'len_n {len_n} , cnt {cnt}')
        cnt += 10 ** (len_n - 1) * 9
        len_n -= 2
    print(cnt)


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

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
H = [int(j) for j in input().split()]

flag = 1

if N == 2:
    if H[0]>H[1]:
        H[0] -= 1
else:
    for i in range(N-2,-1,-1):
        if H[i]>H[i+1]:
            H[i] -= 1

for i in range(N-1):
    if H[i]>H[i+1]:
        flag = 0

if flag == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
H = [int(j) for j in input().split()]

flag = 1

if N == 2:
    if H[0]>H[1]:
    H[0] -= 1
else:
    for i in range(N-2,-1,-1):
        if H[i]>H[i+1]:
            H[i] -= 1

for i in range(N-1):
    if H[i]>H[i+1]:
        flag = 0

print(H)

if flag == 1:
    print('Yes')
else:
    print('No')
Problem p02789 (python)

Fixed submission:
n, m = map(int, input().split())
if n==m:
	print("Yes")
	exit()
else:
	print("No")

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    arr = tuple(map(int, input().split()))
    tmp = arr[0]
    counter = 0
    for i in arr:
        if i<=tmp:
            tmp=i
            counter += 1
    print(counter)

if __name__ == "__main__":
    resolve()
Problem p02727 (python)

Fixed submission:
X, Y, A, B, C = map(int, input().split())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
list = list(map(int, input().split()))

Alist.sort(reverse = True)
Blist.sort(reverse = True)

for i in range(X):
    list.append(Alist[i])
for i in range(Y):
    list.append(Blist[i])
list.sort(reverse = True)

ans =0
for i in range(X + Y):
    ans += list[i]
    
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
cl = list(map(int, input().split()))

Alist.sort(reverse = True)
Blist.sort(reverse = True)
cl.sort(reverse = True)
list=[]

for i in range(X):
    list.append(Alist[i])
for i in range(Y):
    list.append(Blist[i])
list.sort()

k = min (A + B, C)

for i in range(k):
    if cl[0] > list[i]:
        list[i] = cl[0]
        cl.pop(0)
ans = 0
for i in list:
    ans += i

print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
cl = list(map(int, input().split()))

Alist.sort(reverse = True)
Blist.sort(reverse = True)
cl.sort(reverse = True)
list=[]

for i in range(X):
    list.append(Alist[i])
for i in range(Y):
    list.append(Blist[i])
list.sort()

for i in range(C):
    if cl[0] > list[i]:
        list[i] = cl[0]
        cl.pop(0)
ans = 0
for i in list:
    ans += i

print(ans)
Problem p02742 (python)

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

if L % 2 == 1 and S % 2 == 1:
    ans = int(L*(S-1)/2 + (L+1)/2)
else:
    ans = int(L*S/2)

if L == 1 or S == 1:
    ans = 1

print(ans)

Buggy submission (verdict: Runtime Error):
L, S = map(int, input().split())

if L % 2 == 1:
    if S % 2 == 1:
        ans = int(L*(S-1)/2 + (L+1)/2)
else:
    ans = int(L*S/2)

print(ans)
Problem p02866 (python)

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

dict = {}
for i in range(N):
    if list[i] in dict.keys():
        dict[list[i]] += 1
    else:
        dict.setdefault(list[i], 1)

max = max(dict)

try:
    for i in range(1,max+1):
        ans = (ans * (dict[i-1] ** dict[i])) % 998244353
    if dict[0] != 1:
        ans = 0
    if list[0] != 0:
        ans = 0
except KeyError:
    ans = 0

print(ans)

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

dict = {}
for i in range(N):
    if list[i] in dict.keys():
        dict[list[i]] += 1
    else:
        dict.setdefault(list[i], 1)

max = max(dict)

try:
    for i in range(1,max+1):
        ans = (ans * (dict[i-1] ** dict[i])) % 998244353
except KeyError:
    ans = 0

if dict[0] != 1:
    ans = 0

print(ans)
Problem p02755 (python)

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

for i in range(1,1010):
#	print (i)
	ia=int(i*0.08)
	ib=int(i*0.1)
#	print (ia,ib)
	if ia==a and ib==b:
		print (i)
		exit()
else:
	print (-1)

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

am=int(100/8*a)
al=int(100/8*(a+1))
if (a%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
      
print -1

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

am=int(100/8*a)
al=int(100/8*(a+1))
if (a%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

print (am,al)
print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
      
print -1
Problem p02756 (python)

Fixed submission:
s=input()
q= int(input())

top=""
btm=""

iturn=0
for iq in range(1,q+1):
	t=input().split()
	if t[0]=='1':
		iturn=iturn+1   	
	else:
		iturn2=iturn%2
		if (t[1]=='1' and iturn2==0) or (t[1]=='2' and iturn2==1):
#			s=t[2]+s
#			s='{}{}'.format(t[2],s)
			top=t[2]+top
		else:
#			s=s+t[2]
#			s='{}{}'.format(s,t[2])
			btm=btm+t[2]

if iturn%2==0:
	s=top+s+btm
else:
	s=btm[::-1]+s[::-1]+top[::-1]
print (s)

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

for iq in range(1,q+1):
	t=input().split()
	if t[0]=='1':
		s=s[::-1]
	else:
		if t[1]=='1':
#			s=t[2]+s
            s='{}{}'.format(t[2],s)
#			s=f"{t[2]}{s}"
#			list1=[t[2],s]
#			s="".join(list1)
#			s="".join(t[2],s)
		else:
#			s=s+t[2]
            s='{}{}'.format(s,t[2])
#			s=f"{s}{t[2]}" 
#			list2=[s,t[2]]
#			s="".join(list2)
#			s="".join(s,t[2])

print (s)
Problem p02801 (python)

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

Buggy submission (verdict: Runtime Error):
import math


N = int(input())
x = [0] * N
y = [0] * N
xy = []
for i in range(N):
    xy.append(list(map(int, input().split())))


def signed_area(p1, p2, p3):
    area = (p2[0] - p1[0]) * (p3[1] - p1[1])\
            - (p3[0] - p1[0]) * (p2[1] - p1[1])
    return area/2


def convex_hull(p_list):
    p_sort = []
    for i in p_list:
        p_sort.append(i[0])

    # x座標が最小のものをリストの先頭に配置。
    min_index = p_sort.index(min(p_sort))
    min_p = p_list.pop(min_index)
    p_list.insert(0, min_p)

    # 座標最小の点と他の点との角度順にソート ソートアルゴリズムに選択の余地が有る。
    p_length = len(p_list)
    count = 0
    index = 0
    while True:
        count += 1
        index += 1

        area_sign = signed_area(p_list[0], p_list[index], p_list[index + 1])

        # 符号付き面積が負ならば点を入れ替え
        if area_sign < 0:
            p_list[index], p_list[index + 1] = p_list[index + 1], p_list[index]
            count = 0

        if count == p_length - 1:
            break

        if index == p_length - 2:
            index = 0

    # 凹部の点を削除する。
    index = -1
    count = 0
    while True:
        index += 1
        count += 1

        area_sign = signed_area(p_list[index],
                                p_list[index + 1],
                                p_list[index + 2])
        if area_sign < 0:
            del p_list[index + 1]
            count = 0

        if count == len(p_list):
            break

        if index >= len(p_list) - 3:
            index = -1
    return p_list


def euc(p1, p2):
    return (p1[0]-p2[0])**2 + (p1[1]-p2[1])**2


def find_max_euc(xy):
    ans = []
    max_dis = 0
    n = len(xy)
    for i in range(n):
        for j in range(n):
            dis = math.sqrt(euc(xy[j], xy[i]))
            if dis >= max_dis+1e-05:
                max_dis = dis
                ans = [xy[j], xy[i]]
    return ans


if len(xy) == 2:
    dis = math.sqrt(euc(xy[0], xy[1]))
    print(dis/2)
else:
    xy = convex_hull(xy)
    xy = find_max_euc(xy)
    dis = math.sqrt(euc(xy[0], xy[1]))
    print(dis/2)
Problem p02802 (python)

Fixed submission:
N, M = map(int, input().split())
pS = {}
for i in range(N):
    pS[i] = [0, 0, 0]  # is_ac, penatly, AC

for i in range(M):
    p, S = input().split()
    p = int(p) - 1
    if pS[p][0] == 0 and S == 'WA':
        pS[p][1] += 1
    elif pS[p][0] == 0 and S == 'AC':
        pS[p][0] = 1
        pS[p][2] = 1

AC = 0
penatly = 0
for i in range(N):
    if pS[i][0] == 1:
        penatly += pS[int(i)][1]
        AC += pS[int(i)][2]
print(AC, penatly)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
pS = {}
for i in range(N):
    pS[i] = [0, 0, 0]  # is_ac, penatly, AC

for i in range(M):
    p, S = input().split()
    p = int(p) - 1
    if pS[p][0] == 0 and S == 'WA':
        pS[p][1] += 1
    elif pS[p][0] == 0 and S == 'AC':
        pS[p][0] = 1
        pS[p][2] = 1

AC = 0
penatly = 0
for i in range(N):
    if pS[p][0] == 1:
        penatly += pS[int(i)][1]
        AC += pS[int(i)][2]
print(AC, penatly)
Problem p03285 (python)

Fixed submission:
from math import floor

def main():
    n = int(input())

    seven = floor(n/7)
    for i in range(seven+1):
        mod = n - i*7
        if mod % 4 == 0:
            print('Yes')
            return
    print('No')


main()

Buggy submission (verdict: Runtime Error):
from math import floor

def main():
    n = int(input())

    for i in range(110):
        dp.append(10000000)
    dp[0] = 0

    seven = floor(n/7)
    for i in range(seven+1):
        mod = n - i*7
        if mod % 4 == 0:
            print('Yes')
            return
    print('No')


main()
Problem p03324 (python)

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

if a == 0:
  if b == 100:
    print(101)
  else:
    print(b)
else:
  if b == 100:
    print(101*100**a)
  else:
    print(b*100**a)

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

if a == 0:
  if b == 100:
    print(101)
  else:
    print(b)
else:
  if b == 100:
    print(101*10**a)
  else:
    printe(b*10**a)
Problem p03325 (python)

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

r = 0
i = 1

while True:
  f = False
  for a in aas:
    if a%2**i == 0:
      r += 1
      f = True
  if not f:
    break
  i += 1
print(r)

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

r = 0
i = 1
while True:
  f = False
  for a in as:
    if a%2 == 0:
      a /= 2
      r += 1
      f = True
  if not f:
    break
print(r)

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

r = 0
i = 1
while True:
  for a in as:
    f = False
    if a%2 == 0:
      a /= 2
      r += 1
      f = True
    if not f:
      break
print(r)
Problem p03369 (python)

Fixed submission:
s = input()
r = 700
 
for i in range(3):
    if s[i] == 'o':
        r += 100
print(r)

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

for i in range(3):
    if s[i] == 'o':
        700 += 100
print(r)
Problem p03370 (python)

Fixed submission:
import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in range(int(N)):
    a.append(float(input()))

sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)

Buggy submission (verdict: Runtime Error):
import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in ragne(int(N)):
    a.append(float(intput()))
    
sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)
Problem p03371 (python)

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

sum = 0
a = b = c = 0

if l[0] > l[2]*2 or l[1] > l[2]*2:
    c1 = c2 = 0
    if l[0] > l[2]*2:
        c1 = 2 * l[3]
    if l[1] > l[2]*2:
        c2 = 2 * l[4]
    c = max([c1, c2])
elif l[0]+l[1] > l[2]*2:
    c += min([l[3], l[4]])*2
else:
    a = l[3]
    b = l[4]


if a+c/2 < l[3]:
    a += l[3]-(c/2+a)
if b+c/2 < l[4]:
    b += l[4]-(c/2+b)

sum = a*l[0] + b*l[1] + c*l[2]

print(int(sum))

Buggy submission (verdict: Runtime Error):
l = input().split()
A = int(l[0])
B = int(l[1])
AB = int(l[2])
a = int(l[3])
b = int(l[4])

sum = 0

if A+B < AB*2:
    if a < b:
        sum += a*AB
        sum += b*B
    else:
        sum += b*AB
        sum += a*A
else:
    sum += a*A + b*B

print sum
Problem p03474 (python)

Fixed submission:
AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
        else:
            if S[i] != "-":
                flag = False

if flag:
    print("Yes")
else:
    print("No")

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

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
                return
        else:
            if S[i] != "-":
                flag = False
                return

if flag:
    print("Yes")
else:
    print("No")
Problem p02718 (python)

Fixed submission:
N,M=map(int,input().split())
a=list(map(int,input().split()))
S=sum(a)
a.sort()
if a[N-M] >= S/(4*M):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=list(map(int,input().split()))
S=sum(a)
a.sort()
print(S/4*M)
print(a)
if a[N-M+1] >= S/4*M:
  print('Yes')
else:
  print('No')
Problem p02802 (python)

Fixed submission:
N,M=map(int,input().split())
T=[]
frag=[0 for y in range(N)]
p=[0 for y in range(N)]
a=0
for i in range(M):
  s=list(map(str,input().split()))
  T.append(s)
for i in range(M):
  if T[i][1]=='WA' and frag[int(T[i][0])-1]==0:
    p[int(T[i][0])-1]=p[int(T[i][0])-1]+1
  elif T[i][1]=='AC' and frag[int(T[i][0])-1]==0:
    a=a+1
    frag[int(T[i][0])-1]=1
for i in range(N):
  if frag[i]==0:
    p[i]=0
print(a,sum(p))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
T=[]
frag=[0 for y in range(N)]
p=[0 for y in range(N)]
a=0
for i in range(M):
  s=list(map(str,input().split()))
  T.append(s)
for i in range(M):
  if T[i][1]=='WA' and frag[int(T[i][0])-1]==0:
    p[i]=p[i]+1
  elif T[i][1]=='AC' and frag[int(T[i][0])-1]==0:
    a=a+1
    frag[int(T[i][0])-1]=1
for i in range(N):
  if frag[i]==0:
    p[i]=0
print(a,sum(p))
Problem p02921 (python)

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

Buggy submission (verdict: Runtime Error):
s=list(map(str,input().split()))
t=list(map(str,input().split()))
c=0
for i in range(3):
  if s[i]==t[i]:
    c=c+1
print(c)
Problem p02952 (python)

Fixed submission:
N=int(input())
if 1<=N<=9:
  print(N)
elif 1<=N<=99:
  print(9)
elif 100<=N<=999:
  print(9+N-100+1)
elif 1000<=N<=9999:
  print(909)
elif 10000<=N<=99999:
  print(909+N-10000+1)
elif N==100000:
  print(90909)

Buggy submission (verdict: Runtime Error):
N=int(input())
if 1<=N<=9:
  print(N)
elif 1<=N<=99:
  print(9)
elif 100<=N<=999:
  print(9+N-100+1)
elif 1000<=N<=9999:
  print(909)
elif 10000<=N<=99999:
  print(909+N-10000+1)
elif N=100000:
  print(90909)
Problem p02983 (python)

Fixed submission:
L,R=map(int,input().split())
l1=L//2019
l2=L%2019
r1=R//2019
r2=R%2019
if l1!=r1 or l2==0:
  print(0)
else:
  a = [2020]
  for i in range(l2,r2):
    for j in range(i+1,r2+1):
      c = (i*j)%2019
      a.append(c)
  print(min(a))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l1=L//2019
l2=L%2019
r1=R//2019
r2=R%2019
if l1!=r1 or l2==0:
  print(0)
else:
  a = [2020]
  for i in range(l2,r2):
    for j in range(i+1,r2+1):
      c = (i*j)%2019
      a.append(c)
print(min(a))
Problem p02995 (python)

Fixed submission:
s = input().split()
s = list(map(int,s))
A = s[0]
B = s[1]
C = s[2]
D = s[3]
if A%C > 0:
  i = B//C - A//C
else:
  i = B//C - A//C + 1
if A%D > 0:
  j = B//D - A//D
else:
  j = B//D - A//D + 1
from fractions import gcd
p = (C*D)//(gcd(C,D))
if A%p > 0:
  k = B//p - A//p
else:
  k = B//p - A//p + 1
print(B-A+1-(i + j - k))

Buggy submission (verdict: Runtime Error):
s = input().split()
A = s[0]
B = s[1]
C = s[2]
D = s[3]
k = 0
for i in range(A,B+1):
  if i%C != 0 and i%D != 0:
    k = k + 1
print(k)
Problem p02996 (python)

Fixed submission:
N = int(input())
p = [[0,0]]*N
for i in range(N):
  p[i] = input().split()
  p[i] = list(map(int,p[i]))
p = sorted(p,key = lambda p:p[1])
s = [0]*N
s[0] = p[0][0]
for i in range(N-1):
  s[i+1] = s[i] + p[i+1][0]
k = 0
for i in range(N):
  if s[i] <= p[i][1]:
    k = k + 1
  else:
    print('No')
    break
if k == N:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [[0,0]]*N
for i in range(N):
  p[i] = input().split()
  p[i] = list(map(int,p[i]))
p = sorted(p,key = lambda x:x=p[1])
s = [0]*N
s[0] = p[0][0]
for i in range(N-1):
  s[i+1] = s[i] + p[i+1][0]
k = 0
for i in range(N):
  if s[i] <= p[i][1]:
    k = k + 1
  else:
    print('No')
    break
if k == N:
  print('Yes')
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]*(n+1)
for i in range(n):
  d[i+1] = d[i] + l[i]
  if d[i+1] > x:
    print(i+1)
    d[n] = x + 1
    break
if d[n] <= x:
  print(n+1)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]*(n+1)
for i in range(n+1):
  d[i+1] = d[i] + l[i]
  if d[i+1] > x:
    print(i+1)
    break
Problem p03455 (python)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print(Even)
else:
  print(Odd)

Buggy submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = (a*b)/2
if c =! int(c):
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = (a*b)/2
if c =! int(c):
  print(Odd)
else:
  print(Even)

Buggy submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = (a*b)/2
if c != int(c):
  print(Odd)
else:
  print(Even)

Buggy submission (verdict: Runtime Error):
s = input().split()
a = float(s[0])
b = float(s[1])
if a/2 != int(a/2) and b/2 != int(b/2):
  print(Odd)
else:
  print(Even)

Buggy submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
if a/2 != int(a/2) and b/2 != int(b/2):
  print(Odd)
else:
  print(Even)