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 = str(input())

N = int(len(n))
result = 0

if N == 1:
    result = n
elif N % 2 != 0:
    result += (int(n) - (10 ** (N-1))) + 1
    count = 0
    for i in range(N // 2):
        count += 1 
        a = "9" * count
        result += int(a)
elif N % 2 == 0:
    count = 0
    for i in range(N // 2):
        count += 1 
        a = "9" * count
        result += int(a)

print(result)

Submission status: Wrong Answer

Solution code:
tmp = int(input())

input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag != 0:
            flag = 0
            ans = ans + 1
        else:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1


elif ketasuu == 1:
    ans = input_num

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])
    ans = ans + 1

    for keta_num in reversed(range(kazoeru-1)):

        if flag != 0:
            flag = 0
            ans = ans + 1
        else:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1



print(ans)

Submission status: Wrong Answer

Solution code:
#tmp = int(input())
tmp = 10515
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag != 0:
            flag = 0
            ans = ans + 1
        else:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1


elif ketasuu == 1:
    ans = input_num

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])
    ans = ans + 1

    for keta_num in reversed(range(kazoeru-1)):

        if flag != 0:
            flag = 0
            ans = ans + 1
        else:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1



print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 100000:
  print(90909)
if N >= 10000:
  print(909+N-9999)
if N >= 1000:
  print(909)
if N >= 100:
  print(9+N-99)
if N >= 10:
  print(9)
else:
  print(N)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())

keta = len(str(N))

count = 0
  
for i in range(1, keta, 2):
  count += (10 ** i)
  
if (keta  % 2) != 0:
  count += (N - 10 ** (keta - 1) + 1)
  
if N >= 10:
  count -= 1
  
print(count)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
j = 0
while 1:
    j += 1
    if j == n:
        print(i)
        break
    else:
        if 10000 <= j < 10000000:
            i += 1 
        elif 100 <= j < 1000:
            i += 1 
        elif j < 10:
            i += 1

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

Solution code:
tmp = int(input())

input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0
            ans = ans + 1

elif ketasuu == 1:
    ans = input_num

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])
    ans = ans + 1

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0
            ans = ans + 1



print(ans)

Submission status: Wrong Answer

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

for i in range(10000):
  q, mod =divmod(N, 10**(i+1))
  if i == 0:
    if q > 0:
      sum += 9
    else:
      sum += N
      break
  elif i % 2 == 0:
    if q > 0:
      sum += 9*(10**i)
    else:
      q2, mod2 = divmod(N, 10**i)
      sum += mod2 + 1
      break
  else:
    if q == 0:
      break
      
print(sum)

Submission status: Wrong Answer

Solution code:
a=n=int(input())
if n>9:a=9
if n>99:a+=n%1000-99
if n>9999:a+=n%100000-9999
if a<0:a+=100998
print(a)

Submission status: Wrong Answer

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

if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 1000:
    print(N - 90)
elif N < 10000:
    print(909)
else:
    print(N - 9091)

Submission status: Wrong Answer

Solution code:
N = int(input())

strN = str(N)
lenVal = len(strN)
answer = 0

if lenVal == 2:
  answer = 9
elif lenVal == 1:
  answer = strN[-1]
else:
  answer += 9
  for i in range(1,lenVal+1,2):
    if (i % 2 != 0) and (i != 1):
      if int(strN[-i]) != 0:
        maxVal = int(strN[-i:])
        minVal = (10 ** (i-1)) 
      else:
        maxVal = (10 ** i) - 1
        minVal = (10 ** (i-1)) 
      answer += maxVal - minVal + 1      

print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
x=int(input())
if x>9999:
    a=x-9091
elif x>99:
    a=x-90
elif x>9:
    a=9
else:
    a=x
print(a)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
a=int(input())
l=(np.arange(a)+1).tolist()
l_odd = [i for i in l if int(math.log10(i))+1 % 2 == 1]
print(len(l_odd))

Submission status: Wrong Answer

Solution code:
tmp = int(input())
#tmp = 9
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

elif ketasuu == 1:
    ans = input_num

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])
    ans = ans + 1

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0



print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

N_length = len(str(N))
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())

num = [1,10,100,1000,10000, 100000]
num2 = {1:9, 100:1000, 10000:100000}
num3 = {1:1,2:10,3:100,4:1000,5:10000, 6:100000}
count = 0

