Problem:


Score : 200 points

Problem Statement

Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).

Constraints

1 \leq N \leq 10^5

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of positive integers less than or equal to N that have an odd number of digits.

Sample Input 1

11

Sample Output 1

9

Among the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \ldots, 9.

Sample Input 2

136

Sample Output 2

46

In addition to 1, 2, \ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \ldots, 136.

Sample Input 3

100000

Sample Output 3

90909



Sample input:
11


Sample output:
9

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
if n > 9:
    ans += 9
    #print('ok0')
    if n > 999:
        #print('ok1')
        ans += 900
        if n > 99999:
            #print('ok2')
            ans += 90000
        else:
            #print('ok3')
            ans += max(0,(n - 1000 + 1))
    else:
        #print('ok4')

        ans += max(0,(n - 100 + 1))
else:
    ans = n

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 90909
if 0 <= N < 9:
    ans = N
elif 9 <= N < 99:
    ans = 9
elif 100 <= N < 999:
    ans = 9 + N - 100+1
elif 1000 <= N < 9999:
    ans = 909
elif 10000 <= N < 99999:
    ans = 909 + N - 10000 + 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
  print(n)
elif n < 100:
  print(9)
elif n < 1000:
  print(n - 90)
elif n < 10000:
  print(909)
elif n < 100000:
  print(9 + 99 + (n - 9999))
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 100000:
    print(91009)
elif N >= 10000:
    print(9+1000+(N-10000+1))
elif N >= 1000:
    print(1009)
elif N >=100:
    print(9+(N-100+1))
elif N < 10:
    print(N)
else:
    print(9)

Submission status: Wrong Answer

Solution code:
n = int(input())

if len(str(n))==1:
  print(n)
elif len(str(n))==2:
  print(9)
elif len(str(n))==3:
  print(n - 90)
elif len(str(n))==4:
  print(909)
else:
  print(910)

Submission status: Wrong Answer

Solution code:
N = input()
length = len(N)
n = int(N)
dic = {1:9,3:900,5:90000}
if length == 1:
    ans = length
elif length == 2:
    ans = 9
elif length == 3:
    ans = n - 90
elif length == 4:
    ans = 909
elif length == 5:
    ans = n - 9090
elif length == 6:
    ans = 90909
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# input
N = int(input())

# solve
ans = 0
for i in range(1, N):
    if len(str(i)) % 2 != 0:
        ans += 1

# output
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 10**5:
  ans = 90909
elif N >= 10**4:
  ans = 9+900+(N-10**4+1)
elif N >= 10**2:
  ans = 9+(N-10**2+1)
elif N>=10:
    ans = 9
else:
    ans = N

print(ans)

Submission status: Wrong Answer

Solution code:
n=input()
nn=int(n)
cnt=nn-int('9'+(len(n)-1)*'0')
if len(n)==1:
    ans=nn
elif len(n)==2:
    ans=9
elif len(n)==3:
    ans=cnt+9
elif len(n)==4:
    ans=909
elif len(n)==5:
    ans=cnt+909
else:
    ans=90909
print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

L = 0 # Nの桁数
t = N
while t:
    L += 1
    t = t // 10

ans = 0
for i in range(1, L, 2):
    ans += 10**i - 10**(i-1) + 1

#print("==", ans)
if L % 2 == 1:
    ans += N - 10**(L-1)

print(ans)

Submission status: Wrong Answer

Solution code:
N=str(input())
digit=len(N)
result=0

for i in range(1,digit+1):
    if i%2==1:
        if i==digit:
            result+=(int(N)+1)%(10**(i-1))
        else:
            result+=9*10**(i-1)
print(result)

Submission status: Wrong Answer

Solution code:
n = input()
keta = len(n)
n=int(n)
if keta==1:
  print(n)
else:
  count=0
  odd_keta = [k for k in range(1,keta) if k%2==1]
  counts = [9*10**(o-1) for o in odd_keta]
  count +=sum(counts) 

  if keta%2==1: #奇数桁なら
    count += (n-100)+1

  print(count)

Submission status: Wrong Answer

Solution code:
num = input()
ans = [9,0,900,0,90000]
tmp = 0
if len(num)%2==0:
  tmp = sum(ans[:len(num)])
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num)-10**(len(num)-1)+1

