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())
print(len([i for i in range(1,100000+1) if len(str(i))%2==1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N+1):
  if i % 2 != 0:
    ans += 1
    
print("%d"%(ans))

Submission status: Wrong Answer

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

for i in range(N+1):
  if i % 2 != 0:
    ans += 1
  else:
    ans += 0
print("%d"%(ans))

Submission status: Wrong Answer

Solution code:
N=list(input())
ans=0
for i in range(len(N)):
    if i==len(N)-1:
        if len(N)%2==1:
            s=""
            for num in N:
                s=s+num
            s=int(s)-10**i
            if len(N)>=2:
                s+=1
            ans+=s
    else:
        if i%2==0:
            ans+=10**(i+1)-10**i
print(ans)

Submission status: Wrong Answer

Solution code:
N=list(input())
ans=0
for i in range(len(N)):
    if i==len(N)-1:
        if len(N)%2==1:
            if len(N)>=2:del N[0]
            s=""
            for num in N:
                s=s+num
            s=int(s)
            if len(N)>=2:
                s+=1
            ans+=s
    else:
        if i%2==0:
            ans+=10**(i+1)-10**i
print(ans)

Submission status: Wrong Answer

Solution code:
S=list(input())
line=[]
A=["A","C","G","T"]
num_list=[]
flag=False
for s in S:
    if s in A:
        line.append(s)
        flag=True
    elif flag:
        num_list.append(len(line))
        line=[]
        flag=False
num_list.append(len(line))
if len(num_list)==0:print(0)
else:
    print(max(num_list))

Submission status: Wrong Answer

Solution code:
def uneven_numbers(n):

    ans = 0

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

    return ans

def main():
    n = int(input())
    print(uneven_numbers(n))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def uneven_numbers(n):

    ans = 0

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

    return ans

def main():
    n = int(input())
    print(uneven_numbers(n))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<10 :
    print(N)
elif 10<=N<100:
    print(9)
elif 100<=N<1000 :
    print(9+N-100+1)
elif 1000<=N<10000 :
    print(109)
elif 10000<=N<100000 :
    print(109+N-10000+1)
elif N==100000 :
    print(10109)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n=input()

k=len(n)
if k>=5:
    print(9+900+int(n)-10000)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100+1)
elif k==2:
    print(9)
else:
    print(int(n)+1)

Submission status: Wrong Answer

Solution code:

n=input()

k=len(n)
if k>=5:
    print(9+900+int(n)-10000)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100+1)
elif k==2:
    print(9)
else:
    print(int(n))

Submission status: Wrong Answer

Solution code:

n=input()

k=len(n)
if k>=5:
    print(9+900+int(n)-10000)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100)
elif k==2:
    print(9)
