Problem:


Score : 200 points

Problem Statement

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

Constraints

1 \leq N \leq 10^5

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

11

Sample Output 1

9

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

Sample Input 2

136

Sample Output 2

46

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

Sample Input 3

100000

Sample Output 3

90909



Sample input:
11


Sample output:
9

Submission status: Wrong Answer

Solution code:
N = int(input())

result = 0
if len(str(N)) % 2 == 0:
    loop = ((len(str(N)) - 1) -1) //2 + 1
    print(loop)
    for i in range(loop):
        result += 9 * pow(10,2*i)
else:
    for i in range(len(str(N)) - 2):
        result += 9 * pow(10,i)
    result += N - pow(10,len(str(N)) - 1) + 1

print(result)

Submission status: Wrong Answer

Solution code:
# B
def keta(n):
    count = 0
    while n != 0:
        n = n//10
        count+=1
    return count

n  = int(input())
k = keta(n)
if k == 1:
    print(k)
elif k == 2:
    print(9)
elif k == 3:
    print(9 + n-99)
elif k == 4:
    print(909)
elif k == 5:
    print(909 + n-9999)
elif k == 6:
    print(90909)

Submission status: Wrong Answer

Solution code:
def f(n):
	keta = 0
	while n:
		keta += 1
		n //= 10
	return keta % 2 == 1

N = int(input())
ans = 0
for i in range(N):
	if f(i):
		ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()

odd_list = [i for i in range(len(N)) if i % 2 == 1]
count = 0
for i in range(len(odd_list)):
    count += 10**int(odd_list[i])-10**(len(N)-2)
if len(N) % 2 == 1:
    count += int(N)+1-10**(len(N)-1)

print(count)

Submission status: Wrong Answer

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

if 1 <= n and n < 99:
    ans = min(n, 9)
elif 100 <= n and n < 9999:
    ans = min(n-90, 909)
else:
    ans = min(n-9090, 90909)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

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

Submission status: Wrong Answer

Solution code:
print(len(list(filter(lambda n: n % 2 == 1, range(1, int(input()) + 1)))))

Submission status: Wrong Answer

Solution code:

n = input()
num = int(n)
ans = 0

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

print(ans)

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

Solution code:
def main():
    N = input()
    cnt = 9
    len_n = len(N)
    if len_n == 1:
        cnt = int(N)
    elif len_n % 2 == 0:
        len_n -= 1
    else:
        cnt += int(N[1:]) + 1
        len_n -= 2
    while len_n > 1:
        cnt += 10 ** (len_n - 1) * 9
        len_n -= 2
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
sd = int(s)
sl = len(s)
ans = 0
if sl <= 2:
    ans += sd
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: Wrong Answer

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

Submission status: Wrong Answer

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)-990)
elif len(n) == 6:
    print(90909)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n =int(input())

#nの桁数は？
for i in range(6):
    j = 5-i
    if n // (10**j) != 0:
        if 5-i == 5:#100,000
            print(99999-9999+999-99+9)
            exit()
        elif 5-i == 4:#10,000
            print(n-9999+999-99+9)
            exit()
        elif 5-i == 3:#1,000
            print(999-99+9)
            exit()
        elif 5-i == 2:#100
            print(n-99+9)
            exit()
        elif 5-i == 1:
            print(9)
            exit()
        elif 5-i == 0:
            print(1)

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 - 100 + 1)
elif n < 10000:
    print(909)
else:
    print(909 + n - 10000)

Submission status: Wrong Answer

Solution code:
N = str(input())

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

if len(N) != 1 and len(N) % 2 != 0:
    hasuu = int(N[1:len(N)]) + 1
elif len(N) % 2 != 0:
    hasuu = int(N)
else:
    hasuu = 0

print(str(count + hasuu))

Submission status: Wrong Answer

Solution code:
a = int(input())
count = 0
for i in range(1,a):
  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(1,N+1):
  if i % 2 == 1:
    count+=1
    
print(count)

Submission status: Wrong Answer

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])*10**(i-1)
print(num)

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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)

print(u)

Submission status: Wrong Answer

Solution code:
x=input()
y=int(x)
z=len(x)
p=z-1
count = 0

if z%2==0 :
  count = z/2*9
  print(int(count))
else :
  count = int(z/2)*9
  count = count + int(y-10**p) +1
  print(count)

Submission status: Wrong Answer

Solution code:
x=input()
y=int(x)
z=len(x)
p=z-1
count = 0

if z%2==0 :
  count = z/2*9
  print(count)
else :
  count = int(z/2)*9
  count = count + (y-10**p) +1
  print(count)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = input()

l = len(n)
if l % 2 == 0:
  l -= 1

x = 0