for n in num:
    if len(str(n)) % 2 == 0: continue
    if len(str(N)) > len(str(n)):
#        print('unk')
#        print(N,n, num2[n])
        count += num2[n]
#print(count)
if len(str(N)) % 2 != 0:
#    count += num3[len(str(N))]*10-N
    count += N-num3[len(str(N))]+1

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
j = 0
while 1:
    j += 1
    if j == n:
        print(i)
        break
    else:
        if j <= 9:
            i += 1 
        elif 99 <= j <= 9999:
            i += 1 
        elif 9999 <= j <= 99999:
            i += 1

Submission status: Wrong Answer

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

if digit%2==0:
    for i in range(digit//2):
        ans*=100
        ans+=9
else:
    for i in range(digit//2):
        ans*=100
        ans+=9
    ans+=n-10**(digit-1)+2-n//(10**(digit-1))

print(ans)

Submission status: Wrong Answer

Solution code:
n = input().rstrip()
n_sp = list(map(int, list(n)))
dig  = len(n_sp)
odd = 0

if dig == 1:
    print(n_sp[0])

else:
    for i in range(1, dig, 2):
        odd += int("9" * i) - 10 ** (i-1) + 1

    if dig%2 == 1:
        odd += int(n) - n_sp[0]  * 10 ** (dig-1) +1

    print(odd)

Submission status: Wrong Answer

Solution code:
n = input().rstrip()
n_sp = list(map(int, list(n)))
print(n_sp)
dig  = len(n_sp)
odd = 0

if dig == 1:
    print(n_sp[0])

else:
    for i in range(1, dig, 2):
        odd += int("9" * i) - 10 ** (i-1) + 1
        print("i: " + str(i) + " odd: " + str(odd))

    if dig%2 == 1:
        odd += int(n) - n_sp[0]  * 10 ** (dig-1) +1

    print(odd)

Submission status: Wrong Answer

Solution code:
N = input()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) == 1:
    ans = int(N) + 1


elif len(N) % 2 != 0:
    ans += (10 ** (len(N)-1)) * (int(N[0])-1)
    ans += int(N[min(1, len(N)-1):]) + 1


print(ans)

Submission status: Wrong Answer

Solution code:
tmp = int(input())
#tmp = 10000
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0
            
    ans = ans + 1

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<10:
  print(N)
elif N<1000:
  print(9+N-99)
elif N<100000:
  print(9+900+N-9999)
elif N==100000:
  print(90909)

Submission status: Wrong Answer

Solution code:
N = input()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) % 2 != 0:
    ans += (10 ** (len(N)-1)) * (int(N[0])-1)
    ans += int(N[min(1, len(N)-1):]) + 1
    if N[0] != 1:
        ans -= 1

print(ans)

Submission status: Wrong Answer

Solution code:
tmp = int(input())
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
n = int(input())
keta = int(len(str(n)))
c = 0

print("keta",keta)

if keta ==1:
    print(n)
elif keta ==2:
    print(9)
elif keta ==3:
    print(9+n-10**2+1)
elif keta == 4:
    print(900+9)
elif keta == 5:
    print(9+900+n-10**4+1)
elif keta == 6:
    print(9+900+90000)

Submission status: Wrong Answer

Solution code:
N = input()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) % 2 != 0:
    ans += (10 ** (len(N)-1)) * (int(N[0])-1)
    ans += int(N[min(1, len(N)-1):]) + 1

print(ans)

Submission status: Wrong Answer

Solution code:
tmp = int(input())
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


print(lst)

print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

else:
    print((10**ketasuu) * lst[0])
    ans = input_num - ((10**kazoeru) * lst[0])

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

strN = str(N)
lenVal = len(strN)
answer = 0

if lenVal == 2:
  answer = 9
elif lenVal == 1:
  answer = strN[-1]
else:
  answer += 9
  for i in range(1,lenVal+1,2):
    if (i % 2 != 0) and (i != 1):
      if int(strN[-i+1:]) != 0:
        maxVal = int(strN[-i:])
        minVal = (10 ** (i-1)) 
      else:
        maxVal = (10 ** i) - 1
        minVal = (10 ** (i-1)) 
      answer += maxVal - minVal + 1      

