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:
import sys
input = sys.stdin.readline

N = int(input())
ans = 0
N = N % (10 ** 5) - 1
ans += N % (10 ** 4) + 1
N = N % (10 ** 3) - 1
ans += N % (10 ** 2) + 1
N = N % (10 ** 1) - 1
ans += N % (10 ** 0)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
digit = len(str(N))
# 1-99
if digit < 3:
    print(min((N-1), 9))
# 100-999
elif digit == 3:
    print(N-99+9)
# 1000-9999
elif digit == 4:
    print(999-99+9)
# 10000-99999
elif digit == 5:
    print(N-9999-99+999+9)
# 100000
else:
    print(99999-9999-99+999+9)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
count = 0
for i in range(n):
  if int(math.log10(n) + 1) % 2 == 1:
    count += 1 
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
J=0
for i in range(n):
  for j in range(5):
    if 10**j<=i<10**(j+1):
      J=j
      break
  if J%2==0:
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for n in range(1,N):
    if 0<n<10:
        count+=1
        continue
    elif 99<n<1000:
        count+=1
        continue
    elif 9999<n<100000:
        count+=1
        continue
    else:
        pass
print(count)

Submission status: Wrong Answer

Solution code:
n = str(input())
dig = len(n)
ret = 0

if dig > 1:
    for tmp_dig in range(0, dig-1, 2):
        ret += int(9 * (10 ** tmp_dig))
    if len(n) % 2:
        ret += int(n[1:])+1
else:
    ret = int(n)

print(ret)
exit()

Submission status: Wrong Answer

Solution code:
n = str(input())
dig = len(n)
ret = 0

if dig > 1:
    for tmp_dig in range(0, dig-1, 2):
        ret += 9 * ( 10 ** (tmp_dig) )
else:
    print(int(n))
    exit()

if len(n) % 2:
    ret += int(n[1:])+1

print(ret)
exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(raw_input())

d_num = 0
even = True
ary = []
N_tmp = N

while N_tmp != 0:
    ary.append(N_tmp % 10)
    N_tmp = N_tmp / 10
    even = not even
    d_num = d_num + 1

# print d_num, ary

if d_num == 1:
    print ary[0]
elif d_num == 2:
    print 9
elif d_num == 3:
    print 10 + (N -(ary[2] * 100))
elif d_num == 4:
    print 9 + 900
elif d_num == 5:
    print 10 + 900 + (N -(ary[4] * 10000))
elif d_num == 6:
    print 9 +  900 + 90000

Submission status: Wrong Answer

Solution code:
N = int(raw_input())

d_num = 0
even = True
ary = []
N_tmp = N

while N_tmp != 0:
    ary.append(N_tmp % 10)
    N_tmp = N_tmp / 10
    even = not even
    d_num = d_num + 1

# print d_num, ary

if d_num == 1:
    print ary[0]
elif d_num == 2:
    print 9
elif d_num == 3:
    print 10 + (N -(ary[2] * 100))
elif d_num == 4:
    print 9 + 900
elif d_num == 5:
    print 9 + 900 + (N -(ary[4] * 10000))
elif d_num == 6:
    print 9 +  900 + 90000

Submission status: Wrong Answer

Solution code:
N = int(raw_input())

d_num = 0
even = True
ary = []
N_tmp = N

while N_tmp != 0:
    ary.append(N_tmp % 10)
    N_tmp = N_tmp / 10
    even = not even
    d_num = d_num + 1

# print d_num, ary

if d_num == 1:
    print ary[0]
elif d_num == 2:
    print 9
elif d_num == 3:
    print 10 + (N -(ary[2] * 100))
elif d_num == 4:
    print 9 + 900
elif d_num == 5:
    print 10 + 1000 + (N -(ary[4] * 10000))
elif d_num == 6:
    print 9 +  900 + 90000

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

# 1
a1 = 10 - 1 # o
# 2
a2 = 100 - 10 # e

a3 = 1000 - 100 # o
# 3
a4 = 10000 - 1000 # e

# 4
a5 = 100000 - 10000 # o

if N // 10**5 > 0:
  print(a1+a3+a5)
elif N // 10**4 > 0:
  print(N - 10**4+1+a1 + a3)
elif N // 10**3 > 0:
  print(a3+a1)