for i in range(1,len(n)+1,2):
  if i != l:
    x += 10 ** i - 1
  else:
    x += int(n) - 10 ** ( i - 1 ) + 1

print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())

ok = 0
for i in range(6):
   m = n / (10 ** i)
   if (m < 1):
      break

   if (i % 2 == 0):
      if (m / 10 >= 1):
         ok += 9 * (10 ** i)
      else:
         ok += n % (10 ** (i))
         break

print(ok)

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(ans)

Submission status: Wrong Answer

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

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
print(ans)

Submission status: Wrong Answer

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 :
        ans += N - 10000 + 1
        break
    else :
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
for i in range(0, len(str(N)), 2):
  if N >= 10**(i+1):
    count += 9 * 10**i
  else:
    count += N % 10**i + 1

print(count)

Submission status: Wrong Answer

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:
    if D == 3:
      print(N - 90)
    elif D == 5:
      print(N - 9090)
    else:
      print(N)

Submission status: Wrong Answer

Solution code:
N = int(input()) - 1
NS = str(N)

if len(NS) == 2:
  print(9)
elif len(NS) == 4:
  print(909)
elif N == 99999:
  print(90909)
elif len(NS) == 5:
  print(N - 9000 + 1)
elif len(NS) == 3:
  print(N - 90 + 1)
else:
  print(N)

Submission status: Wrong Answer

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

if len(NS) == 2:
  print(9)
elif len(NS) == 4:
  print(909)
elif len(NS) == 6:
  print(90909)
elif len(NS) == 5:
  print(N - 9000)
elif len(NS) == 3:
  print(N - 90)
else:
  print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = 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
  
else:
    for i in range(1,l):
        if i %2 ==1:
            ans += 9*(10**(i-1))
        else:
            ans = ans
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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-1000+1+909)
elif count==5:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())
start = 0
power = 0

while start + 9*(10**power) < n:
    start += 9*(10**power)
    power += 2

print(start + max(0, n - 10**power + 1))

Submission status: Wrong Answer

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)
elif len(s)%2==1 and len(s)>=2:
    ans+=s_int-10**(len(s)-1)+1
    print(ans)

Submission status: Wrong Answer

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)
elif len(s)%2==1 and len(s)>=2:
    ans+=s_int-10**(len(s)-1)+1
    print(ans)