print(answer)

Submission status: Wrong Answer

Solution code:
cc=list(map(int, input().split()))

NumDig = len(str(cc[0]))


# if odd, print 1. if even print 0
counter = 0

if (NumDig % 2 == 0):
  for idx in range(1, NumDig, 2):
    if idx == 1:
      counter = counter + 10**(idx)-1
    else:
      counter = counter + 10**(idx) - 10**(idx-1)
  #counter = counter + cc[0] - 10**(NumDig-1) + 1
      
if (NumDig % 2 != 0 ):
  for idx in range(1, NumDig, 2):
    if idx == 1:
      counter = counter + 10**(idx)-1
    else:
      counter = counter + 10**(idx)- 10**(idx)  
  counter = counter + cc[0] - 10**(NumDig-1) + 1
  
print(counter)

Submission status: Wrong Answer

Solution code:
n_str = input()

# 桁数と最大奇数桁数のマップ
max_digits = {
    1 : 1 ,
    2 : 9,
    3 : 10,
    4 : 909,
    5 : 9090,
    6 : 90909,
}

# 桁数
digits = len(n_str)
if digits % 2 == 0:
    print(max_digits[digits])
else:
    # num1 = map1[digits]
    n = int(n_str)
    num1 = 10 ** (digits - 1)
    num2 = max_digits[digits]

    # 加算でn - num1 + num2
    print(n - num1 + num2)

Submission status: Wrong Answer

Solution code:
N = int(input())

N_length = len(str(N))
ans = 0

if N_length == 1:
  ans = N
else:
  for i in range(N_length):
    if i%2 == 1:
      ans += 9*(10**(i-1))

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
lis = [i for i in str(n)]
keta = len(lis)
if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(10 + n - 100*int(lis[0]))
elif keta == 4:
    print(909)
elif keta == 5:
    print(910 + n - 10000*int(lis[0]))
else:
    print(90909)

Submission status: Wrong Answer

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

while N > 0:
    if N%10 == 0:
        count +=9
    else:
        count +=N%10
    N = N//100    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
lis = [i for i in str(n)]
keta = len(lis)
if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(10 + n - 100*int(lis[0]))
elif keta == 4:
    print(909)
elif keta == 5:
    print(10 + n - 10000*int(lis[0]))
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
anser = 0
for x in range(1,10):
    if N > x:
        ans = ans + 1
for g in range(99,1000):
    if N > g:
        anser = anser + 1
for m in range(10000,99999):
    if N > m:
        ans = ans + 1
print(ans+ anser)

Submission status: Wrong Answer

Solution code:
N = int(input())
N_1 = len(str(N))
if(N_1 < 2):
  print(N)
if (N_1 == 2):
  print(9)
if(N_1 == 3):
  print(N-99+9)
if(N_1 == 4):
  print(909)
if(N_1 == 5):
  print(N-9999+909)

Submission status: Wrong Answer

Solution code:
N = int(input())

N_length = len(str(N))
ans = 0

for i in range(N_length):
  if i%2 == 1:
    ans += 9*(10**(i-1))

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
if n == 100000:
  count=90909
elif 10 ** 4 < n and n <= 10 ** 5:
  count = 9 + 900 + n - 10**4 + 1
elif 10**3 < n and n <= 10 **4:
  count = 909
elif 10 ** 2 < n and n <= 10 **3:
  count = 9 + n - 10**2 +1
elif 10 ** 1 < n and n <=10**2:
  count = 9
else:
  count = n
print(count)

Submission status: Wrong Answer

Solution code:
i = input()
j = len(i)
k = int(i)
if j==1:
    print(k)
elif j ==2:
    print(9)
elif j==3:
    print(k-90)
elif j==4:
    print(109)
elif j==5:
    print(k-9999 + 109)
elif j ==6:
    print(90909)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
array = np.array([n+1 for n in range(N)])
log_array = np.log10(array).astype(np.int) + 1
infer = (log_array % 2 == 1).sum()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
print(math.ceil(n/2))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N<10:
  print(N)
elif N<100:
  print(9)
elif N<1000:
  print(9+N-99)
elif N<10000:
  print(909)
elif N<100000:
  print(9+900+N-9999)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
anser = 0
for x in range(1,10):
    if N > x:
        ans = ans + 1
