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: Accepted

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

Submission status: Accepted

Solution code:
s = input()
sd = int(s)
sl = len(s)
ans = 0
if sl == 1:
    ans += sd
if sl == 2:
    ans += 9
if sl == 3:
    ans += sd - 99 + 9
if sl == 4:
    ans += 900 + 9
if sl == 5:
    ans += sd - 9999 + 900 + 9
if sl == 6:
    ans += 90000 + 900 + 9


print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

    while i >= 1:
        cnt += 1
        i /= 10

    if cnt % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

while i<=n:
    if i==10:
        i=100
        continue
    if i==1000:
        i=10000
        continue
    if i==100000:
        break
    ans += 1
    i += 1
print(ans)

Submission status: Accepted

Solution code:
n = input()
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
if n < 10:
    ans = n
else:
    ans += 9
if n >= 100 and n <= 999:
    ans += n - 99
if n >= 1000:
    ans += 900
if n >= 10000 and n <= 99999:
    ans += n - 9999
if n == 100000:
    ans += n - 10000
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
a=0
for i in range(N):
  a+=len(str(i+1))&1
print(a)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = input()

if len(n) == 1:
    print(n)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print(int(n)-90)
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    print(int(n)+910-10000)
elif len(n) == 6:
    print(90909)

Submission status: Accepted

Solution code:
N_str = input()

M = len(N_str)

result = 0

if M % 2 == 1:
    result += int(N_str) - (10**(M-1) - 1)
    M -= 1
    
for i in range(0, M, 2):
    result += 9 * 10**i

print(result)

Submission status: Accepted

Solution code:
N=int(input())
Nlist=list(range(1,N+1))
Nlist_str=[str(N) for N in Nlist]

X=0
for i in range(N):
    if (len(Nlist_str[i]))%2!=0:
        X+=1