elif N // 10**2 > 0:
  print(N - 10**2+1  + a1)
elif N // 10 > 0:
  print(a1)

Submission status: Wrong Answer

Solution code:
N = int(input())

# 1
a1 = 10 - 1 # o
# 2
a2 = 100 - 10 # e

a3 = 1000 - 100 # o
# 3
a4 = 10000 - 1000 # e

# 4
a5 = 100000 - 10000 # o

if N // 10**5 > 0:
  print(a1+a3+a5)
elif N // 10**4 > 0:
  print(N - 10**4+1+a1 + a3)
elif N // 10**3 > 0:
  print(a2+a1)
elif N // 10**2 > 0:
  print(N - 10**2+1  + a1)
elif N // 10 > 0:
  print(a1)

Submission status: Wrong Answer

Solution code:
N = int(input())
f = len(str(N))
print(f)
if f%2 == 0:
  print((100**(f//2)-1)//11)
else:
  print((100**((f-1)//2)-1)//11 + N - 10**(f-1) + 1)

Submission status: Wrong Answer

Solution code:
n=input()
L=len(n)
N=int(n)
if L==1:
    print(N)
elif L==2:
    print(9)
elif L==3:
    print(9+N%100+1)
elif L==4:
    print(9+900)
elif L==5:
    print(9+900+N%10000+1)
else:
    print(9+900+90000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
m=int(math.log10(n)+1)
ans=0
def count(x):
  global ans
  if x>0:
    ans+=10**(x)-10**(x-1)
    count(x-2)
  else:
    return ans
if m%2==0:
  count(m-1)
else:
  count(m-2)
  ans=n-10**(m-1)+1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
m=int(math.log10(n))
print(m)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=0
if a>1e4:ans+=a-1e4+1
if a>1000:ans+=899
else:ans+=max(0,a-99)
if a>10:ans+=9
else:ans+=a
print(str(int(ans)))

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=0
if a>1e4:ans+=a-1e4+1
if a>1000:ans+=899
else:ans+=max(0,a-99)
if a>10:ans+=9
else:ans+=a
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
keta_list = [9, 0, 900, 0, 90000, 0]
keta = len(str(N))
for target_list in range(keta):
    if N >= keta_list[target_list]:
        count = count + keta_list[target_list]
    else: 
        count = count + N - 10 ** (target_list)+1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
keta_list = [9,0,900,0,90000,0]
keta = len(str(N)) 
for target_list in range(keta):
    count = count + keta_list[target_list]
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

N = int(sys.stdin.read().strip())
total = 0
for v in range(6):
  if v % 2 != 0:
    continue
  low = 10 ** v
  high = 10 ** (v+1)
  if N < low:
    break
  if N >= high:
    total += high - low
  else:
    total += N - low
    break
print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 0
answer = 0
while n > 10 ** (2*i + 1):
  answer += 10 ** (2*i + 1) - 10 ** (2*i)
  i += 1
answer += max(0, n - 10 ** (2*i) + 1)

print(answer)

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
s=str(N)
num=len(s)
if num==1:
    print(N)
elif num==2:
    print("9")
elif num==3:
    print(N-90)
elif num==4:
    print("909")
elif num==5:
    print(N-90909)
else:
    print(90909)

Submission status: Wrong Answer

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

if digit_n % 2 == 0:
    for i in range(digit_n // 2):
        ans += 9 * 10 ** (i * 2)

else:
    if digit_n != 1:
        for i in range((digit_n - 1) // 2):
            ans += 9 * 10 ** (i * 2)
        hasuu = int(str(n)[1:])
        ans += hasuu + 1
    
    else:
        ans = n

    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

result = list(filter(lambda i: len(str(i)) % 2 != 0, range(1,N+1)))
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())

result = list(filter(lambda i: len(str(i)) % 2 != 0, range(1,N)))
print(len(result))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n = input()
keta = len(n)
total = [9, 900, 90000]
ans = 0
for i in range(1, keta+1):
    if i % 2 == 1:
        if int(n) <= i * 10 ** i:
            # print(int(n) - 10 ** (i-1))
            ans += int(n) - 10 ** (i-1)
        else:
            ans += total[i//2]
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n = input()
keta = len(n)
total = [9, 900, 90000]
ans = 0
for i in range(1, keta+1):
    if i % 2 == 1:
        if int(n) < i * 10 ** i:
            ans += int(n) - 10 ** (i-1)
        else:
            ans += total[i//2]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if(N == 100000):
    ans = 90910
elif(10000 <= N < 100000):
    ans = 909 + N - 9999
elif(1000 <= N < 10000):
    ans = 909
elif(100 <= N < 1000):
    ans = 9 + N -99
elif(10 <= N < 100):
    ans = 9
elif(0 <= N < 10):
    ans = N

print(ans)

Submission status: Wrong Answer

Solution code:
n = input('整数を入力してください：')

while n.isdigit() == False or int(n) > 10**5:
    print('Error')
    n = input('整数を入力してください：')
else:
    n = int(n)
n = int(n)

result = []
for i in range(1,n+1):
    if len(str(i)) % 2 !=0:
        result.append(i)
print(len(result))

Submission status: Wrong Answer

Solution code:

a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    # print(c)
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1 and len(s)> 1:
    c += int(s[1:])+1
elif len(s)==1:
    c +=a

print(c)

Submission status: Wrong Answer

Solution code:
a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    # print(c)
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1 and len(s)> 1:
    c += int(s[1:])+1

print(c)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:900, 3:0, 4:90000, 5:0, 6:9000000}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b >= 1:
  for i in range(b-1):
    x = re[i]
    cnt += x

if b-1 in be:
  y = be[b-1]
  cnt += int(a) - y


print(cnt)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:900, 3:0, 4:90000, 5:0, 6:9000000}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b >= 1:
  for i in range(b):
    x = re[i]
    cnt += x

if b-1 in be:
  y = be[b-1]
  cnt += int(a) - y


print(cnt)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:899, 3:0, 4:89999, 5:0, 6:8999999}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b >= 1:
  for i in range(b-1):
    x = re[i]
    cnt += x

if b-1 in be:
  y = be[b-1]
  cnt += int(a) - y


print(cnt)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:899, 3:0, 4:89999, 5:0, 6:8999999}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b >= 1:
  for i in range(b-1):
    x = re[i]
    cnt += x

if b in be:
  y = be[b]
  cnt += int(a) - y 
  
print(cnt)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:899, 3:0, 4:89999, 5:0, 6:8999999}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b >= 1:
  for i in range(b-1):
    x = re[i]
    cnt += x

if re[b] >= 1:
  y = be[b]
  cnt += int(a) - y 
  
print(cnt)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:899, 3:0, 4:89999, 5:0, 6:8999999}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b >= 1:
  for i in range(b-1):
    x = re[i]
    cnt += x

if re[b] >= 1:
  y = be[b]
  cnt += y
  
print(cnt)

Submission status: Wrong Answer

Solution code:
re = {0:9, 1:0, 2:899, 3:0, 4:89999, 5:0, 6:8999999}
be = {0:9, 2:99, 4:9999, 6:999999}
a = input()

b = len(a)

cnt = 0
if b-1 >= 1:
  for i in range(b-1):
    x = re[i]
    cnt += x

if re[b] >= 1:
  y = be[b]
  cnt += y
  
print(cnt)

Submission status: Wrong Answer

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

import math

n = int(input())
o = math.floor(math.log(n, 10))
ans = 0

for i in range(o):
    if i % 2 == 0:
        ans += 10 ** (i + 1) - 10 ** i + 1
    else:
        continue

if o % 2 == 0:
    ans += n - (10 ** o) + 1

ans -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from operator import itemgetter
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
keta = len(str(n))
rs = 0
if keta % 2 == 1:
    rs += n % (10 ** (keta - 1)) + 1
li = [0, 9, 0, 900, 0, 90000]
keta -= 1
while keta > 0:
    rs += li[keta]
    keta -= 1
print(rs)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import io
import sys

MOD = 10 ** 9 + 7


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
136
'''


def MAIN():
  T_IN()
  A()


def A():
  n = IN_I()

  t = 0
  if n > 9:
    t += 9

  if n > 999:
    t += 900

  if n > 99999:
    t += 90000

  if n <= 9:
    t += n
  elif 99 < n <= 999:
    t += n - 99
  elif 9999 < n <= 99999:
    t += n - 9999

  print(t)
  return None


def B():
  return None


def C():
  return None


MAIN()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

n = int(input())
d = len(str(n))
count = 0
ans = n

for i in range(d):
    print(i, i%2, min(ans, 9*(10**i)))
    if i%2 == 0: count += min(ans, 9*(10**i))
    ans -= 9*(10**i)

print(count)

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

n = int(input())
d = len(str(n))
count = 0
ans = n

for i in range(d):
    if i%2 == 1: continue
    count += min(ans, 9*(10**i))
    ans -= 9*(10**i)

print(count)

Submission status: Wrong Answer

Solution code:
import math as m

def has_odd_digits(i):
  if i > 10**5:
    raise Exception("?")
  if 0 <= i and i <= 9:
    return True
  elif 100 <= i and i <= 999:
    return True
  elif 10000 <= i and i <= 99999:
    return True
  return False

n = int(raw_input())
# 1 digit = 10
# 3 digit = 9*10*10 = 900
# 5 digit = 9*10*10*10*10 = 90000
x = m.log(n, 10)

p = 0
for i in xrange(n):
  if has_odd_digits(i):
    p += 1
print p

Submission status: Wrong Answer

Solution code:
n=input()
ans=0
nl=len(n)
if nl==1:
    print(n)
if nl>=1:
    ans+=9
if nl==3:
    ans+=int(n)-99
    print(ans)
    exit()
if nl>=3:
    ans+=900
if nl==5:
    ans+=int(n)-9999
if nl==6:
    ans+=90000
print(ans)

Submission status: Wrong Answer

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

print(N)

count = 0

if N == 100000 :
  count = 90909
if N >= 10000 and N <= 99999 :
  count = N - 10000 + 1 + 900 + 9
if N >= 1000 and N <= 9999 :
  count = 909
if N >= 100 and N <= 999 :
  count = N - 100 + 1 + 9
if N >= 10 and N <= 99 :
  count = 9
if N >= 1 and N <= 9 :
  count = N

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
if N > 99999:
    ans += 90909
elif 99999 >= N > 10000:  # Nが5桁、または6桁の時
    tmp = (N % 100000)  # 5桁の時、N = tmp
    print("Nが6桁、または5桁: tmp = ", tmp)
    ans += tmp - 10000
    ans += 909
elif 9999 >= N > 100:  # Nは4桁、または3桁
    tmp = (N % 1000)
    print("Nが4桁、または3桁: tmp = ", tmp)
    ans += tmp - 100
    ans += 9
elif N == 1000:
    ans += 909
elif 99 >= N >= 1:
    print("Nが2桁、または1桁: N = ", N)
    ans += (N % 10)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
import math
count = 0
for i in range(1,N+1):
    if int(math.log10(i)) %2 ==0:
        count+=1
count

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = 1000
import math
count = 0
for i in range(1,N+1):
    if int(math.log10(i)) %2 ==0:
        print(i)
count

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

ANS=[0]*5
flag=0

if N<100000:
    if N<10000:
        if N<1000:
            if N<100:
                if N<10:
                    ANS[0]=int(N/10)
                    flag=flag+1
                ANS[1]=9
                flag=flag+1
            ANS[2]=9+N-100+1
            flag=flag+1
        ANS[3]=909
        flag=flag+1
    ANS[4]=9+900+N-10000+1
    flag=flag+1
elif N==100000:
    print(90909)

if flag==5:
    print(ANS[0])
if flag==4:
    print(ANS[1])
if flag==3:
    print(ANS[2])
if flag==2:
    print(ANS[3])
if flag==1:
    print(ANS[4])

Submission status: Wrong Answer

Solution code:
N=int(input())

ANS=[0]*5
flag=0

if N<=100000:
    if N<10000:
        if N<1000:
            if N<100:
                if N<10:
                    ANS[0]=int(N/10)
                    flag=flag+1
                ANS[1]=9
                flag=flag+1
            ANS[2]=9+N-100+1
            flag=flag+1
        ANS[3]=909
        flag=flag+1
    ANS[4]=9+900+N-10000+1
    flag=flag+1
elif N==100000:
    print(90909)

if flag==5:
    print(ANS[0])
if flag==4:
    print(ANS[1])
if flag==3:
    print(ANS[2])
if flag==2:
    print(ANS[3])
if flag==1:
    print(ANS[4])

Submission status: Wrong Answer

Solution code:
N=int(input())

ANS=[0]*5
flag=0

if N<=100000:
    if N<10000:
        if N<1000:
            if N<100:
                if N<10:
                    ANS[0]=int(N/10)
                    flag=flag+1
                ANS[1]=9
                flag=flag+1
            ANS[2]=9+N-100+1
            flag=flag+1
        ANS[3]=909
        flag=flag+1
    ANS[4]=9+900+N-10000
    flag=flag+1

if flag==5:
    print(ANS[0])
if flag==4:
    print(ANS[1])
if flag==3:
    print(ANS[2])
if flag==2:
    print(ANS[3])
if flag==1:
    print(ANS[4])

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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

if n < 10:
  m = n
elif n < 100:
  m = 9
elif n < 1000:
  m = n - 90
elif n < 10000:
  m = 909
else:
  m = n - 9090
print(m)

Submission status: Wrong Answer

Solution code:

str = "37"
# str = input()
num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int("9"*(numbers))
while numbers > 0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)

Submission status: Wrong Answer

Solution code:
str = input()
num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int(a)
while numbers > 0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)

Submission status: Wrong Answer

Solution code:
import sys
 
a = int(input())
upper_limit = 0
if(a<10):
  print(a-0)
elif(a>=10 and a<100):
  print(9)
  upper_limit = 9
elif(a>=100 and a<1000):
  print(a-99+9)
  upper_limit = 900
elif(a>=10000 and a<100000):
  print(900)
elif(a>=10000 and a<100000):
  print(a-9999+9+900)
else:
  print(9+900+90000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n=int(input())

x = 0

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

    
print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())

x = 0

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

    
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if n < 10:
    k = n

if 10 <= n < 100:
    k = 9

if 100 <= n < 1000:
    k = n -90

if 1000 <= n < 10000:
    k = 900

if 10000 <= n < 100000:
    k = n - 9090

if n == 100000:
    k = n - 9091

print(k)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 10**5:
  res = 90909
elif 10**4 <= N < 10**5:
  res = N-9089
elif 10**3 <= N < 10**4:
  res = 910
elif 10**2 <= N < 10**3:
  res = N-90
elif 10 <= N < 10**2:
  res = 9
elif 1 <= N < 10:
  res = N
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 10**5:
  res = 90909
elif 10**4 <= N < 10**5:
  res = N-9089
elif 10**3 <= N < 10**4:
  res = 910
elif 10**2 <= N < 10**3:
  res = N-90
elif 1 <= N < 10**2:
  res = N
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 10**5:
  print(90909)
elif 10**4 <= N < 10**5:
  print(N-9089)
elif 10**3 < N < 10**4:
  print(910)
elif 10**2 < N < 10**3:
  print(N-90)
elif 1 <= N < 10**2:
  print(N)

Submission status: Wrong Answer

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(N-90)
elif 1000 <= N and N < 10000:
    print(909)
elif 10000 <= N and N < 1000:
    print(N-9090)
elif 100000 == N:
    print(90909)

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

Submission status: Wrong Answer

Solution code:
# 偶数桁がある場合、それより前の値は N の値に関係なく一定
# 2桁なら 9、 4桁なら 909、 なので、偶数桁の数だけ '09'をつなげて int にする
# N の桁数が奇数の時は最大の桁数の奇数桁の数を足す(N = 12500 なら 12500 - 10000 + 1)    

N = input()

digit = len(N)
ans = 0

if digit != 1:
  ans = '09' * (digit // 2)
  ans = int(ans)

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

  print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

if x <10:
  print(x)
elif x<99:
  print(9)
elif x<999:
  print(9+(x-99))
elif x<9999:
  print(909)
elif x<99999:
  print(909+(x-9999))
elif x ==100000:
  print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = len(list(str(N)))
if n >= 5:
  ans = 90909
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + (N % 100 + 1)
elif n >= 2:
  ans = 9
else:
  ans = N
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = len(list(str(N)))
if n >= 5:
  ans = 90909
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + (N % 1000 - 99)
elif n >= 2:
  ans = 9
else:
  ans = N % 10
print(ans)

Submission status: Wrong Answer

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

if n <= 9:
	ct = n
elif n <= 99:
	ct = 9
elif n <= 999:
	ct = n - 90 + 9
elif n <= 9999:
	ct = 909
elif n <= 99999:
	ct = n - 9000 + 900 - 90 + 9
elif n == 100000:
	ct = 90909
	
print(ct)

Submission status: Wrong Answer

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

if n <= 99:
	ct = 9
elif n <= 999:
	ct = n - 90
elif n <= 9999:
	ct = 909
elif n <= 99999:
	ct = n - 9000+909
elif n == 100000:
	ct = 90909
	
print(ct)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=len(str(a))

ans=0

if b%2==0:
    for i in range(int(b/2)):
        c=1+i*2
        ans+=(10**c-1)

else:
    ans+=(a-(10**(b-1))+1)
    for i in range(int((b-1)/2)):
        e=1+i*2
        ans+=(10**e-1)

print(int(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())
sum = 0
for i in range(1,n+1):
    length = 1
    num = i
    while num >= 10:
        num = num/10
        length += 1
    if (length % 2) == 1:
        print('i:'+str(i)+ ' length' + str(length))
        sum += 1
print(sum)

Submission status: Wrong Answer

Solution code:
n=int(input())
sum = 0
for i in range(n):
    length = 1
    num = i
    while num >= 10:
        num = num/10
        length += 1
    if (length % 2) == 1:
        sum += 1
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(5):
    if 10**i <= n <= 10**(i+1):
        keta = i+1
        break

if keta ==1:
    count = n
elif keta == 2:
    count = 9
elif keta == 3:
    count = 9 + (n - 99)
elif keta == 4:
    count = 9 + 900
else:
    count = 9 + 900 + (n - 9999)

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(5):
    if 10**i <= n <= 10**(i+1):
        keta = i+1
        break

if keta ==1:
    count = n
elif keta == 2:
    count = 9
elif keta == 3:
    count = 9 + (n - 99)
elif keta == 4:
    count = 9 + 900
else:
    count = 9 + 900 + (n - 90000)

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(5):
    if 10**i <= n <= 10**(i+1):
        keta = i+1
        break

if keta ==1:
    count = n
elif keta == 2:
    count = 9
elif keta == 3:
    count = 9 + (n - 100)
elif keta == 4:
    count = 9 + 899
else:
    count = 9 + 899 + (n - 89999)

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(5):
    if 10**i <= n <= 10**(i+1):
        keta = i+1
        break

if keta ==1 or keta == 2:
    count = n
elif keta == 3:
    count = 9 + (n - 100)
elif keta == 4:
    count = 9 + 899
else:
    count = 9 + 899 + (n - 89999)

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

result = 0
if N < 10:
  result = N
if N < 100:
  result = 9
elif N < 1000:
  result = 9 + (N - 100 + 1)
elif N < 10000:
  result = 9 + 900
elif N < 100000:
  result = 9 + 900 + (N - 10000 + 1)
else:
  result = 9 + 900 + 90000
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
h=len(str(N))
if h%2==1:
  a=N-(10**(h-1))+1
  a=a+((100**((h-1)/2))-1)//11
  print(a)
elif h%2==0:
  a=((100**(h/2))-1)//11
  print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())
h=len(str(N))
if h%2==1:
  a=N-(10**(h-1))+1
  a=a+((100**((h-1)/2))-1)/11
  print(a)
elif h%2==0:
  a=((100**(h/2))-1)/11
  print(a)

Submission status: Wrong Answer

Solution code:
num=input("N:")
count=0


for i in range(1,int(num)+1,1):
    if len(str(i))%2==1:
        count+=1
        
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
n = int(input())
if n == 100000:
  print(90909)
if n / 10000 >= 1:
  print(9 + 900 + n - 10000 + 1)
elif n / 1000 >= 1:
  print(909)
elif n / 100 >= 1:
  print(9 + n - 100 + 1)
elif n / 10 >= 1:
  print(9)
elif n < 10:
  print(n)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
n = int(input())
if n / 10000 >= 1:
  print(9 + 900 + n - 10000 + 1)
elif n / 100 >= 1:
  print(9 + n - 100 + 1)
elif n / 10 >= 1:
  print(9)
elif n < 10:
  print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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