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())
a = 0
for i in (1, n+1):
  if len(str(i)) % 2 == 1:
    a += 1
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = len(str(n))
if l == 2:
  print(9)
elif l == 4:
  print(909)
elif l == 6:
  print(90909)
elif l == 1:
  print(n)
elif l == 3:
  print(n-90)
elif l == 5:
  print(n-8090)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = len(str(n))
if l == 2:
  print(9)
elif l == 4:
  print(909)
elif l == 6:
  print(90909)
elif l == 1:
  print(n)
elif l == 3:
  print(n-90)
elif l == 5:
  print(n-8091)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = len(str(n))
if l == 2:
  print(9)
elif l == 4:
  print(909)
elif l == 6:
  print(90909)
elif l == 1:
  print(n)
elif l == 3:
  print(n-90)
elif l == 5:
  print(n-8099)

Submission status: Wrong Answer

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 1000000<= j < 10000000:
       num_odd_list.append(j)

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

Submission status: Wrong Answer

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:
       num_odd_list.append(j)

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

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(n-90)
elif s == 4:
    print(9+900)
elif s == 5:
    print(9+900+n-1000+1)
else:
    print(90909)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
import collections
import itertools

def resolve():

    N=int(input())

    ans=0
    for i in range(1,N):
        if(10<=i<=99 or 1000<=i<=9999 or 100000<=i<=999999):
            continue
        ans+=1
    print(ans)
resolve()

Submission status: Wrong Answer

Solution code:
import math
import collections
import itertools

def resolve():

    N=int(input())

    ans=0
    for i in range(1,N):
        if(10<=i<99 or 1000<=i<9999 or 100000<=i<999999):
            continue
        ans+=1
    print(ans)
resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 5
while True:
  if (n//(10**i) != 0):
    break
  i = i - 1
i = i + 1

if (i%2 == 0):
  i = i//2
  ans = 0
  for j in range(i):
    ans = ans + 9*10**(2*j)
  print(ans)
else:
  i2 = (i - 1)//2
  ans = 0
  for j in range(i2):
    ans = ans + 9*10**(i2 - 1)
  tmp = 0
  for j in range(i - 1):
    tmp = tmp + 9*(10**j)
  ans = ans + n - tmp
  print(ans)

Submission status: Wrong Answer

Solution code:
import math


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return 1

nums = int(input())
total = 0

for num in range(1, nums+1):
    len_num = len(str(num))
    if not is_prime(len_num):
        total += 1

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
if len(n) == 6: print("90909")
if len(n) == 5: print(909 + int(n) - 9999)
if len(n) == 4: print("909")
if len(n) == 3: print(9 + int(n) - 99)
if len(n) == 2: print("9")
else: print(int(n))

Submission status: Wrong Answer

Solution code:
n = input()
if len(n) == 6: print(90909)
if len(n) == 5: print(909 + int(n) - 9999)
if len(n) == 4: print(909)
if len(n) == 3: print(9 + int(n) - 99)
if len(n) == 2: print(9)
else: print(int(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
num = len(str(n))
if num == 1:
    ans = n
else:
    if num&1==1:
        ans = (n%(10**(num-1)))+1
        num -=2
    else:
        ans = 0
        num -= 1
    n %= 10**num
    while num>0:
        ans += 9*(10**(num-1))
        num -=2
        n %= 10**num
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = len(str(n))
if num&1==1:
    ans = (n%(10**(num-1)))+1
    num -=2
else:
    ans = 0
    num -= 1
n %= 10**num
while num>0:
    ans += 9*(10**(num-1))
    num -=2
    n %= 10**num
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<10:
  print(a)
if 10<=a<100:
  print(9)
if 100<=a<1000:
  print(9+a-99)
if 1000<=a<10000:
  print(910)
if 10000<=a<100000:
  print(909+a-9999)
if 100000<=a<1000000:
  print(90909)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<10:
  print(a)
if 10<=a<100:
  print(9)
if 100<=a<1000:
  print(9+a-99)
if 1000<=a<10000:
  print(910)
if 10000<=a<100000:
  print(910+a-9999)
if 100000<=a<1000000:
  print(90909)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<10:
  print(a)
if 10<=a<100:
  print(9)
if 100<=a<1000:
  print(9+a-99)
if 1000<=a<10000:
  print(909)
if 10000<=a<100000:
  print(909+a-9999)
if a==1000000:
  print(90909)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<10:
  print(a)
if 10<=a<100:
  print(9)
if 100<=a<1000:
  print(9+a-100)
if 1000<=a<=10000:
  print(909)
if 10000<=a<100000:
  print(909+a-10000)
if a==1000000:
  print(90909)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<10:
  print(a)
if 10<=a<1000:
  print(9+a-90)
if 1000<=a<100000:
  print(9+900+a-9090)
if a==1000000:
  print(90909)

Submission status: Wrong Answer

Solution code:
#
# author Sidratul
#

from math import prod

if __name__ == '__main__':
    n = int(input())
    for i in range(n, 1, -1):
        c = str(i)
        if i%2 == 1 and not '0' in c:
            print(i)
            break

Submission status: Wrong Answer

Solution code:
# coding: utf-8

num = int(input())
if num < 10:
    print(num)
elif num < 100:
    print(9)
elif num < 1000:
    print(10 + int(num % 100))
elif num < 10000:
    print(10 + 999)
elif num < 100000:
    print(9 + 1000 + num % 1000)
elif num == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

num = int(input())
if num < 10:
    print(num)
elif num < 100:
    print(9)
elif num < 1000:
    print(10 + int(num % 100))
elif num < 10000:
    print(10 + 999)
elif num < 100000:
    print(10 + 1000 + num % 1000)
elif num == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

num = int(input())
if num < 10:
    print(num)
elif num < 100:
    print(9)
elif num < 1000:
    print(10 + int(num % 100))
elif num < 10000:
    print(10 + 999)
elif num < 100000:
    print(10 + 999 + num % 1000)
elif num == 100000:
    print(90909)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
nlen =len(str(n))
ans = 0
 
if n <= 9:
  print(n)
else:
  for i in range(1,nlen):
    if i % 2 == 1:
      ans += 10 ** i -10 ** (i-1)
  if nlen % 2 == 1:
    ans = ans + (n - 10**(nlen-1) + 1)
    print(str(n - 10**(nlen-1) + 1))
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
nlen =len(str(n))
ans = 0

if n <= 9:
  print(n)
else:
  for i in range(1,nlen):
    if i % 2 == 1:
      ans += 10 ** i -10 ** (i-1)
  print(ans)
  if nlen % 2 == 1:
    ans = ans + (n - 10**(nlen-1) + 1)
    print(str(n - 10**(nlen-1) + 1))
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
nlen =len(str(n))
ans = 0

if n <= 9:
  print(n)
else:
  for i in range(1,nlen+1):
    if i % 2 == 1:
      ans += 10 ** i -10 ** (i-1)
  if nlen % 2 == 0:
    ans = ans + (n - 10**(nlen-1) + 1)
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

keta=len(str(n))

cnt=0

if keta%2==0:
    cnt+=9
    for i in range(4,keta+1,2):
        cnt+=9*(100**((i-2)//2))
        
if keta%2!=0:
    cnt+=9
    for i in range(3,keta+1,2):
        if i==3:
            cnt+=n-99
        else:
            cnt+=9*(100**((i-3)//2))
            cnt+=n-(10**(i-1)-1)            

if keta==1:
    print(n)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())

keta=len(str(n))

cnt=0

if keta%2==0:
    cnt+=9
    for i in range(4,keta+1,2):
        cnt+=9*(100**((i-2)//2))
        
if keta%2!=0:
    cnt+=9
    for i in range(3,keta+1,2):
        if i==3:
            cnt+=n-99
        else:
            cnt+=9*(100**((i-3)//2))
            cnt+=n-(10**(i-2)-1)

if keta==1:
    print(n)
else:
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

Solution code:
n    = int(input())
mx   = 10**5
li   = [0]*mx
cnt  = 0
unit = 10

for i in range(mx):
    chk = (i+1)//unit

    if chk < 1:
        cnt+=1
    elif chk < 10:
        pass
    else:
        cnt+=1
        unit*100

    li[i] = cnt

print(li[n-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
l = len(str(N))
ans = 0
n = 1
while l >= n:
	c = 9 * 10 ** (n - 1)
	if 10 ** n - 1 < N:
		ans += c
	else:
		ans += N - (10 ** (n - 1))
	n += 2
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = len(str(N))
ans = 0
n = 1
while l >= n:
	c = 9 * 10 ** (n - 1)
	if 10 ** n - 1 <= N:
		ans += c
	else:
		ans += N - (10 ** (n - 1))
	n += 2
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = len(str(N))
ans = 0
n = 1
while l >= n:
	q = '9' * (n - 1)
	if q == '':
		q = '0'
	c = 9 * int(q) + 9
	print(N, c)
	if N > c:
		ans += c
	else:
		ans += N - (10 ** (n - 1)) + 1
	n += 2
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)
else:
    print(n-9091)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
digit = int(math.log10(N)) + 1
ans = 0
for i in range(1, digit, 2):
  ans += 9 * (10 ** (i-1))

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

print(ans)

Submission status: Wrong Answer

Solution code:


N=int(input())

if len(str(N))==1:
    print(N)
    exit()
    

sum=0
if len(str(N))%2==0:
    for i in range(int(len(str(N))/2)):
        sum += 9*10**(i*2)
else:
    for i in range(len(str(N))//2):
        sum += 9*10**i
    sum += N-int("9"*(len(str(N))-1))

print(sum)

Submission status: Wrong Answer

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

if l == 1:
    ans = int(N)
elif l == 2:
    ans = 9
elif l == 3:
    ans =  int(N[1:3]) +10
elif l == 4:
    ans = 909
elif l == 5:
    ans = int(N[1:5]) + 911
else:
    ans = 90909
    
print(ans)

Submission status: Wrong Answer

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

if l == 1:
    ans = int(N)
elif l == 2:
    ans = 9
elif l == 3:
    ans =  int(N[1:3]) +10
elif l == 4:
    ans = 909
elif l == 5:
    ans = int(N[1:5]) + 910
else:
    ans = 90909
    
print(ans)

Submission status: Wrong Answer

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

if l == 1:
    ans = int(N)
elif l == 2:
    ans = 9
elif l == 3:
    ans =  int(N[1:3]) +  9
elif l == 4:
    ans = 909
elif l == 5:
    ans = int(N[1:5]) + 909
else:
    ans = 90909
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 0
for i in range(6):
    if n // (10 ** i) >= 10 and (i + 1) % 2 == 1:
        res += 9 * (10 ** i)
    elif 1 <= n // (10 ** i) < 10 and (i + 1) % 2 == 1:
        res += ((n // 10 ** i) - 1) * (10 ** i)
        res += (n % 100) + 1
    # print(n // (10 ** i),i + 1 % 2 )
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# abc136_b.py
# https://atcoder.jp/contests/abc136/tasks/abc136_b

# B - Uneven Numbers /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 整数 Nが与えられます。N 以下の正の整数のうち、
# (先頭に 0をつけずに十進法で表記したときの) 桁数が奇数であるようなものの個数を求めてください。

# 制約
#     1≤N≤105

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N

# 出力
# N以下の正の整数のうち、桁数が奇数であるようなものの個数を出力せよ。

# 入力例 1
# 11

# 出力例 1
# 9

# 11以下の正の整数のうち、桁数が奇数であるようなものは 1,2,…,9 の 9個です。

# 入力例 2
# 136

# 出力例 2
# 46

# 1,2,…,9に加えて、100,101,…,136 の 37個の数も桁数が奇数です。

# 入力例 3
# 100000

# 出力例 3
# 90909


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # X, A = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = 0

    # 1桁
    if N < 10**1:
        result = N
    elif N >= 10**1 and N < 10**2:
        result = 9
    elif N >= 10**2 and N < 10**3:
        result = (N % 10**2) + 1 + 9
    elif N >= 10**3 and N < 10**4:
        result = 909
    elif N >= 10**4 and N < 10**5:
        result = (N % 10**4) + 1 + 909
    elif N >= 10**5 and N < 10**6:
        result = 90909

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['11']
        lines_export = [9]
    if pattern == 2:
        lines_input = ['136']
        lines_export = [46]
    if pattern == 3:
        lines_input = ['100000']
        lines_export = [90909]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
    print(n)
elif 10 <= n < 100:
    print(9)
elif 100 <= n < 1000:
    print(9+(n-99))
elif 1000 <= n < 10000:
    print(9+900+(n-999))
elif 10000 <= n < 100000:
    print(9+900+(n-9999))
elif 100000 <= n:
    print(9+900+90000)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
    print(n)
elif 10 <= n < 100:
    print(9)
elif 100 <= n < 1000:
    print(9+(n-99))
elif 1000 <= n < 10000:
    print(9+900)
elif 10000 <= n < 100000:
    print(9+900+90000+(n-9999))
elif 100000 <= n:
    print(9+900+90000)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
    print(n)
elif 10 <= n < 100:
    print(9)
elif 100 <= n < 1000:
    print(9+(n-99))
elif 1000 <= n < 10000:
    print(9+900+(n-999))
elif 10000 <= n < 100000:
    print(9+900+90000+(n-9999))
elif 100000 <= n:
    print(9+900+90000)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
Nlen = len(str(N))
ans = 0
if Nlen == 1:
    ans = N
elif Nlen == 2:
    ans = 9
elif Nlen == 3:
    ans = 9+N-100
elif Nlen == 4:
    ans = 9+900
elif Nlen == 5:
    ans = 9+900+N-10000
elif Nlen == 6:
    ans = 9+900+90000
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 9:
    print(n)
if 10 <= n <= 99:
    print(9)
if 100 <= n <=999:
    print(n%100+1+9)
if 1000 <= n <= 9999 :
    print(900+9)
if 10000 <= n <= 99999:
    print(n%10000+1+900+9)
if n == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 9:
    print(n)
if 10 <= n <= 99:
    print(9)
if 100 <= n <=999:
    print(n%100+1+9)
if 1000 <= n <= 9999 :
    print(900+9)
if 10000 <= n <= 99999:
    print(n%10000+900+9)
if n == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 9:
    print(n)
if 10 < n <= 99:
    print(9)
if 100 <= n <=999:
    print(n%100+1+9)
if 1000 <= n <= 9999 :
    print(900+9)
if 10000 <= n <= 99999:
    print(n%10000+900+9)
if n == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 100 :
    print(n)
if 100 <= n < 10000:
    print(n-100+1+9)
if 10000 <= n < 100000:
    print(n-10000+1+999-100+1+9)
if n == 100000:
    print(90909)

Submission status: Wrong Answer

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

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:
N = int(input())
c =0
for i in range(1,N+1):
  if len(str(N)) % 2 == 1:
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())
for i in range(6):
    10**i<=N<(i+1)
    n=i
ans=0
for i in range(1,n+1,2):
    ans+=10**i-10**(i-1)
print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
slen = len(S)
count = 0
for i in range(0,slen, 2):
    if ( i == slen-1):
        inv = 0 if i == 0 else 10 ** i
        count = count + (int(S)-inv) + 1
        # print(i, (int(S)-inv) + 1)
    else:
        count = count + 10 ** (i+1) - 10 ** (i)
        # print(i, 10 ** (i+1) - 1)
print(count)

Submission status: Wrong Answer

Solution code:
S = input()
slen = len(S)
count = 0
for i in range(0,slen, 2):
    if ( i == slen-1):
        inv = 0 if i == 0 else round(int(S), -1 * (slen-1))
        count = count + (int(S)-inv) + 1
        # print(i, (int(S)-inv) + 1)
    else:
        count = count + 10 ** (i+1) - 10 ** (i)
        # print(i, 10 ** (i+1) - 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())
count = 0
for i in range(N+1):
  i = str(i)
  if len(i) % 2 == 1:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
l = len(str(n))

ans = 0
for i in range(0, l-1, 2):
  ans += 9 * 10**(i)
if l & 1:
  a = 10**(l-1)
  a = n % a
  ans += a+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
int_n = int(n)

sum = 9
for i in range(1,len(n),1):
  if i%2 == 0:
    if i == (len(n)-1):
      sum += int_n - int("9"*i)
    else:
      sum += int("9"*(i+1)) - int("9"*i)
      
print(sum)

Submission status: Wrong Answer

Solution code:
n = input()
int_n = int(n)

sum = 9
for i in range(1,len(n),1):
  print(i)
  if i%2 == 0:
    if i == (len(n)-1):
      sum += int_n - int("9"*i)
    else:
      sum += int("9"*(i+1)) - int("9"*i)
      
print(sum)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(5):
    if n == 100000:
        sum = 90909
        break
    elif 10**i <= n < 10**(i+1):
        if (i+2) % 2 == 0:
            sum += n - 10**i + 1
            break
        else:
            break
    else:
        if (i+2) % 2 == 0:
            sum += 9 * (10**(2*i))
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
if len(N)%2:
    print(int('9'+'09'*max((len(N)-3)//2,0))+int(N)-pow(10,(len(N)+1)//2)+1)
else:
    print('9'+'09'*((len(N)-2)//2))

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
if N//100000==1:
    count=90909
elif N//10000>0:
    count=N%10000+910    
elif N//1000>0:
    count=909
elif N//100>0:
    count=N%100+10
elif N//10>0:
    count=9
else:
    count=N%10
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans  = 0
if n == 100000 :
    ans = 91009
elif 10000 <= n <= 99999 :
    ans = n - 10000 + 1 + 900 + 9
elif 1000 <= n <= 9999 :
    ans = 909
elif 100 <= n <= 999 :
    ans = n - 100 + 1 + 9
elif 10 <= n < 99 :
    ans = 9
elif 1 <= n <= 9 :
    ans = n

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans  = 0
if n == 100000 :
    ans = 101009
elif 10000 <= n <= 99999 :
    ans = n - 10000 + 1 + 1000 + 9
elif 1000 <= n <= 9999 :
    ans = 1009
elif 100 <= n <= 999 :
    ans = n - 100 + 1 + 9
elif 10 <= n < 99 :
    ans = 9
elif 1 <= n <= 9 :
    ans = n

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for i in range(1,6):
  if N >= 10**(i):
    if i%2==1:#1,3,5 (10,1000,100000)
      count+=9*10**(i-1)
  else:
    if i%2==1:#1,3,5 (10,1000,100000)
      count+=N-10**(i-1)+1
      break
print(count)

Submission status: Wrong Answer

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

'''
1-10 - 9

100 - 999 - 900

10000 - 99999 - 90000
'''

case = 0

if a > 99999: ans = 9 + 900 + 90000
if 100000 > a > 9999: ans = 9 + 900 + a - 9999
if 10000 > a > 99: ans = 9 + a - 99
if 100 > a > 9: ans = 9
if a < 10: ans = a

  
print(ans)

Submission status: Wrong Answer

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

'''
1-10 - 9

100 - 999 - 900

10000 - 99999 - 90000
'''

case = 0

if a > 9999: ans = 9 + 899 + a - 9999
if 10000 > a > 99: ans = 9 + a - 99
if 100 > a > 9: ans = 9
if a < 10: ans = a

  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
res=9
for i in range(3,len(str(n))+1):
  if i%2==0:
    continue
  res+=min(n+1,10**i)-10**(i-1)
print(res)

Submission status: Wrong Answer

Solution code:

def fn(i):
    return (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999)


def main():
    # n = int(input())
    n = 124
    x = range(n + 1)[1:]
    x = tuple(filter(fn, x))

    print(len(x))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if n == 1:
	print(n)
elif n == 2:
	print(9)
elif n == 3:
	print(9+(int(s)-99))
elif n == 4:
	print(9+900)
elif n == 5:
	print(9+899+(int(s)-9999))
else:
	print(90909)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if(10 > n):
    print(n)
elif(n >= 10)and(n < 100):
    print(9)
elif(n >= 100)and(n < 1000):
    print(10 + (n - 100))
elif(n > 1000)and(n <10000):
    print(1000 + n - 1000)
elif(n > 10000)and(n < 100000):
    print(10000 + n - 10000)
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(909)
elif N < 100000 :
    print(N-9090)
else : print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())
# 100000
# 1-9 9 100-999 900 10000-99999 90000
if n <= 9:
    print(n)
    exit()
if n > 9 and n <= 999:
    print(9 + n-99)
    exit()
if n > 999 and n <= 99999:
    print(9 + 900 + n-9999)
    exit()
if n > 99999 :
    print(9 + 900 + 90000)
    exit()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

res=0
for i in range(1, N+1):
    if(N//2==1):
        rea+=1

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(5,0,-1):
  if n//10**i: break
if i:
  s=int('90'*((i-1)//2)+'9')
else: s=0
if i%2==0:
  s+=n-10**i+1
print(s)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<10:
  print(n)
if 10<=n<100:
  print(9)
elif 100 <= n < 1000:
  print(n-90)
elif 1000 <= n < 10000:
  print(910)
elif 10000 <= n < 100000:
  print(n-9090)
elif n==100000:
  print(90909)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<100:
  print(n)
elif 100 <= n < 10000:
  print(n-90)
elif 10000 <= n < 100000:
  print(n-9090)
elif n==100000:
  print(90909)

Submission status: Wrong Answer

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

if N<10:
    ans=N
elif N<100:
    ans=9
elif N<1000:
    ans=N-90
elif N<10000:
    ans=N-9000-90
elif N<100000:
    ans=N-9000-90
else:
    ans=90909
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1,n + 1):
    print(i)
    if 10 <= i < 100 or 1000 <= i < 10000 or i == 100000:
        ans = ans
    else:
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline().rstrip("\n"))
place = 0
count = 0
going = True
while going:
    for i in range(10**(place+1)-1):
        if 10**place + i <= n:
            print(10**place+i)
            count += 1
        else:
            going = False
            break
    place += 2
print(count-1)

Submission status: Wrong Answer

Solution code:
import sys

def main():
    N = int(input())
    
    cnt = 0
    for i in range(1, N):
        if 1 <= i < 10:
            cnt += 1
        elif 100 <= i < 1000:
            cnt += 1
        elif 10000 <= i < 100000:
            cnt += 1
                    
    print(cnt)
main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    N = int(input())
    
    cnt = 0
    for i in range(N):
        if i < 10:
            cnt += 1
        elif 100 <= i < 1000:
            cnt += 1
        elif 10000 <= i < 100000:
            cnt += 1
                    
            
    print(cnt)
main()

Submission status: Wrong Answer

Solution code:
def f(N):
    x=0
    for i in range(N+1):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x
N=int(input())
print(f(N))

Submission status: Wrong Answer

Solution code:
def f(N):
    x=0
    for i in range(N):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x
N=int(input())
print(f(N))

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
cnt = 0
while i < n:
    if len(str(i)) % 2 >= 1:
        cnt += 1
    i += 1
print(cnt)