print(X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
sn=input()
i=len(sn)
if i%2==0:
	print([0,0,9,0,909,0,90909][i])
elif i==1:
	print(int(sn))
elif i==3:
	print(int(sn)-90)
else:
	print(int(sn)-9090)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
ans=0
for _ in range(n):
    if len(str(n))%2!=0:
        ans+=1
    n-=1
print(ans)

Submission status: Accepted

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

for i in range(1,N+1):
    num = str(i)

    if len(num) % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
l = list(input())
N = int("".join(l))
L = len(l)
if L == 1:
  t = N
elif L == 2:
  t = 9
elif L == 3:
  t = N - 90
elif L == 4:
  t = 909
elif L == 5:
  t = N - 9090
else:
  t = 90909
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

d = 1
ans = 0

while True:
    if d > n:
        break
    else:
        if d * 10 <= n:
            ans += d * 9
        else:
            ans += n - d + 1
    d *= 100
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
print(sum(len(str(s))%2==1 for s in range(1,n+1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
a_keta=len(str(a))
if a_keta==1:print(a)
if a_keta==2:print(9)
if a_keta==3:print(9+a-100+1)
if a_keta==4:print(909)
if a_keta==5:print(909+a-10000+1)
if a_keta==6:print(90909)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0
for i in range(1, n+1):
    if i < 10 or (i > 99 and i < 1000) or (i > 9999 and i < 100000):
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

# 1 <= N <= 10**5 = 100,000

if N <= 99:
  print(min(N, 9))
elif N <= 9999:
  ans = 9 + (min(N, 999) - 99)
  print(ans)
else:
  ans = 9 + 900 + (min(N, 99999) - 9999)
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#136
n = int(input())
res = 0

for i in range(1,len(str(n))+1):
    if i % 2 == 1:
        if n >= 10 ** i:
            res += (10 ** i) - 10 ** (i - 1)
        else:
            res += n - (10 ** (i -1) - 1)
print(res)

Submission status: Accepted

Solution code:
n=int(input())

def ketacul(x):
    keta=1
    while(x/10>=1):
        x=x/10
        keta+=1
    return keta
count=0
for i in range(1,n+1):
    a=ketacul(i)
    if a%2==1:
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#136 b
def ketasu(x):
    cnt=0
    while x>0:
        x=int(x/10)
        cnt+=1
    return cnt
n=int(input())
ans=0
for i in range(1,n+1):
    if ketasu(i)%2==1:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import itertools


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


N = int(input())
# S = input()
# A, B = map(int, input().split())
# A = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N))

Submission status: Accepted

Solution code:
# import itertools
import math


def get_data_size(data):
    """桁数を求める

    Args:
        data (int): 数値

    Returns:
        [int]: 桁数
    """
    return int(math.log10(data) + 1)


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


N = int(input())
# S = input()
# A, B = map(int, input().split())
# A = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N))

Submission status: Accepted

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: Accepted

Solution code:
N = str(input())
def main1(N):
    count = 0
    for i in range(1, len(N) + 1):
        if i % 2 != 0 :
            if i != len(N):
                count += 9 * 10**(i-1)
            else:
                if len(N) != 1:
                    count += ((int(N[0]) - 1) * 10**(i-1)
                        + int(N[1:len(N)]) + 1)
                else:
                    count += int(N[0])
    print(count)

main1(N)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0
l = [i for i in range(1, n+1) if len(str(i)) % 2 == 1]
print(len(l))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
print(sum(map(lambda x : len(str(x)) & 1, range(1, n+1))))

Submission status: Accepted

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

for i in range(1, n + 1):
  l = len(str(i))
  res += l & 1

print(res)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int( input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
N=int(n)
num=0

for i in range(1,len(n)+1):
    if i!=len(n):
        if i%2!=0:
            num+=9*10**(i-1)
    else:
        if i%2!=0:
            num+=(int(n[0])-1)*10**(i-1)+(N-int(n[0])*10**(i-1))+1
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())
iL = len(n)
count = 0
for i in range(1,iL+1):
  
  if i != iL and i % 2 != 0:
    count += (100**(i//2))*9
  elif i == iL and i% 2 != 0:
    count += int(n) - 100**(i//2)+1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1,N+1):
    if 10000 <= i <= 99999 or 100 <= i <= 999 or 1 <= i <= 9: 
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum(len(str(i+1))%2 for i in range(int(input()))))

Submission status: Accepted

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

Submission status: Accepted

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

    ans = 0

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

    print(ans)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
i = 0
u = int(0)

for i in range(N):
    I = str(i+1)
    L=int(len(I))


    if L % 2 == 1:
        u = u + 1

print(u)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
p = 0
i = 1

n = int(input())

while i <= n:
	if len(str(i))%2 == 1:
		p += 1
	i += 1
      
print(p)

Submission status: Accepted

Solution code:
N = int(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
N = input()
length = len(N)
N = int(N)
answer = 0

for i in range(1, length, 2):
    answer += 10 ** i - 10 ** (i - 1)

if length % 2 == 1:
    answer += N - 10 ** (length - 1) + 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

d = 0
for i in range(N + 1):
    d += 1 if math.ceil(math.log10(i + 1)) % 2 == 1 else 0

print(d)

Submission status: Accepted

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: Accepted

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

print(count)

Submission status: Accepted

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

if __name__ =="__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

if n == 100000:
  ans = 90000+900+9
elif n >= 10000:
  ans = n-9999+900+9
elif n >= 1000:
  ans = 900+9
elif n >= 100:
  ans = n-99 + 9
elif n >= 10:
  ans = 9
else:
  ans = n

print(ans)

Submission status: Accepted

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

if N >= 10000:
    ans += min(N, 99999) - 9999

if N >= 100:
    ans += min(N, 999) - 99

if N >= 1:
    ans += min(N, 9)

print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

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

Submission status: Accepted

Solution code:
n = int(input())

l = range(1, n+1)
s = map(str, l)
ans = map(lambda x:len(x), s)

print(sum(x%2!=0 for x in ans))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = int(readline())
print(sum(len(str(x)) % 2 == 1 for x in range(1, S + 1)))

Submission status: Accepted

Solution code:
N = int(input())

count=0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
ans = 0
while(True) :
    if N <= 9 :
        ans += N
        break
    else :
        ans += 9
    if N >= 100 :
        if N < 1000 :
            ans += N - 100 + 1
            break
        else :
            ans += 900
    else :
        break
    if N >= 10000 :
        if N < 100000 :
            ans += N - 10000 + 1
            break
        else :
            ans += 90000
            break
    else :
        break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())

con = 0

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

Submission status: Accepted

Solution code:
N = int(input())
NS = str(N)
D = len(NS)


if D % 2 == 0:
  if D == 2:
    print(9)
  elif D == 4:
    print(909)
  else:
    print(90909)
else:
  if N == (10 ** (D - 1)):
    if D == 3:
      print(10)
    elif D == 5:
      print(910)
    else:
      print(1)
  else:
    if D == 3:
      print(N - 90)
    elif D == 5:
      print(N - 9090)
    else:
      print(N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

if len(N) == 1:print(N)
elif len(N) == 2:print(9)
elif len(N) == 3:print(int(N) - 90)
elif len(N) == 4:print(909)
elif len(N) == 5:print(int(N) - 9090)
elif len(N) == 6:print(90909)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
keta=len(S)
N=int(S)
dp = [0,9,0,900,0,90000,0]
ans = 0
for i in range(keta+1):
  if i==keta and i%2:
    ans += N-10**(i-1)+1
  else:
    ans += dp[i]
    
print(ans)

Submission status: Accepted

Solution code:
n = input()

sm = 0
if int(n) <= 9:
    sm = n
elif len(n)%2 != 0:
    for i in range(0, len(n)-1, 2):
        sm += 9*10**i
    sm += int(n)-10**int(len(n)-1)+1
else:
    for i in range(0, len(n)-1, 2):
        sm += 9*10**i
        
print(sm)

Submission status: Accepted

Solution code:
n = int(input())

ans = min(9, n)
if n >= 100:
    ans += min(900, n - 99)
    if n >= 10 ** 4:
        ans += min(90000, n - 9999)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = str(N)
K = len(S)

if K == 6:
  print(9+900+90000)
elif K == 5:
  print(9+900 + (N-10000+1))
elif K == 4:
  print(9+900)
elif K == 3:
  print(9 + (N-100+1))
elif K == 2:
  print(9)
else:
  print(N)

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

Submission status: Accepted

Solution code:
N = int(input())

digits = 0
tmp = N
while tmp != 0:
    tmp = tmp // 10
    digits += 1

if digits == 1:
    print(N)
if digits == 2:
    print(9)
if digits == 3:
    print(N-90)
if digits == 4:
    print(N-(90+(N-999)))
if digits == 5:
    print(N-90-9000)
if digits == 6:
    print(N-90-9000-1)

Submission status: Accepted

Solution code:
i=int(input())
if(0<i and i<10):
    cnt1=i
    print(cnt1)
if(10<=i and i<100):
    print(9)
if(100<=i and i<1000):
    cnt2=i-99+9
    print(cnt2)
if(1000<=i and i<10000):
    print(909)
if(10000<=i and i<100000):
    cnt3=i-9999+999-99+9
    print(cnt3)
if(i==100000):
    print(90909)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
N_len = len(str(N))
ans = 0

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

for i in range(N_len):
    if (i % 2) != 0:
        ans += 10**i - 10**(i-1)

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
count=0
b=n
while b:
    b//=10
    if b:
        count+=1
if count==0:
    print(n)
elif count==1:
    print(9)
elif count==2:
    print(n-100+1+9)
elif count==3:
    print(900+9)
elif count==4:
    print(n-10000+1+909)
elif count==5:
    print(90909)

Submission status: Accepted

Solution code:
def main():

	
	n = int(input())
	ans = 0
	if n < 100 and n >=10:
		print(9)
	elif n < 10:
		print(n)
	else:
		for i in range(100,n+1):
			if len(str(i)) % 2 != 0:
				ans += 1
		print(ans+9)

 
if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
s=input()
s_int=int(s)
ans=0

for i in range(1,len(s)):
    if i%2==1:
        ans+=9*(10**(i-1))
if len(s)%2==0:
    print(ans)
else:
    ans+=s_int-10**(len(s)-1)+1
    print(ans)

Submission status: Accepted

Solution code:
n=int(input().strip())
tmp=n
n_dig=0
while tmp>0:
    n_dig+=1
    tmp//=10
c=0
for i in range(n_dig//2):
    c+=9*100**i
mod=n_dig%2
if mod:
    c+=n-10**(n_dig-1)+1
print(c)

Submission status: Accepted

Solution code:
# Uneven Numbers

# input
N = int(input())

# solve
res = 0

for i in range(1, N+1):
    res += 1 * (len(str(i)) % 2 != 0)

# output
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
i = 1
ans = 0
while i <= n:
    tmp = i
    cnt = 0
    while 0 < tmp:
        tmp //= 10
        cnt += 1
    if cnt % 2 == 1:
        ans += 1
    i += 1
print(ans)

Submission status: Accepted

Solution code:
print(sum([len(str(x+1))%2 for x in range(int(input()))]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int):
    ans = 0
    for i in range(N+1):
        if len(str(i))%2 == 1:
            ans += 1

    print(ans-1)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
N = input()
Len = len(N)
count=0
if(Len%2 == 0):
    for i in range(Len):
        if(i%2==0):
            count = count + 9 * 10**i
else:
    for i in range(Len-1):
        if(i%2==0):
            count = count + 9 * 10**i
    count = count + int(N)-10**(Len-1) +1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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