else:
    print(int(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n<=9:
    print(n)
elif 10<n and n<99 :
    print(9)
elif 100<n and n<999:
    print(9+n-100+1)
elif 1000<n and n<9999:
    print(909)
elif 10000<n and n<99999:
    print(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(9)
elif n < 1000:
    print(n-90)
elif n < 10000:
    print(909)
elif n < 100000:
    print(n-9000+909)
elif n < 1000000:
    print(90909)

Submission status: Wrong Answer

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

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

Submission status: Wrong Answer

Solution code:
from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
from collections import deque


#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
	
def count_str(m):
	tmp={}
	for i in range(10):
		if i in tmp:
			tmp[i]=1
		else:
			tmp[i]+=1
	return tmp

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

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

n=input1()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

if N%2==0:
    print(N//2)
    
else:
    import math
    print(math.ceil(N/2))

Submission status: Wrong Answer

Solution code:
N=int(input())
import math
if N%2==1:
    print(math.ceil(N/2))
else:
    print(N/2)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
ans = 0
while 10**(i+1) <= n:
  if i%2 == 0:
    ans += 10**i * 9
  i += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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
    else:
        continue
print(cnt)

Submission status: Wrong Answer

Solution code:
N = input()
digit = len(N)
num = int(N)

ans = 0
for i in range(1, digit, 2):
        ans += 9 * (10**i)

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
digit = len(N)
num = int(N)

ans = 0
for i in range(1, digit, 2):
        ans += 9 ** i

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
    print(n)
elif n < 10**2:
    print(9)
elif n < 10**3:
    print(10+(n%1000))
elif n < 10**4:
    print(909)
elif n < 10**5:
    print(910 + (n%10000))
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
    print(n)
elif n < 10**2:
    print(9)
elif n < 10**3:
    print(10+(n%1000))
elif n < 10**4:
    print(909)
elif n < 10**5:
    print(909 + 9*((n%10000)+1))
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
    print(n)
elif n < 10**2:
    print(9)
elif n < 10**3:
    print(10+(n%100))
elif n < 10**4:
    print(109)
elif n < 10**5:
    print(909 + 9*((n%10000)+1))
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
    print(n)
elif n < 10**2:
    print(9)
elif n < 10**3:
    print(10+(n%100))
elif n < 10**4:
    print(909)
elif n < 10**5:
    print(909 + 9*((n%10000)+1))
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
num=math.log(n,10)
if 0<=num<1:
  print(n)
elif 1<=num<2:
  print(n-90)
elif 2<=num<3:
  print(909)
elif 3<=num<4:
  print(909)
elif 4<=n<5:
  print(n-9090)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
num=math.log(n,10)
if 0<=num<1:
  print(n)
elif 1<=num<2:
  print(n-90)
elif 2<=num<3:
  print(909)
elif 3<=num<4:
  print(909)
else:
  print(n-9090)

Submission status: Wrong Answer

Solution code:
N = input()

if int(N) < 9:
  print(N)
  
elif len(N) == 1 or 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)-9000)
  
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0
i = 0
for i in range(0, 5, 2):
  m = 10 ** i
  print(m)
  if len(str(m)) > len(str(N)):
    break
  M = int("9" * (i + 1))
  print(M)
  
  if M > N:
    M = N
  print(M)
  
  cnt += M - m + 1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while N < 1:
    N /= 10
    ing_total += 1

total_count = 0

for i in range(1,ing_total+1,2):
    if ing_total % 2 == 0:
        total_count += 10**i - 10**(i-1)
    else:
        if i == ing_total:
            gap = n - (10**(i-1)-1)
            total_count += gap

        else:
            total_count += 10**i - 10**(i-1)

print(total_count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
a = len(n)
c = 0
for i in range(a - 1):
    if i % 2 == 0:
        c += 9 * 10 ** i
n = int(n)
if a % 2 and n != 0:
    c += n % 10 ** (a - 1) + 1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

def findodds(n):
  m = []
  for i in range(n):
    if len(str(i))%2!=0:
      m.append(i)
  return len(m)
print(findodds(n))

Submission status: Wrong Answer

Solution code:
N = int(input()) #文字列にするとlen()関数が使用可能
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:
import math

n = int(input())

m = int(math.ceil(math.log10(n)))
ans = 0

if m == 1:
    x = n % (10 ** 1)
    ans = x
elif m == 2:
    ans = 9
elif m == 3:
    x = n % (10 ** 3)
    ans = 9 + x - 100
elif m == 4:
    ans = 909
elif m == 5:
    if n == 100000:
        ans = 90909
    else:
        x = n % (10 ** 5)
        ans = 909 + x - 10000

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 10000:
    print(N - 100 + 1 + 9)
elif N < 100000:
    print(N - 10000 + 1 + 9 + 900)
elif N == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 10000:
    print(N - 90)
elif N < 100000:
    print(N - 10000 + 1010)
elif N == 100000:
    print(90909)

Submission status: Wrong Answer

Solution code:
def digit(n):
    """桁数
    """
    return len(list(map(int, str(n))))

N = int(input())
print(len([i for i in range(1, N+1) if digit(N)%2 == 1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0

for i in range(1,l+1):
    s = str(n)
    l = len(s)
    if i % 2 == 1:
        if n < 10:
            cnt += n
            break
        elif i == 1:
            cnt += 9
            
        else:
            cnt += 10**(i) - 10**(i-1)
            
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

s=input()
n=int(s)
a = len(s)

if n == 0:
    print(0)
elif a == 2:
    print(9)
elif a == 4:
    print(908)
elif a == 5:
    print(908 + (n-9999))
elif a == 1:
    print(n)
elif a == 6:
    print(90909)
else:
    print(9 + (n-99))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = len(str(n))
ans = 0
for i in range(l//2):
  i = i*2
  ans += 9*(10**i)
if l % 2 == 1:
  ans += n-10**(l-1)
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:
s = int(input())
ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
if n < 10:
  ans += n
else:
  ans += 9
  if n < 1000:
    ans += max(0, n-100)
  else:
    ans += 900
    if n < 100000:
      ans += max(0, n-10000)
    else:
      ans += 90000
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
if n < 10:
  ans += n
else:
  ans += 9
  if n < 1000:
    ans += max(0, n-999)
  else:
    ans += 900
    if n < 100000:
      ans += max(0, n-99999)
    else:
      ans += 90000
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
if n < 10:
  ans += n
else:
  ans += 9
  if n < 1000:
    ans += max(0, n-1000)
  else:
    ans += 900
    if n < 100000:
      ans += max(0, n-100000)
    else:
      ans += 90000
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
if n < 10:
  ans += n
else:
  ans += 9
  if n < 10000:
    ans += max(0, n-1000)
  else:
    ans += 900
    if n < 1000000:
      ans += max(0, n-100000)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

keta = int(math.log10(N)+1)
count = 0
for i in range(1,keta+1):
    if i % 2 == 1:
        if i == 1:
            count += 9
        elif i != keta:
            count += int('8'+'9'*(i-1)) + 1
        else:
            count += N - 10 ** (keta-1) + 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(N-100000*(N//100000)+1+N-1000*(N//1000)+1*N-10*(N//10)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
Ns = input()
N = int(Ns)
count = 0
for n in range(1, len(Ns), 2):
    count += 10 ** n - 1
if len(Ns) % 2 == 1:
    count += N - 10 ** (len(Ns) - 1) + 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
N = int(s)
odd_num = 0
for i in range(1,N+1):
    cnt = 1
    num = i
    while (num // 10) > 0:
        cnt += 1
        num = num//10
        print(num)
    if cnt % 2:
        odd_num += 1
print(odd_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a=0
cnt = 0
num = N
while 10<=num:
  num/=10;a+=1
if a%2==0:
  for i in range(10**a,N+1):
    cnt += 1
if 4 < a:
  print(cnt + 90909)
elif 2 < a:
  print(cnt + 909)
else:
  print(cnt + 9)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N <= 9:
  print(N)
elif 10 <= N <= 99:
  print(9)
elif 100 <= N <= 9999:
  print(N-90)
elif 10000 <= N <= 100000:
  print(N-9090)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

N = i_i()

l = len(str(N))

if l == 1 or l == 2:
    print(min(9, N))
elif l == 3 or l == 4:
    print(9 + N - 100 + 1)
else:
    print(9 + 900 + N - 10000)

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import os
import random
import re
import sys

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

    res = math.ceil(math.log(n, 10))
    s = 1 if math.log(n, 10) % 2 == 0 else 0

    for i in range(0, res, 2):
        k = 9*(10**i)
        if n > k:
            s = s + k
        else:
            s = s + n - 10**i + 1
    
    print(s)

Submission status: Wrong Answer

Solution code:
import math
import os
import random
import re
import sys

if __name__ == '__main__':
    n = int(input())
    res = math.ceil(math.log(n, 10))
    s = 0
    for i in range(0, res, 2):
        k = 9*(10**i)
        if n > k:
            s = s + k
        else:
            s = s + n - 10**i + 1
    print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
# 1-keta
if n<10:
  print(n)
elif n<1000:
  print(9+n-99)
elif n<100000:
  print(9+900+n-9999)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
n = input()
d = len(n)

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

print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
result = 0
if(0<N<=pow(10,5)):
    if len(str(N)) % 2 == 0:
        loop = ((len(str(N)) - 1) -1) //2 + 1
        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:
N = int(input())

result = 0
if(N > 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:
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:
N = int(input())

result = 0
if len(str(N)) % 2 == 0:
    loop = ((len(str(N)) - 1) -1) //2 + 1
    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:
N = int(input())

result = 0
if(N > 0):
    if len(str(N)) % 2 == 0:
        loop = ((len(str(N)) - 1) -1) //2 + 1
        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:
N = int(input())

result = 0
if(N > 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)
else:
    print(0)

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)