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: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    a,b,c = map(int, input().split())


    print(max(0,c-(a-b)))



if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(ibput())

r=0

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

Submission status: Runtime Error

Solution code:
N = input()

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

print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
l=[]

if N%2==0:
  for i in range(0,N+1,2):
    n=len(str(i))
    if n%2==1:
      l.append(n)
print(len(l))

Else:
  for j in range(1,N+1,2):
    n=len(str(i))
    if n%2==1:
      l.append(n)
print(len(l))

Submission status: Runtime Error

Solution code:
N = input()

cnt=0

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

Submission status: Runtime Error

Solution code:
n = int(input())

if n == 100000 :
    ans = 101009
elif 10000 <= n <= 99999 :
    ans = n - 10000 + 1 + 1000 + 9
elif 1000 <= n <= 9999 :
    ans = 1009
elif 100 <= n <= 999 :
    ans = n - 100 + 1 + 9
elif 10 <= n < 99 :
    ans = 9 
elif 1 <= n <= 9 :
    ans = n

print(ans)

Submission status: Runtime Error

Solution code:
import sys    #インタプリタや実行環境に関する情報を扱うためのライブラリ
import os     #フォルダやファイルを操作
import math

N=input()
count=0

for i in range(N):
    if i==0:
        continue
    if i<10:
        count +=1
    elif i<1000:
        count +=1
    elif i<100000:
        count+=1

print(count)
input()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

def fn(i):
    return (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999)


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

    x = list(range(n + 1)[1:])
    x = filter(fn, x)

    print(len(x))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

    x = list(range(n + 1)[1:])
    x = filter(lambda i: (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999), x)

    print(len(x))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

print(c)

Submission status: Runtime Error

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: Runtime Error

Solution code:
N = int(input())