for g in range(100,1000):
    if N > g:
        anser = anser + 1
for m in range(10000,100000):
    if N > m:
        ans = ans + 1
print(ans+ anser)

Submission status: Wrong Answer

Solution code:
A = int(input())

if 1 <= A < 10:
  ans = len(range(1, A + 1))
elif 10 <= A < 100:
  ans = 9
elif 100 <= A < 1000:
  ans = 9 + len(range(100, A + 1)) 
elif 1000 <= A < 10000:
  ans = 9 + 900
else:
  ans = 9 + 900 + len(range(10000, A + 1))

print(ans)

Submission status: Wrong Answer

Solution code:
i = input()
j = len(i)
k = int(i)
if j==1:
    print(k)
elif j ==2:
    print(9)
elif j==3:
    print(k-90)
elif j==4:
    print(109)
elif j==5:
    print(k-890)
elif j ==6:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())

N_length = len(str(N))
ans = 0

for i in range(N_length):
  if i%2 == 1:
    ans += 9*(10**(i-1))

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) % 2 != 0:
    ans += ans * (int(N[0]) - 1)
    ans += int(N[min(1, len(N)-1):]) + 1

print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
count = 0
for i in range(a):
  if int((len(str(i))) % 2 == 1):
    count += 1
      
if a % 10 != 0:
  print(count)
else:
  print(count - 1)

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-9091)

Submission status: Wrong Answer

Solution code:
N = input()
lst = list(N)
l = len(N)

ans = 9
if (l == 1):
  print(int(N))
elif (l == 2):
  print(ans)
else:
  for i in range(3, l + 1):
    if (i % 2 != 0):
      if (int(N) % 10**(i-1) == 0):
        if (int(lst[-i]) != 0):
          ans += (int(lst[-i]) * 10**(i-1)) - 10**(i-1) + 1
        else:
          ans += 10**i - 10**(i-1)
      else:
        ans += int(N) - 10**(i-1) + 1
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
anser = 0
for x in range(1,10):
    if N > x:
        ans = ans + 1
for g in range(99,1000):
    if N > g:
        anser = anser + 1
for m in range(10000,100000):
    if N > m:
        ans = ans + 1
if N > 10000:
    ans = ans - 1
print(ans+ anser)

Submission status: Wrong Answer

Solution code:
N = input()
nums = len(N)
count = 0
#1,2,3

#+1 0 +2
#10 46, 90911
for i in range(nums):
#     print(i+1)
    if ((i+1) % 2) == 1:
        record = ((10**(i+1)))
        count +=  record  - (10**i)
#         print(count)
#         count += 9 * (10**(i))
        
    else:
        continue

# print('record',record)
diff = record - int(N)
# print('dif', diff)
# print('count',count)
if diff > 0:
    out = count-diff
    if not int(N) % 10 ==0:
        out +=1
    
else:
    out = count
print(out)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = str(int(n))
s = s.rjust(6, '0')
l = len(str(n))

r = 0

if l == 1:
    r = r +int(s[5:])
else:
    if l > 4:
        r = r + n - 10000
    if l > 2:
        if l > 3 or s[3:] == "000":
            r = r + 900
        else:
            r = r + int(s[3:]) - 100
    if l > 1:
            r = r + 9  

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
if  1<=len(n)<=2:
    print(int(n))
elif 3<=len(n)<=4:
    
    print(10+int(n)-100)
elif 5<=len(n)<= 6:
    print(110)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = input().strip()
    int_n = int(n)
    keta = len(n)
    # 桁ごとにマックスの数が決っている
    # あとは、指定された数から規定数を引けばいいはず
    # 1 -> 9 -> 9
    # 100 -> 999 -> 899
    # full - 100 -> x
    cnt = 0
    for i in range(1, keta + 1, 2):
        print(i)
        max_num = 10 ** (i) - 1
        min_num = 10 ** (i - 1) - 1
        cnt += max_num - min_num
        if keta == i:
            cnt -= max_num - int_n
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=input()
n=len(N)
n=int(n)
num=0
num1=1
num2=1
for i in range(n-1):
    if(i%2==0):
        if(i>1):
            for k in range(i):
                num1=num1*10
                num2=num1
        num1=1
        num+=9*num2
if(int(N)>9):
    if(n%2==1):
        #print(num2)
        num+=int(N)%(num2*100)+1