elif len(s)==1:
    print(s_int-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(0, len(str(N)), 2):
    min = 10**i
    max = 10**(i+1)-1
    if  max < N:
        count += (max-min+1)
    else:
        count += (N-min+1)
        print(count)
        break

Submission status: Wrong Answer

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

for i in range(0, len(str(N)), 2):
    min = 10**i
    max = 10**(i+1)-1
    if  max < N:
        count += (max-min+1)
        print(count)
    else:
        count += (N-min+1)
        print(count)
        break

Submission status: Wrong Answer

Solution code:
A, = [list(map(int, s.split())) for s in open(0)][0]

ans = 0
num_digits = len(str(A))
if num_digits == 1:
    ans += A 
else:
    if num_digits % 2 != 0:
        ans += A % 10 ** (num_digits - 1) + 1
    for i in range(3, num_digits, 2):
        ans += 10 ** i - 10 ** (i - 1) 
    ans += 9
print(int(ans))

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = int(input())
    ans = 0
    for i in range(5):
        isAdd = i % 2 == 0
        v = 10 ** (i+1) - 10 ** i
        if n <= v:
            if isAdd:
                ans += n - 10 ** i + 1
            break
        elif isAdd:
            ans += v
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
num = [i for i in range (1,int(input())+1)]
ans = 0

if num[-1]<=9 :
	ans = num[-1]
elif num[-1]<=99 :
	ans = 9
elif num[-1]<=999 :
	ans = 10+num[-1]%100
elif num[-1]<=9999:
	ans = 10+899
elif num[-1]<=99999 :
	ans = 910+num[-1]%10000
else :
	ans = 90909

print(ans)

Submission status: Wrong Answer

Solution code:
num = [i for i in range (1,int(input())+1)]
ans = 0

if num[-1]<=9 :
	ans = num[-1]
elif num[-1]<=99 :
	ans = 9
elif num[-1]<=999 :
	ans = 10+num[-1]%100
elif num[-1]<=9999:
	ans = 10+899
else :
	ans = 90909
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N < 10 :
	print(N)
elif N < 100 :
	print(9)
elif N < 1000 :
	print(9 + (N - 100 + 1))
elif N < 10000 :
	print(9 + 900)
elif N < 100000 :
	print(9 + 900 + (N - 1000 + 1))
else :
	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(9 + (N - 100 + 1))
elif N < 10000 :
	print(9 + 900)
elif N < 100000 :
	print(9 + 900 + (N - 1000 + 1))
else :
	print(9 + 900 + 9000)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
itr = 0
while(itr<N+1):
    if itr+1 < 10:
        ans += 1
    if 100 <= itr & itr < 1000:
        ans += 1
    if 10000 <= itr & itr <100000:
        ans+=1
    itr += 1
print(ans)

Submission status: Wrong Answer

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

def get_digit_num(x):
    ret = 0
    while x > 0:
        x /= 10
        ret += 1
    return ret

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#力技
N = int(input())
n = len(str(N)) # 桁数
if n == 1:
    print(N)
elif n == 2:
    print(9)
elif n == 3:
    print(N-90)
elif n == 4:
    print(909)
elif n == 5:
    print(N-90)
elif n == 6:
    print(90909)
else:
    None

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 10:
  X = N
elif N < 100:
  X = 9
elif N < 1000:
  X = 9 + N - 90
elif N < 10000:
  X = 909
else:
  X = 910

print(X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2==0:
    A=N/2
else:
    A=(N+1)/2
print(A)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
print(collections.Counter([len(str(i))%2 for i in range(n)])[1])

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
print(collections.Counter([len(str(i))%2 for i in range(1,n)])[1])

Submission status: Wrong Answer

Solution code:
n = int(input())
li = list(range(1, n +1, 2))
print(len(li))

Submission status: Wrong Answer

Solution code:
N = int(input())
number = 0
for i in range(10 ** 5):
    if len(str(i)) == 1 or len(str(i)) == 3 or len(str(i)) == 5:
        number += 1
print(number)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 == 0:
    print(N / 2)
else:
    print(N // 2 + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
digit = len(str(n))

# print(digit)

if digit == 6:
  ans = 90909
elif digit == 5:
  ans = (n - 10000) + 1 + 909
elif digit == 4:
  ans = 909
elif digit == 3:
  ans = (n - 100) + 1 + 9
elif digit == 2:
  ans = 9
elif digit == 1:
  ans = n + 1


print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(0, len(str(n)), 2):
  ans += min(n - 10 ** i, 10 ** (i + 1) - 10 ** i)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
    print(n)
elif n < 100:
    print(n)
elif n < 1000:
    print(n-90)
elif n < 10000:
    print(909)
elif n < 100000:
    print(n-9090)
elif n == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
import math
import heapq
from collections import Counter

#N,K=map(int, input[].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

if d == 1:
  print(n)
else:
  for i in range(1, d+1):
    if i % 2 == 0:
      continue

    if i == d:
      ans += n - (10**(i-1))
      break;

    if i == 1:
      ans += 9
    else:
      ans += (10**i) - (10**(i-1))

  print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

if d == 1:
  print(n)
else:
  for i in range(1, d+1):
    if i % 2 == 0:
      continue

    if i == d:
      ans += n - (10**(i-1))
      break;

    if i == 1:
      ans += 9
    else:
      ans += (10**i) - (10**(i-1))

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

if d == 1:
  print(n)
else:
  for i in range(1, d+1):
    if i % 2 == 0:
      continue

    if i == d:
      ans += n - 10**(i-1)
      break;

    m = 0 if (i == 1) else (10**(i-1))
    mm = 1 if (i == 1) else 0
    ans += (10**(i)) - mm - m

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

for i in range(1, d+1):
  if i % 2 == 0:
    continue
  
  if i == d:
    div = 10 if (i == 1) else 10**(i-1)
    add = 0 if (i == 1) else 1
    ans += (n % div) + add
    break;

  m = 0 if (i == 1) else (10**(i-1))
  mm = 1 if (i == 1) else 0
  ans += (10**(i)) - mm - m

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()

num = int(n)

s = 0

for i in range(1,num-1):
	#print(i)
	if len(str(i))%2 == 1 :
		s = s + 1

print(s)

Submission status: Wrong Answer

Solution code:
n = input()

num = int(n)

s = 0

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

print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(0,5,2):
  if n>=10**(i+1):
    cnt+=9*(10**i)
  else:
    cnt+=n-(10**i)+1
    break
    
print(cnt)

Submission status: Wrong Answer

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

for i in range(0,5,2):
  if n>=10**(i+1):
    cnt+=9*(10*(i))
  else:
    cnt+=n-10**(i)+1
    break
    
print(cnt)

Submission status: Wrong Answer

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

while n>=10**(k-1):
  if n>=10**k:
    cnt+=9*(10*(k-1))
    k+=2
  else:
    cnt+=n-10**(k-1)+1
    
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<10:
  print(n)
if 9<n<100:
  print(9)
if 99<n<1000:
  print(n-90)
if 999<n<10000:
  print(909)
if 9999<n:
  print(n-9090)

Submission status: Wrong Answer

Solution code:
N = int(input())
n=N
c=0
while n>0:
  n//=10
  c+=1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

c=0
while N>0:
  N//=10
  c+=1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

c=0
while N>0:
  N//=10
  c+=1

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

Submission status: Wrong Answer

Solution code:
def main(n):
    count = 0

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

    print(count)


if __name__ == "__main__":
    n = int(input())

    main(n)

Submission status: Wrong Answer

Solution code:
n = int(input())

ns = str(n)
nsl = len(ns)
cnt = 0
a = 0

if nsl % 2 == 1:
    b = int(ns[0])
    a = n - b * 10 ** (nsl - 1) + 1
    # print(a)

for i in range(nsl-1):
    if i % 2 == 0:
        if i == 0:
            cnt += 9
            # print(cnt)
        else:
            cnt += 10**i * 9
            # print(cnt)
    else:
        pass

ans = a + cnt

if nsl == 1:
    print(int(ns[-1]))
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
if len(n) == 1:
    print(int(n))
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print(int(n) - 90)
elif len(n) == 4:
    print(910)
else:
    print(int(n)- 9091)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

import math
ans = 0
for i in range(1, N+1, 1):
    order = int(math.log(i, 10))+1
    if order%2 == 1:
        ans += 1
    else:
        continue

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

import math
ans = 0
for i in range(1, N+1, 1):
    order = int(math.log(i, 10))
    if order%2 == 0:
        ans += 1
    else:
        continue

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  print(n)
  exit()
if n >= 10 and n < 100:
  print(9)

if n >= 100 and n < 1000:
  #print(9 + (int(str(n)[-2:])) + 1)
  print(9 + (n-100) + 1)
  exit()
if n >= 1000 and n < 10000:
  print(909 + (n-1000) + 1)
  exit()
if n >= 10000 and n < 100000:
  print(909 + (n-10000) + 1)
  exit
if n == 100000:
  print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n >= 100 and n < 1000:
  #print(9 + (int(str(n)[-2:])) + 1)
  print(9 + (n-100) + 1)
  exit()
if n >= 1000 and n < 10000:
  print(909 + (n-1000) + 1)
  exit()
if n >= 10000 and n < 100000:
  print(909 + (n-10000) + 1)
  exit
if n == 100000:
  print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = len(str(N))
 
if n==1:
	print(N)
else:
	M = [9,0]*(n//2)			#list[9,0]がn//2個繋がっている
	M.pop()						#pop()でlistの最後尾を削除
	M = map(str,M)				#joinの際には文字列しか使えないのでstrを使用
	M = int(''.join(M))			#join(M)=90909みたいな。それを数字化
	if n%2==0:
		print(M)
	else:
		M = M + N - 10**n + 1
		print(M)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n/10 < 10:
  print(n)
  exit()
elif n/10 < 1000:
  print(n-90)
  exit()
elif n==100000:
  print(90909)
else:
  print(n-9090)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

length = len(str(n))

if length == 1 or length == 2:
    res = n
elif length == 3:
    res = 9 + n - 99
elif length == 4:
    res = 909

elif length == 5:
    res = 9 + 900 + n - 9999
else:
    res = 90909

print(res)

Submission status: Wrong Answer

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

if N < 10:
    for i in range(1,N):
        count += 1

elif 10 <= N < 1000:
    for i in range(1,10):
        count += 1
    if N == 100:
        count += 1
    i = 100
    for i in range(100,N) :
        count += 1

elif 1000 <= N <= 100000:
    for i in range(1,10):
        count += 1
    i = 100
    for i in range(100, 1000):
        count += 1
    if N == 10000:
        count += 1
    i = 10000
    for i in range(10000, N):
        count += 1
print(count)

Submission status: Wrong Answer

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

if N < 10:
    for i in range(1,N):
        count += 1

elif N < 1000:
    for i in range(1,10):
        count += 1
    if N == 100:
        count += 1
    i = 100
    for i in range(100,N) :
        count += 1

elif N <= 100000:
    for i in range(1,10):
        count += 1
    i = 100
    for i in range(100, 1000):
        count += 1
    if N == 10000:
        count += 1
    i = 10000
    for i in range(10000, N):
        count += 1
print(count)

Submission status: Wrong Answer

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

if N < 10:
    for i in range(1,N):
        count += 1

elif N < 1000:
    for i in range(1,10):
        count += 1
    i = 100
    for i in range(100,N) :
        count += 1

elif N <= 100000:
    for i in range(1,10):
        count += 1
    i = 100
    for i in range(100, 1000):
        count += 1
    i = 10000
    for i in range(10000, N):
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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