res=0
for i in range(1, N+1):
    if(les(N)//2==1):
        rea+=1

print(res)

Submission status: Runtime Error

Solution code:
N = input()

res=0
for i in range(1, int(N)+1):
    if(les(N)//2==1):
        rea+=1

print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
h=list(map(int,input().split()))
ans="Yes"
for i in range(n-1):
    m=min(h[i+1:n])
    if h[i]-m>1:
        ans="No"
        break
print(ans)

Submission status: Runtime Error

Solution code:
n = input()
a = len(n)  # 桁数
if a % 2 == 0:  # 桁数が偶数
  ans = "90" * (a // 2)
  ans = int(ans[:-1])
else:
  ans = "90" * ((a - 1) // 2)
  ans = int(ans[:-1])
  ans += int(n) - 10 ** (a - 1) + 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90):
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
if c - (a - b) <= 0:
    print(0)
else:
    print(c - (a-b))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for i in range(1, 6, 2):
    if n < 10 ** (i - 1):
        break
    if 10 ** (i - 1) < n < 10 ** i:
        ans += n - int('9' * (i - 1))
    else:
        ans += 9 * 10 ** (i - 1)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC136B

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
H = [int(s) for s in input().split()]
for i in range(N - 1):
    if H[i + 1] - H[i] >= 0:
        H[i + 1] -= H[i + 1] != H[i]
    else:
        print('No')
        exit()

print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
cnt = 0
if len(n)%2==0:
    for i in range(len(n)//2):
        cnt += 100**i *9
        
else:
    cnt += int(n[1:]) + 1
    for i in range(len(n)//2):
        cnt += 100**i *9

print(cnt)

Submission status: Runtime Error

Solution code:
n=int(input())
if(n<10):
  x=n
elif(n<100):
  x=9
elif(n<1000):
  x=n-90
elif(n<10000):
  x=
elif(x<100000):
  x=n-90-9000

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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<=num<5:
  print(n-9090)
else:
  print(90909)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
	n = int(input())
	arr = list(map(int,input().split()))
	for i in range(len(arr)-1):
		if arr[i]-1>(arr[i-1]-1):
			# print(i)
			print("No")
			return
	print("Yes")
	return


main()

Submission status: Runtime Error

Solution code:
N=input()

if len(N)==1:
  print(N)
elif len(N)==2:
  print(9)
elif len(N)==3:
  print(9+N-99)
elif len(N)==4:
  print(909)
elif len(N)==5:
  print(909+N-9999)
elif len(N)==6:
  print(90909)

Submission status: Runtime Error

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

Submission status: Runtime Error

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=" ")

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
   int n;
   cin >> n;
   int num;
      if (n>=10000)
      { num = n -9090;
      cout << num << endl; }
      else if (n>=1000 && n<=9999)
      {num =909;
       cout << num << endl;}
      else if (n>=100 && n<=999){
      num = n-90;
      cout << num << endl;}
      else if (n>=10 && n<=99)
      {num = 9;
       cout << num << endl;}
      else if (n<=9){
         num = n;
      cout <<num << endl;}
}

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
#桁が奇数の時の個数
for i in range(1,n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import math

N = int(input())

i=0
#桁数
while 10**i<N:
  i=i+1
    


if i==1:
  num=N
elif i==2:
  num=9
elif i==3:
  num=9+N-99
elif i==4:  
  num=9+999-99
elif i==5:  
  num=9+900+N-10000

print(num)

Submission status: Runtime Error

Solution code:
Not found

Submission status: Runtime Error

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

Submission status: Runtime Error

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 + n - 9000)
else:
     print(90909)

Submission status: Runtime Error

Solution code:
a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900b+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))

Submission status: Runtime Error

Solution code:
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: Runtime Error

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: Runtime Error

Solution code:
n =int(input())
print(len([i for i in range(1, n+1) if int(log10(i)+1) % 2 != 0 and i <= n]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 0
for i in range(1, n+1):
  num = i
  digits=0
  while num:
    digits += 1
    num//=10
  if digit%2==1:
    ans+=1
    
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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:
        print(f'len_n {len_n} , cnt {cnt}')
        cnt += 10 ** (len_n - 1) * 9
        len_n -= 2
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
lg = len(N)
cnt = 0
if lg == 6:
    cnt = 90900
elif lg == 5:
    cnt += N - 10000 + 1
    cnt += 909
elif lg == 4:
    cnt = 909
elif lg == 3:
    cnt += N - 100 + 1
    cnt += 9
elif lg == 2:
    cnt = 9
else:
    cnt = N
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
lg = len(N)
cnt = 0
if lg == 6:
    cnt = 90909
elif lg == 5:
    cnt += N - 10000 + 1
    cnt += 909
elif lg == 4:
    cnt = 909
elif lg == 3:
    cnt += N - 100 + 1
    cnt += 9
elif lg == 2:
    cnt = 9
else:
    cnt = N
print(cnt)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = str(input())

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

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

print(str(count+hasuu))

Submission status: Runtime Error

Solution code:
a, b = input().split()
print(" ".join([b, a]))

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

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(i-10000+910)
else:
    print(90909)

Submission status: Runtime Error

Solution code:
n = int(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 += n - 10**(len(n)-1)+1
  print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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
elif :
	ans = 90909

print(ans)

Submission status: Runtime Error

Solution code:
#num = list(map(int,input().split()))
num = [i for i in range (1,int(input())+1)]
ans = 0
count = 0

for j in range(9,99):
	num[j]=0

for k in range(999,9999):
	num[k]=0

for l in range(len(num)-1):
	if not num[l]==0:
		count+=1

print(count)

Submission status: Runtime Error

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

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

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

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

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+90000  
print(A)

Submission status: Runtime Error

Solution code:
N, *p = map(int, open(0).read().split())

if sum(p[i] != i + 1 for i in range(N)) <= 2:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
def main():
    i = list(map(int, input().split()))
    n = i[0]

    if not (1 <= n and n <= 10**5):
        return

    num = 0
    for j in range(n):
        if(len(n) % 2 != 0):
            num += 1

    print(num)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
L=[9,0,900,0,90000]
ans=0
for i in range(len(n)-1):
    ans+=L[i]
if len(n)%2!=0:ans+=int(n)-int("9"*(len(n)-1))
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
def print_ans(N):
    """Test Case
    >>> print_ans(11)
    9
    >>> print_ans(136)
    46
    >>> print_ans(100000)
    90909
    """
    # counter = 0
    # for i in range(1, N + 1):
    #     if len(str(i)) % 2 != 0:
    #         counter +=1
    # print(counter)
    length = len(str(N))
    ans = []

    for i in reversed(range(length - 1)):
        if i % 2 == 0:
            ans.append("9")
        else:
            ans.append("0")
    answer = int("".join(ans))
    if length % 2 != 0:
        answer += N % (10 ** (length -1)) + 1
    print(answer)


if __name__ == '__main__':
    N = int(input().rstrip())
    print_ans(N)

Submission status: Runtime Error

Solution code:
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))
elif n == 100000:
    print(9 + 900 + 90000)

Submission status: Runtime Error

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:
    print(i)
    print((n % div) + 1)
    div = 10 if (i == 1) else 10**(i-1)
    ans += (n % div) + 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: Runtime Error

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: Runtime Error

Solution code:
n=int(input())
ans
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: Runtime Error

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

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

    print(count)


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

    main(n)

Submission status: Runtime Error

Solution code:
if N < 10 ** 1:
    print(N)
elif N < 10 ** 2:
    print(9)
elif N < 10 ** 3:
    print(N - 90)
elif N < 10 ** 4:
    print(909)
elif N < 10 ** 5:
    print(N - 9090)
else:
     print(90909)

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int,input().split()))
f = 0