else:
    if(n%2==1):
        num+=int(N)%(num2*100)


print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())

strN = str(N)
lenVal = len(strN)
answer = 0
count = 0

if lenVal == 2:
  answer = 9
elif lenVal == 1:
  answer = strN[-1]
else:
  answer += 9
  for i in range(1,lenVal+1,2):
    if (i % 2 != 0) and (i != 1):
      if int(strN[-i:]) != 0:
        maxVal = int(strN[-i:])
        minVal = (10 ** (i-1)) 
      else:
        maxVal = (10 ** i) - 1
        minVal = (10 ** (i-1)) 
      answer += maxVal - minVal + 1      

print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = len(str(n))
 
i = 0
c = 0
while i < l:
  if i == 0:
    if n < 10:
      c = n
      break
    else:
      c = 9
      i = i + 1
  elif i%2 == 1:
    i = i + 1
    continue
  elif i == (l-1):
    print(10**i)
    c = c + (n-((10**i)-1))
    i = i + 1
  else:
    c = c + ((10**(i+1))-(10**i))
    i = i + 1
 
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:
N = input()

tmp = len(N)

if tmp == 1:
    print(int(N))
else:
    ans = 0
    for i in range(tmp):
        if i&1 == 1:
            ans += 10**(i) - 10**(i-1)
        elif i == tmp-1:
            ans += int(N[1:]) + 1

    # if N[0] == "1" and N[1:]
    print(ans)

Submission status: Wrong Answer

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

i = 0
c = 0
while i < l:
  if i == 0:
    if n < 10:
      c = n
      break
    else:
      c = 9
      i = i + 1
  elif i%2 == 1:
    i = i + 1
    continue
  elif i == (l-1):
    print(10**i)
    c = c + (n-((10**i)-1))
    i = i + 1
  else:
    c = c + ((10**l)-(10**(l-1)))
    i = i + 1

print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  ans = n
elif n < 10**2:
  ans = 9
elif n < 10**3:
  h = n-99
  ans = h+9
elif n < 10**5:
  t_t = n - 9998
  ans = t_t + 909
elif n == 10**5:
  ans = 90909
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
a=round(math.log10(n))
count=0
result=0
while count<=a:
	if a<=1:
		result += n+1
		break
	else:
		if count==a:
			result += n-10**count + 1
			count += 2
		else:
			if  count==0:
				result+=10
				count +=2
			else:
				result += 10**(count+1)-10**count
				count += 2
aaa=result-1
print(aaa)

Submission status: Wrong Answer

Solution code:
n=input()
count=0
if len(n)==1:
  count=int(n)
if len(n)==2:
  count+=9