print(tmp)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  print(n)
elif n <= 99:
  print(9)
elif n <= 999:
  print(9+n-100+1)
elif n <= 9999:
  print(909)
elif n <= 99999:
  print(909+n-1000+1)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

i = [10, 100, 1000, 10000,100000]
digit = 0
p = [0, 9, 9, 909, 909, 90909]
for j in i:
  if j > n:
    break
  else:
    digit += 1

if digit%2 == 1:
  print(p[digit])
else:
  
  print(p[digit]+n-i[digit-1]+1)

Submission status: Wrong Answer

Solution code:
n = int(input())

if len(str(n)) == 6:
    print(90909)
elif len(str(n)) == 4:
    print(999)
elif len(str(n)) == 2:
    print(9)
elif len(str(n)) == 1:
    print(n)
elif len(str(n)) == 3:
    print(9 + (n - 100) + 1)
elif len(str(n)) == 5:
    print(9 + 900 + (n - 10000) + 1)

Submission status: Wrong Answer

Solution code:
n = input()
keta = len(n)
n = int(n)

if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(n - 90 + 9)
elif keta == 4:
    print(909)
elif keta == 5:
    print(n - 9000 + 900 - 90 + 9)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n= int(input())

if n <10:
    print(n)
elif n<100:
    print(9)
elif n<1000:
    print(n-90)
elif n < 10000:
    print(899)
elif n < 100000:
    print(n-9090)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:

N = int(input())

L = 0 # Nの桁数
t = N
while t:
    L += 1
    t = t // 10

ans = 0
for i in range(1, L, 2):
    ans += 10**i - 10**(i-1) + 1

print("==", ans)
if L % 2 == 1:
    ans += N - 10**(L-1)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = len(str(n))
if a==1:
    print(n)
elif a==2:
    print(9)
elif a==3:
    print(n-99+9)
elif a==4:
    print(9+909)
elif a==5:
    print(n-9999-99+909+9)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
  print(n)
elif n < 100:
  print(9)
elif n < 1000:
  print(n - 90)
elif n < 10000:
  print(909)
elif n < 100000:
  print(n - 9000)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
n = input()
a = len(n)
if a == 6:
  print(9+900+90000)
if a == 5:
  print(9+900+int(n)-10000+1)
elif a == 4:
  print(909)
elif a == 3:
  print(9+int(n)-100+1)
elif a == 2:
  print(9)
elif a == 1:
  print(print(n))

Submission status: Wrong Answer

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))

n = list(input())

if len(n) == 1:
    k = int("".join(map(str,n)))
    print(k)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    k = int("".join(map(str,n)))
    print(9 + k -99)
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    k = int("".join(map(str,n)))
    print(9 + 909 + k - 9999)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n= int(input())

if n <10:
    print(n)
elif n<100:
    print(9)
elif n<1000:
    print(n-90)
elif n < 10000:
    print(890)
elif n < 100000:
    print(n-9090)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
if n < 10:
    print n-1
elif n < 100:
    print 9
elif n < 1000:
    print (n - 90)
elif n < 10000:
    print 909
elif n < 100000:
    print (n-90-9000)
else:
    print 90909

Submission status: Wrong Answer

Solution code:
N = int(input())

if N<10:
    print(N)
elif N<10**2:
    print(9)
elif N<10**3:
    print(N-90)
elif N<10**4:
    print(9010)
elif N<10**5: 
    print(N-9090)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N=int(input())
tmp=[10**i for i in range(0,6,2)][::-1]
ans=0
for i in tmp:
    if i<N:
        if N>=i*10:
            ans+=i*9
        else:
            ans+=N-i+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0
for i in range(1, n):
    k = len(str(i))
    if k % 2 == 1:
        result += 1
print("{}".format(result))

Submission status: Wrong Answer

Solution code:
N = int(input())
nm = N//10
summ = 0
for i in range(nm):
    if N%2 ==0:
        summ += (10**i-1)
if nm%2 != 0:
    summ += N-(10**nm)+1
print(summ)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 1
if N < 10:
    ans = N
elif 10 < N and N < 100:
    ans = 9
elif 100 <= N and N < 1000:
    ans = 9 + (N - 99)