for i in range(1,n):
    a = h[i-1] - h[i]
    if a > 1:
        break
    elif a == 1:
        if f == 1:
            break
        f = 1
    else:
        f = 0

    if i == n - 1:
        f = 2

if f == 2 or n == 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<string>
#include<algorithm>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define repm(i, m, n) for (int i = (m); i < (n); i++)
#define rep_rev(i, n) for (int i = int (n); i >= 0; i--)
typedef long long ll;
using namespace std;

int main() {
	int n;
	cin >> n;
	int ans;
	if (n < 10)ans = n;
	else if (10 <= n && n < 100)ans = 9;
	else if (100 <= n && n < 1000)ans = n - 90;
	else if (1000 <= n && n < 10000)ans = 900;
	else if (10000 <= n && n < 100000)ans = n - 9090;
	else if (n == 100000)ans = 90909;
	cout << ans << endl;

	return 0;
}

Submission status: Runtime Error

Solution code:
if N ==100000:
    ans=90909
elif N > 9999:  
    ans=N-9999 +909
elif N > 999:
    ans=909
elif N > 99:
    ans=N-99 +9
elif N > 9:
    ans= 9
else :
    ans=N
print(ans)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(oppai)

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())

dig = len(str(N))

dig_odd = math.floor(dig / 2)

A = 0

for i in range(dig_odd):
  A += 9 * 10 ** (2 * i)

if dig % 2 == 1:
  A += int(str(N)[1:]) + 1
  
print(A)

Submission status: Runtime Error

Solution code:
ans = 0

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

Submission status: Runtime Error

Solution code:
if N < 10:
    print(N)
elif 10 <= N < 100:
    print(9)
elif 100 <= N < 1000:
    print(N - 90)
elif 1000 <= N < 10000:
    print(909)
elif 10000 <= N < 100000:
    print(N-9090)
else:
    print(90909)

Submission status: Runtime Error

Solution code:
if N < 10:
    print(N)
elif N >= 10 and N < 100:
    print(9)
elif N >= 100 and N < 1000:
    print(N - 90)
elif N >= 1000 and N < 10000:
    print(909)
elif N >= 10000 and N < 100000:
    print(N-9090)
else:
    print(90909)

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.readline
N=input()
ans=0
if N<=9:
  ans=N
elif 10<=N<=99:
  ans=10
elif 100<=N<=999:
  ans=9+(N-99)
elif 1000<=N<=9999:
  ans=909
elif 10000<=N<=99999:
  ans=909+(N-9999)
else:
  ans=90909
print(ans)