if len(n)==3:
    count+=(int(n)//100-1)*100+int(n)%100+1
if len(n)==4:
    count+=909
if len(n)==5:
      count+=(int(n)//10000-1)*10000+int(n)%10000+1
if len(n)==6:
      count+=90909
print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=0
for i in range(N):
  if (i+1)//10==0:
    a+=1
  elif (i+1)//100==0:
    a+=0
  elif (i+1)//1000==0:
    a+=1
  elif (i+1)//10000==0:
    a+=0
  else:
    a+=1
print(a)

Submission status: Wrong Answer

Solution code:
a = int(input())
if a <10:
  print("{}".format(a))
elif a <100:
  print("9")
elif a < 1000:
  print("{}".format(9+a-99))
elif a < 10000:
  print('909')
elif a < 10000:
  print("{}".format(909+a-9999))
else:
  print('90909')

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  ans = n
elif n < 10**2:
  ans = 9
elif n < 10**3:
  h = n-99
  ans = h+9
elif n < 10**5:
  t_t = n - 9999
  ans = t_t + 908
elif n ==10**5:
  ans = 90909
  
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n>10:
    ans=9
else:
    ans=n
if n>=100000:
    ans=ans-100001
if n>10000:
    ans=ans+(n-9000)
if n>100:
    ans=ans+(n-99)
print(ans)

Submission status: Wrong Answer

Solution code:
n=input()
count=0
if len(n)==1:
  count=int(n)
if len(n)==2:
  count+=9
if len(n)==3:
    count+=(int(n)//100-1)*100+int(n)%100+1
if len(n)==4:
    count+=900
if len(n)==5:
      count+=(int(n)//10000-1)*10000+int(n)%10000+1
if len(n)==6:
      count+=90909
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
if a <10:
  print("{}".format(a));
elif a <100:
  print("9")
elif a < 1000:
  print("{}".format(9+a-99))
elif a < 10000:
  print('909')
elif a < 10000:
  print("{}".format(909+a-9999))
else:
  print('90909')

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
i = 0

while N >= 10**(i+1):
    if i%2 == 1:
        ans += 10**(i+1)- 10**i
    i += 1

if i%2 == 0:
    ans += N - 10**i + 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
a=round(math.log10(n))
count=0
result=0
while count<=a:
	if a<=1:
		result += n+1
		break
	else:
		if count==a:
			result += n-10**count + 1
			count += 2
		else:
			if  count==0:
				result+=10
				count +=2
			else:
				result += 10**(count+1)-10**count
				count += 2
aaa=result-1
print(aaa)

Submission status: Wrong Answer

Solution code:
N = input()

buff = int(N)
N = list(N)
# N = N[::-1]
keta = len(N)
ans = 0
if keta % 2 == 0:
    gain = 1
    for i in range(0, keta-1, 2):
        ans += (9*gain)
        gain = gain * 100

    print(ans)

else:
    if keta == 1:
        print(N[0])
        exit()

    gain = 1
    for i in range(0, keta-1, 2):
        ans += (9*gain)
        gain = gain * 100

    gg = 1
    for i in range(keta-1):
        gg *= 10

    ans += buff%gg+1
    print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=0
for i in range(N):
  if i+1//10==0:
    a+=1
  elif i+1//100==0:
    a+=0
  elif i+1//1000==0:
    a+=1
  elif i+1//10000==0:
    a+=0
  else:
    a+=1
print(a)

Submission status: Wrong Answer

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

# スペース区切りの整数の入力
a = input()

if len(str(a)) == 1:
    print("{}".format(a))
elif len(str(a)) == 2:
    print("9")
elif len(str(a)) == 3:
    print("{}".format(1 + (int(a)-100) +9))
elif len(str(a)) == 4:
    print("909")
#elif len(str(a)) == 5:
else:
    print("{}".format(90909))

Submission status: Wrong Answer

Solution code:
n = int(input())
str_n = str(n)
keta = len(str_n)
res = 0
for num in range(1, keta, 2):
  res += 9 * (10 ** (num - 1))
if(keta % 2 == 1):
  last = 0
  if(keta == 1):
    last = n
  else:
  	last = (int(str_n[1:]) + 1) + (int(str_n[0]) - 1) * 9 * len(str_n[1:])
  res += last
print(res)

Submission status: Wrong Answer

Solution code:
n_str = input()
n_int = int(n_str)
if n_int == 1:
    print(1)
# 1 ~ 50000
# 桁数が奇数= 1桁, 3桁, 5桁
# 1 ~ 9, 100 ~ 999,10000 ~ 99999の90909個しかないので全探索いけるか?
exs_list = []
for i in range(1, 100000):
    if len(str(i)) % 2 == 1:
        exs_list.append(i)

exs = {i: i for i in exs_list}

n_s = []
ans = 0
for i in range(1, n_int + 1):
    if len(str(i)) % 2 == 0:
        continue
    if i in exs:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
# 10万までだから無理やり解く...
if n / 10 < 1:
    print(n % 10)
elif n / 100 <= 1:
    print(9)
elif n / 1000 < 1:
    print((n % 1000) - 99 + 9)
elif n / 10000 < 1:
    print(909)
elif n / 100000 < 1:
    print((n % 100000) - 9999 + 909)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

for i in range(N):
    if ( 1 <= i and i < 10) or (100 <= i and i < 1000) or (10000 <= i and i < 100000):
        ans = ans + 1


print(ans)

Submission status: Wrong Answer

Solution code:
int_n = int(input())

n = str(int_n)

n_len = len(n)

ans = 0
tmp = 0

if n_len == 1:
    ans = int_n
else:
    for i in range(1,n_len):
        if i % 2 == 1:
            tmp = (10 ** i) - (10 ** (i-1))
            ans += tmp
    if (n_len % 2) == 1:
        tmp = int(n[1:]) + 1
        ans += tmp

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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