elif 1000 <= N and N < 10000:
    ans = 909
elif 10000 <= N and N < 100000:
    ans = 909 + (N-9999)
elif 100000 <= N and N < 1000000:
    ans = 90909
elif 1000000 <= N:
    ans = 90909 + (N-999999)

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
i=1
ans=0

while i!=n+2:
    if (1<=i and 9>=i):
  
        ans+=1
    if (100<=i and 999>=i):
  
        ans+=1
    if (10000<=i and 99999>=i):
        ans+=1
       
    i+=1


print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 100:
  print(9)
elif n < 1000:
  print(9 + n - 100 + 1)
elif n < 10000:
  print(9 + 900)
elif n < 100000:
  print(9 + 900 + n - 10000 + 1)
elif n < 1000000:
  print(9 + 900 + 90000)

Submission status: Wrong Answer

Solution code:
N = int(input())
l_N = len(str(N))
ans = int("".join(["9", "0"] * (l_N // 2 - 1) + ["9"]))

if l_N % 2 != 0:
    ans += N - 10 ** (l_N - 1) +1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in range(n):
  if len(str(i))%2==1:
    ans+=1
  else:
    pass
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

k = len(str(n))

if k == 1:
	print(n)
elif k == 6:
	print(90909)
elif k == 2:
	print(9)
elif k == 3:
	print(9 + n - 100 + 1)
elif k == 4:
	print(9 + 999 - 100 + 1)
else:
	print(909 + n - 1000 + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 100000:
  print(90909)
elif 1 <= n <= 9:
  print(n)
elif 10 <= n <= 99:
  print(9)
elif 100 <= n <= 999:
  c = n - 99
  print(9 + c)
elif 1000 <= n <= 9999:
  print(909)
elif 10000 <= n <= 99999:
  c = n - 9999
  print(c + n)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = len(str(n))
if a==1:
    print(n)
elif a==2:
    print(9)
elif a==3:
    print(n-99+9)
elif a==4:
    print(9+909)
elif a==5:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

cnt = 0
x = 1

while x < n:
    y = x * 10
    if y > n:
        y = n + 1
    cnt += y - x
    x = y * 10
print(cnt)

Submission status: Wrong Answer

Solution code:
A = int(input())
if 1 < A < 9:
  print(A)
elif 10 < A < 99:
  print(9)
elif 100 < A < 999:
  print(A-90)
elif 1000 < A < 9999:
  print(909)
elif 10000 < A < 99999:
  print(A-9090)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
from sys import stdin

if __name__ == '__main__':
    N = int(stdin.readline().rstrip())
    ans = 0
    if N < 10:
        ans = N
    elif N < 100:
        ans = 9
    elif N < 1000:
        ans = 9 + ( N - 100 + 1 )
    elif N < 10000:
        ans = 9 + 900 + ( N - 10000 + 1 )
    else:
        ans = 9 + 900 + 90000
    print( ans )

Submission status: Wrong Answer

Solution code:
n = input()
a = len(n)
if a == 6:
  print(9+900+90000)
if a == 5:
  print(9+900+int(n)-1000+1)
elif a == 4:
  print(909)
elif a == 3:
  print(9+int(n)-100+1)
elif a == 2:
  print(9)
elif a == 1:
  print(print(n))

Submission status: Wrong Answer

Solution code:
N= int(input())
ans=0
for i in range(1,N):
    l=len(str(i))
    if not l%2==0:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=0
for i in range(n):
    if len(str(i))%2==1:
        ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, n):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
# n_list = list(str(n))

cnt = 0

for i in range(1, n):
    if len(list(str(i))) % 2 == 1:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A = int(input())

count =  0

if A<10:
    count= A
elif A <100:
    count = 9 
elif A < 1000:
    count = 9 + A - 99
elif A < 10000:
    count = 9 + 900 +1
elif A < 100000:
    count = 9 + 900 + (A-9999)
else:
    count = 90909

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

digit = (len(str(N)))
#print(digit)

if digit == 1:
  print(N)
elif digit == 2:
  print(9)
elif digit == 3:
  print(N % 100 + 1 + 9)
elif digit == 4:
  print(909)
elif digit == 5:
  print(N % 10000 + 1 + 909)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
k=math.log10(n)
ans=0
if k<1:
    ans=n
elif k<2:
    ans=9
elif k<3:
    ans=n-90
elif k<4:
    ans=899+9
else:
    ans = 899 + 9+n-9999
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 10**5:
    print(90909)
elif n > 10**4:
    print(909 + (n - 9999))
elif n > 10**3:
    print(909)
elif n > 10**2:
    print(9 + (n - 99))
elif n > 10:
    print(9)
else:
    print(n)

Submission status: Wrong Answer

Solution code:
N = str(input())
digit = len(N)
N = int(N)
ans = 0
if digit%2==1:
    ans += N-10**(digit-1)
    digit = digit//10

while digit>0:
    digit-=2
    ans += 9*10**digit
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = len(str(N))

c = N % 10**(l - 1) + 1 if l % 2 else 0
for i in range(0, l - 1, 2):
  c += 10**i * 9
print(c)

Submission status: Wrong Answer

Solution code:
n= int(input())

if n <10:
    print(n)
elif n<100:
    print(9)
elif n<1000:
    print(n-90)
elif n < 10000:
    print(910)
elif n < 100000:
    print(n-9090)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces680B
gi = lambda : list(map(int,input().split()))
n, = gi()
mag = 1
ans = 0
while 1:
	if mag > n:
		break;
	if 9 * mag > n:
		ans += n - mag + 1
		break
	ans += 9 * mag
	mag *= 100
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 0 < N < 9:
    ans = N
elif 9 <= N < 99:
    ans = 9
elif 100 <= N < 999:
    ans = 9 + N - 100+1
elif 1000 <= N < 9999:
    ans = 909
elif 10000 <= N < 99999:
    ans = 909 + N - 10000 + 1
else:
    ans = 90909
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

def resolve():
    N = int(input())
    ans = 0
    if N >= 100000:
        ans = 90909
    elif N >= 10000:
        N %= 100000
        ans = 909 + N - 10000 + 1
    elif N >= 100:
        N %= 1000
        ans = 9 + N - 100 + 1
    elif N >= 10:
        N %= 100
        ans = 9
    else:
        ans = N
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10**1:
  print(n)
elif n < 10**2:
  print(9)
elif n < 10**3:
  print(9 + n - 10**2 + 1)
elif n < 10**4:
  print(900)
elif n < 10**5:
  print(909 + n - 10 **4 + 1)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
N=input()
lenN=len(N)
ans=0

if lenN==1:
    print(int(N))
else:
    for i in range(1,lenN,2):
        ans+=10**i*9//10
        #print(ans)
    
    if lenN%2==1:
        ans+=int(N[1:])+1
        
    print(ans)
        
    


#0をひかない

Submission status: Wrong Answer

Solution code:
n1 = int(input())

if n1 < 10:
    print(n1)
elif n1 <= 99:
    print(9)
elif n1 < 1000:
    print(9 + (n1 - 99))
elif n1 <= 9999:
    print(909)
elif n1 < 100000:
    print(909 + (n1 - 999))
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<100:
  print(9)
elif n>=100 and n<1000:
  print(9+n-99)
elif n>=1000 and n<10000:
  print(909)
elif n>=10000 and n<100000:
  print(909+n-9999)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 0
for i in range(N):
    if i <= 9 and i >= 1:
        res += 1
    elif i <= 999 and i >= 100:
        res += 1
    elif i <= 99999 and i >= 10000:
        res += 1
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
if N < 10:
    ans = N
elif 10 < N and N < 100:
    ans = 9
elif 100 <= N and N < 1000:
    ans = 9 + (N - 99)
elif 1000 <= N and N < 10000:
    ans = 909
elif 10000 <= N and N < 100000:
    ans = 909 + (N-9999)
elif 100000 <= N:
    ans = 90909

print(ans)

Submission status: Wrong Answer

Solution code:
b=int(input())
if b<=9:
    print(b)
elif b>=10 and b<=99:
    print(9)
elif b>=100 and b<=999:
    print(b-90)
elif b>=1000 and b<=9999:
    print(900)
elif b>=10000 and b<=99999:
    print(b-9090)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n= int(input())

if n <10:
    print(n)
elif n<100:
    print(9)
elif n<1000:
    print(n-89)
elif n < 10000:
    print(910)
elif n < 100000:
    print(n-9088)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
#N,A,B = map(int,input().split())
#X_list = list(map(int,input().split()))
#X1_list = [int(input()) for i in range(N)]
#X2_list = [list(map(int,input().split())) for i in range(N)]

if N < 10:
    print(N)
elif 10 < N < 100:
    print(9)
elif 100 <= N < 1000:
    print(9 + N - 99)
elif 1000 <= N < 10000:
    print(909)
elif 10000 <= N < 100000:
    print(909 + N - 9999)
elif 100000 <= N < 1000000:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = n
cnt = 0
while(m != 0):
    cnt += 1
    m = m // 10
ans = 0
if(n < 10):
    print(n)
elif(n < 100):
    print(9)
else:
    for i in range(cnt // 2):
        ans += 9 * 10**(2*i)
    c = n - 10**(cnt-1)
    ans += c
    if(cnt % 2 == 1):
        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:

n =  int(input())
s = str(n)
if len(s)==1:
    print(n)
elif len(s)==2:
    print(9)
elif len(s)==3:
    print(n%100+10)
elif len(s)==4:
    print(909)
elif len(s)==5:
    print(n%10000+910)
elif len(s)==6:
    print(90909)

Submission status: Wrong Answer

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())

ans = 0
digit = len(str(N))
for i in range(digit):
    if i % 2 == 1:
        ans += 10 ** i - 10 ** (i - 1)

if digit % 2 == 1:
    ans += ans - 10 ** (digit - 1) + 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
count = 0
for i in range(1, int(N)):
    if len(str(i)) % 2 != 0:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(N):
    if ( 0 < i+1  and i +1 <10 ) :
        ans = ans +1
    elif ( 99 < i+1  and i +1 <1000 ) :
        ans = ans +1
    elif (  i+1  == 10000 ) :
        ans = ans +1
print(ans)

Submission status: Wrong Answer

Solution code:
a=0
N=int(input())
if N<10:
    a=N
elif N<100:
    a=9
elif N<1000:
    a=N-90
elif N<10000:
    a=9999-90
elif N<100000:
    a=N-9090
else:
    a=90909
print(a)

Submission status: Wrong Answer

Solution code:
n = input()

s = len(n)

ans = 0


if s == 1:
    print(int(n))
    exit()

for i in range(0,s-1,2): 
    ans += 9*(10**i)

m = n[1:]

if s %2 != 0:
    ans += int(m)+1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 1000:
    print(N-90)
elif N < 10000:
    print(909)
elif N < 100000:
    print(N-90909)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
import sys

n= int(sys.stdin.readline())

c=0
for i in range(1,n):
    if len(str(i))%2==1: c+=1
print( c )

Submission status: Wrong Answer

Solution code:
n = int(input())
s = len(str(n))
if s == 1:
    print(n)
elif s == 2:
    print(9)
elif s == 3:
    print(9 + (n-100) + 1)
elif s == 4:
    print(9 + 900)
elif s == 5:
    print(9 + 900 + (n-90000) + 1)
else:
    print(9 + 900 + 90000)

Submission status: Wrong Answer

Solution code:
N = int(input())

keta = len(str(N))
if keta == 1:
    ans = N
elif keta == 2:
    ans = 9
elif keta == 3:
    ans = N-90
elif keta == 4:
    ans = 909
else:
    ans = N-90-9000-1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 0:
    print(0)
elif 0 < n <= 9:
    print(n)
elif 10 < n <= 99:
    print(9)
elif 100 <= n <= 999:
    print(n-99+9)
elif 1000 <= n <= 9999:
    print(909)
elif 10000 <= n <= 99999:
    print(n-9999+909)
elif n == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = input()
let = len(N)
n = int(N)
ans = 0
for i in range(1,let//2+1):
  ans += 9 * 10**(i-1)
if let % 2 == 1:
  ans += n + 1 - 10**(let-1)
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


if __name__ == '__main__':
    n = int(input())
    num = 0
    for i in range(n):
        if len(str(i)) % 2 == 1:
            num += 1
    print(num)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=len(str(n))
ls=[9,0,90,0,900,0,9000]
if l%2==0:
    print(sum(ls[:l]))
else:
    ans=sum(ls[:l-1])
    ans+=n-(10**(l-1)-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()

# start

n = int_single()

r = 0
for i in range(1, n):
    if (len(str(i)) % 2 == 1):
        r += 1

print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
for i in range(1, N+1):
    s = str(i)
    s_set = set(list(s))
    if len(s_set) % 2 == 1:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N <= 99:
    print(max(9,N))
    exit()

if N <= 9999:
    print(min(N - 99 + 9, 999 - 99 + 9))
    exit()

print(min(N - 9999 + 909, 90909))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

count = 1
for i in range(1, N+1):
  if math.floor(math.log10(i)) % 2 == 0:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())

if (n<=9):
  print(n)
  
elif (n<=999):
  print(n-90)

elif (n<=99999):
  print(n-9090)
  
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

for i in range(n):
  if 1<=i<=9:
    ans += 1
    continue
  if 100<=i<=999:
    ans += 1
    continue
  if 10000<=i<=99999:
    ans += 1
    continue
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

for i in range(n):
  if 1<=i<=9:
    ans += 1
    break
  if 100<=i<=999:
    ans += 1
    break
  if 10000<=i<=99999:
    ans += 1
    break
print(ans)

Submission status: Wrong Answer

Solution code:
n=input()
l=len(n)
c=0
if l%2==0:
  for i in range(1,l,2):
    c+=9**i
  print(c)
else:
  m=int(n)
  d=m-(10**(l-1))+1
  c+=d
  for i in range(1,l-1,2):
    c+=9**i
  print(c)

Submission status: Wrong Answer

Solution code:
n = input()
s = len(n)
n = int(n)

if s == 1:
    print(n)
elif s == 2:
    print(9)
elif s == 3:
    print(9 + n % 100 + 1)
elif s == 4:
    print(9 + 900)
elif s == 5:
    print(9 + 900 + n % 10000 + 1)
else:
    print(9 + 900 + 90000)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

for i in range(n):
  if 1<=i<=9:
    ans += 1
  if 100<=i<=999:
    ans += 1
  if 10000<=i<=99999:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
digit=1
count=0
while(10**digit<n):
  if(digit%2==1):
    count=count+9*10**(digit-1)
  digit=digit+1
if(digit%2==1):
  count=count+n-10**(digit-1)
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(1,n):
    if(len(str(i))%2==1):
        ans += 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(1, n):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if 1 <= n <= 9:
    print(n)
elif 10 <= n <= 99:
    print(9)
elif 100 <= n <= 999:
    print(n-90)
elif 10**3 <= n <= 9999:
    print(910)
elif 10**4 <= n <= 99999:
    print(n-9999+910)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(1, N):
  if len(str(i)) % 2 !=0:
    ans +=1
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
l=len(a)
a=int(a)
if l==100000:
  print(90909)
elif 99999>=a>=10000:
  print(909+a-9999)
elif 9999>=a>=1000:
  print(909)
elif 999>=a>=100:
  print(9+a-99)
elif 99>=a>=10:
  print(9)
else:
  print(a)

Submission status: Wrong Answer

Solution code:
def check(a):
    l = 0
    while a:
        a/=10
        l+=1
    return l

n =  int(input())
ans =0
for i in range(n+1):
    if check(i)%2==1:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
for i in range(1, N):
    if len(str(i)) % 2 == 1:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for x in range(1, n + 1):
  cnt = 0
  while x > 0:
    cnt += 1
    x /= 10
  if cnt % 2 == 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
for i in range(N+1):
	if len(str(i)) % 2 == 1:
		cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=0
for i in range(a):
    if len(str(i))%2==1:
        b+=1
print(b)

Submission status: Time Limit Exceeded

Solution code:
s = input()
N = int(s)
odd_num = 0
for i in range(1,N+1):
    cnt = 1
    while i // 10 >= 0:
        cnt += 1
        i //= 10
    if cnt % 2:
        odd_num += 1
print(odd_num)

Submission status: Time Limit Exceeded

Solution code:
x = input()
m = len(x)
x = int(x)

p = m//2
q = m%2

if q==1:
  if p==0:
    print(x)
    exit()
  else:
    a = 90
    while(p>0):
      x -= a
      a *= 100
    print(x)
    exit()
else:
  if p==0:
    print(0)
    exit()
  else:
    x = 0
    a = 9
    while(p>0):
      x += a
      a *= 100
    print(x)
    exit()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = 0
i = 1
while N//i != 0:
    if N//(i*10) != 0:
        a += i*10 - i
        i = i*100
    else:
        a = N - i +1
print(a)

Submission status: Time Limit Exceeded

Solution code:
while True:
  print('Hello')

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(1,N+1):
    if len(str(i)) %2 == 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = 0
for i in range(1, n+1):
  if len(str(i)) % 2 == 1:
    a += 1
print(a)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1):
  if len(str(i))%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

K=0
for i in range(1,N+1):
    K+=len(str(i))%2
print(K)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0

for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
count=0
for i in range(1,n+1):
    s=str(i)
    if(len(s)%2!=0):
        count+=1
print(count)

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    cnt = 0
    for i in range(1,n+1):
        if len(str(i))%2 != 0:
            cnt += 1
    print(cnt)
resolve()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

ans = 0
for i in range(1,N+1):
    num = len(str(i))
    if num % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
N_list = []
for i in range(1,N+1):
    if len(str(i)) % 2 == 1:
        N_list.append(i)
print(len(N_list))

Submission status: Accepted

Solution code:
n = int(input())


ctn = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        ctn += 1
        
        
print(ctn)

Submission status: Accepted

Solution code:
n = int(input())
# n個の整数のリスト
num_list = []
# 偶数の桁数の整数のリスト
num_odd_list = []

# n個の整数のリストに代入
for i in range(1, n + 1):
    num_list.append(i)

# 偶数の桁数の整数をリストに代入
for j in num_list:
    if 10 <= j < 100 or 1000 <= j < 10000 or 100000<= j < 1000000:
       num_odd_list.append(j)

# 全体の整数の数から偶数の桁数の整数の数を引く
print(len(num_list) - len(num_odd_list))

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for i in range(1,N+1):
    if len(str(i)) % 2 != 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
n = list(map(int, str(N)))
a = len(n)

if a % 2 == 0:
    print(int((10**int(a)-1)/11))
else:
    if a == 1:
        print(N)
    else:
        print(int(((100**int(a/2)-1)/11))+N-10**int(a-1)+1)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(1,n+1):
    if len(str(i))%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

s = len(str(n))

if s == 1:
    print(n)
elif s == 2:
    print(9)
elif s == 3:
    print(n-90)
elif s == 4:
    print(9+900)
elif s == 5:
    print(9+900+n-10000+1)
else:
    print(90909)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for x in range(1,n+1):
    n_str = str(x)
    if len(n_str) % 2 != 0:
        cnt += 1
    
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

odd_num = 0
for i in range(1, N + 1):

    if len(str(i)) % 2 == 1:
        odd_num += 1

print(odd_num)

Submission status: Accepted

Solution code:
import array
import bisect


def answer(n: int) -> int:
    numbers = array.array('L')

    i = 0
    while 100 ** i <= n:
        start = 100 ** i
        stop = int('9' * len(str(start))) + 1
        numbers.extend(range(start, stop))
        i += 1

    return bisect.bisect_right(numbers, n)


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0
for i in range(1,N+1):
    if len(str(i)) % 2 == 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(1, N + 1):
    if len(str(i)) & 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
a = input()
N = int(a)

if N == 10**5:
    print(90909)
elif N >= 10**4:
    print(N-(9000+90))
elif N >= 10**3:
    print(909)
elif N >= 10**2:
    print(N-90)
elif N >= 10:
    print(9)
else:
    print(N)

Submission status: Accepted

Solution code:
N = int(input())

if N<10:
  print(N)
elif 10<=N and N<100:
  print(9)
elif 100<=N and N<1000:
  print(9 + (N-100+1))
elif 1000<=N and N<10000:
  print(909)
elif 10000<=N and N<100000:
  print(909 + (N-10000+1))
else:
  print(90909)

Submission status: Accepted

Solution code:
n=int(input())
cnt=0
for i in range(1,n+1):
  if len(str(i))%2: cnt+=1;
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)