TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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).

Submission attempts (in order):
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))
  
  

  

N=int(input())
cnt=0

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

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
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 <= 99999):
    print (n - 9090)

else:
    print 90909

n = int(input())

if(n <= 9):
    return n

elif(n <= 99):
    return 9

elif(n <= 999):
    return (n - 90)

elif(n <= 9999):
    return 909

elif(n <= 99999):
    return (n - 9090)

else:
    return 90909

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 <= 99999):
    print(n - 9090)

else:
    print(90909)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
s = int(input())

tmp = s + 1
i = 0
output = 0
for i in range(tmp):
    if i%2 == 0:
        i = 0
    else:
        output = output + 1
        
print(output)
        
    

s = int(input())

tmp = s
g = 0
output = 0
for i in range(tmp):
    i = i + 1
    if int(len(str(i)))%2 == 0:
        g=1
    else:
        output = output + 1
    print(i)
        
print(output)
    

s = int(input())

g = 0
output = 0
for i in range(s):
    i = i + 1
    if int(len(str(i)))%2 == 0:
        g=1
    else:
        output = output + 1

        
print(output)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N=input()
i=int(len(N))
N=int(N)
print(N,i)
x=0
if i%2!=0:
    x=N-10**(i-1)+1
    i=i-1
    if i!=0:
        while i>0:
            i=i-2
            x=x+9*(10**i)
else:
    if N<10:
        x=N
    else:
        while i>1:
            x=x+9*(10**(i-2))
            print(i)
            i=i-2

print(x)


N=input()
i=int(len(N))
N=int(N)
#print(N,i)
x=0
if i%2!=0:
    x=N-10**(i-1)+1
    i=i-1
    if i!=0:
        while i>0:
            i=i-2
            x=x+9*(10**i)
else:
    if N<10:
        x=N
    else:
        while i>1:
            x=x+9*(10**(i-2))
            #print(i)
            i=i-2

print(x)


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
print(len([i for i in range(1,100000+1) if len(str(i))%2==1]))


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


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())

ans = 0
i = 0

while N >= 10**(i+1):
    if i%2 == 1:
        ans += 10**(i+1)- 10**i
    i += 1

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

N = int(input())

ans = 0
i = 0

while N >= 10**(i+1):
    if i%2 == 0:
        ans += 10**(i+1)- 10**i
    i += 1

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):

N = int(input())

L = 0 
t = N
while t:
    L += 1
    t = t // 10

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

#print("==", ans)
if L % 2 == 1:
    ans += N - 10**(L-1)

print(ans)


N = int(input())

L = 0 
t = N
while t:
    L += 1
    t = t // 10

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

print("==", ans)
if L % 2 == 1:
    ans += N - 10**(L-1)

print(ans)


N = int(input())

L = 0 
t = N
while t:
    L += 1
    t = t // 10

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

#print("==", ans)
if L % 2 == 1:
    ans += N - 10**(L-1) + 1

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
# -*- coding: utf-8 -*-
N= int(input())
if N == 1:
# -*- coding: utf-8 -*-
N = int(input())
digit_count = len(str(N))
if digit_count == 1:
    print(N)
if (digit_count % 2 == 1):
    print(N - int(str(90) * (digit_count//2)))
else:
    total = 0
    for i in range(0, digit_count//2):
        total += 9*(100**i)
    print(total)

# -*- coding: utf-8 -*-
N = int(input())
digit_count = len(str(N))
if digit_count == 1:
    print(N)
elif (digit_count % 2 == 1):
    print(N - int(str(90) * (digit_count//2)))
else:
    total = 0
    for i in range(0, digit_count//2):
        total += 9*(100**i)
    print(total)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
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')


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

N = int(input())
print(sum([len(str(i + 1)) % 2 for i in range(N)]))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
x = input()
m = len(x)
x = int(x)

p = m//2
q = m%2

if q==1:
  if p==0:
    print(x)
    exit()
  else:
    a = 90
    while(p>0):
      x -= a
      a *= 100
    print(x)
    exit()
else:
  if p==0:
    print(0)
    exit()
  else:
    x = 0
    a = 9
    while(p>1):
      x += a
      a *= 100
    print(x)
    exit()  
    

x = input()
m = len(x)
x = int(x)

p = m//2
q = m%2

if q==1:
  if p==0:
    print(x)
    exit()
  else:
    a = 90
    while(p>0):
      x -= a
      a *= 100
    print(x)
    exit()
else:
  if p==0:
    print(0)
    exit()
  else:
    x = 0
    a = 9
    while(p>0):
      x += a
      a *= 100
    print(x)
    exit()  
    


x = input()
m = len(x)
x = int(x)

p = m//2
q = m%2

if q==1:
  if p==0:
    print(x)
    exit()
  else:
    a = 90
    while(p>0):
      x -= a
      a *= 100
      p -= 1
    print(x)
    exit()
else:
  if p==0:
    print(0)
    exit()
  else:
    x = 0
    a = 9
    while(p>0):
      x += a
      a *= 100
      p -= 1
    print(x)
    exit()  
    


Verdicts: Wrong Answer

Time Limit Exceeded

Accepted
Problem: 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).

Submission attempts (in order):
a = int(input())
count = 0
for i in range(a):
  if int((len(str(i))) % 2 == 1):
    count += 1
      
if a % 10 != 0:
  print(count)
else:
  print(count - 1)

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

print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
count = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
		count += 1
print(count)

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


Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
total = 0
val1 = int(math.ceil(math.log(n,10)))
ans = 0
if val1==1:
	ans = n
elif val1==2:
    ans = 9
elif val1==3:
	ans = 9+n-99
elif val1==4:
	ans = 909
elif val1==5:
	ans = 909+n-9999
else:
	ans = 90909
if val1==math.log(n,10) and val1%2:
	print(ans-1)
else:
	print(ans)

import math
n = int(input())
total = 0
word = str(n)
val1 = len(word)
ans = 0
if val1==1:
	ans = n
elif val1==2:
    ans = 9
elif val1==3:
	ans = 9+n-99
elif val1==4:
	ans = 909
elif val1==5:
	ans = 909+n-9999
else:
	ans = 90909
print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
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

N = int(input())
count = 0

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())

if N = 100000:
  print(90909)
elif N >= 10000:
  print(909 + N - 9999)
elif N >= 1000:
  print(909)
elif N >= 100:
  print(9 + N - 99)
elif N >= 10:
  print(9)
else:
  print(N)

N = int(input())

if N == 100000:
  print(90909)
elif N >= 10000:
  print(909 + N - 9999)
elif N >= 1000:
  print(909)
elif N >= 100:
  print(9 + N - 99)
elif N >= 10:
  print(9)
else:
  print(N)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N=int(input())
if N < 10:
    print(N)
if N < 100:
    print(9)
if N < 1000:
    print(N-90)
if N < 10000:
    print(909)
if N <100000:
    print(N-9090)
if N == 100000:
    print(90909)

N=int(input())
if N < 10:
    print(N)
if 10 <= N < 100:
    print(9)
if 100 <= N < 1000:
    print(N-90)
if 1000 <= N < 10000:
    print(909)
if 10000 <= N <100000:
    print(N-9090)
if N == 100000:
    print(90909)


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(n)

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

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

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
a=int(input())
b=a//10+1
c=a%10
d=b//2+1
print(int(d*9+c))


a=int(input())
b=len(str(a))

ans=0

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

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

print(int(ans))


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = input()
i = int(n)
cnt = 0
ans = 0
while i > 0:
  i /= 10
  cnt++
if cnt / 2 == 0:
  i = cnt / 2
  if i == 3:
      ans = 90000 + 900 + 9
  elif i == 2:
      ans = 900 + 9
  else :
      ans = 9
else :
  i = (cnt / 2) + 1
  if i == 3:
    ans = 9 + 900 + (int(n) - 10000) + 1
  elif i == 2:
    ans = 9 + (int(n) - 100) + 1
  else :
    ans = int(n)
print(ans)


n = map(int, input())
i = n
cnt = 0
ans = 0
while i > 0:
  i /= 10
  cnt++
  
if cnt / 2 == 0:
  i = cnt / 2
  if i == 3:
      ans = 90000 + 900 + 9
  elif i == 2:
      ans = 900 + 9
  else :
      ans = 9
  
else :
  i = (cnt / 2) + 1
  if i == 3:
    ans = 9 + 900 + (n - 10000) + 1
  elif i == 2:
    ans = 9 + (n - 100) + 1
  else :
    ans = n

print(ans)


n = input()
i = int(n)
cnt = 0
ans = 0
while i >= 1:
  i = int(i) / 10
  cnt = int(cnt) + 1
if int(cnt) % 2 == 0:
  i = cnt / 2
  if i == 3:
      ans = 90000 + 900 + 9
  elif i == 2:
      ans = 900 + 9
  else :
      ans = 9
else :
  i = (int(cnt) / 2) + 1
  if i >= 3:
    ans = 9 + 900 + (int(n) - 10000) + 1
  elif i >= 2:
    ans = 9 + (int(n) - 100) + 1
  else :
    ans = int(n)
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())

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

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

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
kotae = 0
if n == 100000:
  kotae = 90909
elif n => 10000:
  kotae = 909 + (n - 10000 + 1)
elif n => 1000:
  kotae = 909
elif n => 100:
  kotae = 9 + (n- 100 +1)
elif n => 10:
  kotae = 9
else:
  kotae = n

n = int(input())
kotae = 0
if n == 100000:
  kotae = 90909
elif n => 10000:
  kotae = 909 + (n - 10000 + 1)
elif n => 1000:
  kotae = 909
elif n => 100:
  kotae = 9 + (n- 100 +1)
elif n => 10:
  kotae = 9
else:
  kotae = n
print(kotae)

n = int(input())
kotae = 0
if n == 100000:
  kotae = 90909
elif n >= 10000:
  kotae = 909 + (n - 10000 + 1)
elif n >= 1000:
  kotae = 909
elif n >= 100:
  kotae = 9 + (n- 100 +1)
elif n >= 10:
  kotae = 9
else:
  kotae = n
print(kotae)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())

if N <= 99:
    print(max(9,N))
    exit()

if N <= 9999:
    print(min(N - 99 + 9, 999 - 99 + 9))
    exit()

print(min(N - 9999 + 909, 90909))

N = int(input())

if N <= 99:
    print(min(9,N))
    exit()

if N <= 9999:
    print(min(N - 99 + 9, 999 - 99 + 9))
    exit()

print(min(N - 9999 + 909, 90909))

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n=int(input())
n1=len([i for i in str(n)])

x=0
if n1=1:
  x=n
elif n1=2:
  x=9
elif n1=3:
  x=9+(n-99)
elif n1=4:
  x=9+90
elif n1=5:
  x=9+900+(n-999)
elif n1=6:
  x=9+900+90000
  
print(x)

n=int(input())
n1=[int(i) for i in str(n)]
n2=len(n1)

x=0
if n1=1:
  x=n
elif n1=2:
  x=9
elif n1=3:
  x=9+(n-99)
elif n1=4:
  x=9+900
elif n1=5:
  x=9+900+(n-999)
  
print(x)

n=int(input())
n1=len(str(n))


  
print(n)

n=int(input())
n1=len(str(n))

x=0
if n1=1:
  x=n
elif n1=2:
  x=9
elif n1=3:
  x=9+(n-99)
elif n1=4:
  x=9+90
elif n1=5:
  x=9+900+(n-999)
elif n1=6:
  x=9+900+90000
  
print(x)

n=int(input())

if n<100:
  print(min(n,9))
elif n<10000:
  print(min(n-90,909))
else:
  print(min(n-9090,90909))

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
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)


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


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N=int(input())
if N%2==0:
    A=N/2
else:
    A=(N+1)/2
print(A)

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)

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)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n = input()
s = 0
for i in range(n+1):
  l = list(int(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

n = input()
s = 0
for i in range(n+1):
  l = list(i)
  if len(l) % 2 = 1:
    s += 1
print(s)

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

n = input()
s = 0
for i in range(n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

n = int(input())
s = 0
for i in range(n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

n = int(input())
s = 0
for i in range(1,n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):

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())
    n = 124
    x = range(n + 1)[1:]
    x = tuple(filter(fn, x))

    print(len(x))


if __name__ == '__main__':
    main()



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


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



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 = range(n + 1)[1:]
    x = tuple(filter(fn, x))

    print(len(x))


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N=input()
count=0
for i in range(1,N):
  if len(i)%2!=0:
    count+=1
print(count)

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N=int(input())
C=0

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
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

n=int(input())
if(n<10):
  x=n
elif(n<100):
  x=9
elif(n<1000):
  x=n-90
elif(n<10000):
  x=9+900
elif(n<100000):
  x=n-90-9000
elif(n==100000):
  x=90909
print(x)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n=int(input())

100,000

ct = 0

if n <= 9:
	ct = n
elif n <= 999 and n >= 10:
	ct = 9 + (n - 99)
elif n <= 99999 and n >= 1000:
	ct = 9 + 900 + (n - 9999)
elif n == 100000:
	ct = 90909
	
print(ct)

n=int(input())
ct = 0

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
nlen =len(str(n))
ans = 0

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

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

if n <= 9:
  print(n)
else:
  for i in range(1,nlen):
    if i % 2 == 1:
      ans += 10 ** i -10 ** (i-1)
  print(ans)
  if nlen % 2 == 1:
    ans = ans + (n - 10**(nlen-1) + 1)
    print(str(n - 10**(nlen-1) + 1))
  print(ans)

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = input()
int_n = int(n)

sum = 9
for i in range(1,len(n),1):
  print(i)
  if i%2 == 0:
    if i == (len(n)-1):
      sum += int_n - int("9"*i)
    else:
      sum += int("9"*(i+1)) - int("9"*i)
      
print(sum)

n = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

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


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]))


def digit(n):
    
    return len(list(map(int, str(n))))

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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
ans = 0
for i in range(1,n+1):
  if i % 2 == 1:
    ans += 1
    
print(ans)
  

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N =int(input())
if N >=10 and N<=99:
  print(9)
elif N >=100 and N<=999:
  print(N-90)
elif N >= 1000 and N<= 9999:
  print(900)
elif N >= 10000 and N<= 99999:
  print(N-90-9000)
elif N = 100000:
  print(9 + 900 + 90000)
else:
  print(N)

N =int(input())
if N >=10 and N<=99:
  print(9)
elif N >=100 and N<=999:
  print(N-90)
elif N >= 1000 and N<= 9999:
  print(9 + 900)
elif N >= 10000 and N<= 99999:
  print(N-90-9000)
elif N == 100000:
  print(9 + 900 + 90000)
else:
  print(N)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
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)

n = int(input())
if n < 10:
  print(n)
  exit()
if n >= 10 and n < 100:
  print(9)
  exit()
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)
  exit()
if n >= 10000 and n < 100000:
  print(909 + (n-10000) + 1)
  exit
if n == 100000:
  print(90909)


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
# -*- coding: utf-8 -*-
a = int(input())
if l <=9:
  print("{}".format(a));
  return
if l <=99:
  print('9')
  return;
if l < 999:
  print("{}".format(9+a-99))
  return
if l <= 9999:
  print('909')
  return
print("{}".format(909+a-9999))

# -*- coding: utf-8 -*-
a = int(input())
if a <=9:
  print("{}".format(a));
elif a <=99:
  print("9")
elif a < 999:
  print("{}".format(9+a-99))
elif a <= 9999:
  print('909')
else
  print("{}".format(909+a-1000))

# -*- coding: utf-8 -*-
l = int(input())
if l <=9:
  print("{}".format(a));
  return
if l <=99:
  print('9')
  return;
if l < 999:
  print("{}".format(9+a-99))
  return
if l <= 9999:
  print('909')
  return
print("{}".format(909+a-9999))

# -*- coding: utf-8 -*-
a = int(input())
if a <=9:
  print("{}".format(a));
  return
if a <=99:
  print('9')
  return;
if a < 999:
  print("{}".format(9+a-99))
  return
if a <= 9999:
  print('909')
  return
print("{}".format(909+a-9999))

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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).

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


n = int(input())

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


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())

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

N = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

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


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


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


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


N = int(input())
if N == 10**5:
  res = 90909
elif 10**4 <= N < 10**5:
  res = N-9090
elif 10**3 <= N < 10**4:
  res = 909
elif 10**2 <= N < 10**3:
  res = N-90
elif 10 <= N < 10**2:
  res = 9
elif 1 <= N < 10:
  res = N
print(res)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n= int(input())
res = 0
for i in range(1,n+1):
    if i%2 == 1:
        res += 1
print(res)

n=int(input())
a = [str(i) for i in range(1,n+1)]
res = 0
for i in a:
    if len(i)%2==1:
        res += 1
print(res)

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N=input()

if 1<=N,N<=9:
    output=N
elif 10<=N,N<=99:
    output=9
elif 100<=N,N<=999:
    output=N-99+9
elif 1000<=N,N<=9999:
    output=900+9
elif 10000<=N,N<=99999:
    output=N-9999+900+9
else:
    output=90000+900+9
print(output)

N=input()
N=int(N.split()[0])

if 1<=N,N<=9:
    output=N
elif 10<=N,N<=99:
    output=9
elif 100<=N,N<=999:
    output=N-99+9
elif 1000<=N,N<=9999:
    output=900+9
elif 10000<=N,N<=99999:
    output=N-9999+900+9
else:
    output=90000+900+9
print(output)

N=input()

if 1<N,N<9:
    output=N
elif 10<N,N<99:
    output=9
elif 100<N,N<999:
    output=N-100+9
elif 1000<N,N<9999:
    output=909
elif 10000<N,N<99999:
    output=N-10000+900+9
else:
    output=90909
print(output)

N=input()
N=N.split()
N=int(N[0])

if 1<=N and N<=9:
    output=N
elif 10<=N and N<=99:
    output=9
elif 100<=N and N<=999:
    output=N-99+9
elif 1000<=N and N<=9999:
    output=900+9
elif 10000<=N and N<=99999:
    output=N-9999+900+9
else:
    output=90000+900+9
print(output)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N=input()
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4:
    count=count+1
print(count)
    
    
    


N=input()
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4:
    count=count+1
print count
    
    
    

N=int(input())
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4 and ks!=6:
    count=count+1
print(count)
    
    
    


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())

def count(start, end):
  return end - start + 1

keta = 1
while True:
  if 10**keta > N:
    break
  else:
  	keta += 1

num = 0
for k in range(1, keta+1):
  if k % 2 == 1:
	num += count(10**(k-1), min(N, 10**k)-1)
    
print(num)

N = int(input())
def count(start, end):
  return end - start + 1
keta = 1
while True:
  if 10**keta > N:
    break
  else:
    keta += 1
num = 0
for k in range(1, keta+1):
  if k % 2 == 1:
    num += count(10**(k-1), min(N, 10**k-1))
print(num)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N=int(input())
for i in range(6):
    10**i<=N<(i+1)
    n=i
ans=0
for i in range(1,n+1,2):
    ans+=10**i-10**(i-1)
print(ans)

N=int(input())
ans=0
l=len(str(N))
for i in range(l+1):
    if i!=l and i%2!=0:
        ans+=(10**i)-(10**(i-1))
    if i==l and i%2!=0:
        ans+=(N-(10**(i-1))+1)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
N=input()
n=len(N)
n=int(n)
num=0
num1=1
for i in range(n):
    print(i)
    if(i%2==0):
        if(i>1):
            for k in range(i):
                num1=num1*10
        num+=9*num1

print(num)


N=input()
n=len(N)
n=int(n)
num=0
num1=1
num2=1
for i in range(n-1):
    if(i%2==0):
        if(i>1):
            for k in range(i):
                num1=num1*10
                num2=num1
        num1=1
        num+=9*num2

if(int(N)>9):
    if(n%2==1):
        num+=int(N)-num2*100+1
else:
    if(n%2==1):
        num+=int(N)%(num2*100)

print(num)

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
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))


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)

N = int(input())
n=N
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))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
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()))

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)


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

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)


Verdicts: Runtime Error

Accepted
Problem: 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).

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

n  = int(input())
if n<10:
    print(n)
elif n<1000:
    print(n-90)
elif n<100000: 
    print(n-8990)
else:
    print(90909)

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
cnt = 0
for i in range(1, n + 1):
    if str(i) % 2 == 1:
        cnt += 1
print(cnt)


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


Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
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))

n=int(input())
m=str(n)
minus1=10**(len(m)-2)*9
minus=minus1
if len(m)==1:
    print(n)
elif 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)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
result = 0
for n in range(int(input())):
    result += len(n+1)%2
print(result)

result = 0
for n in range(int(input())):
    result += len(str(n+1))%2
print(result)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())
cnt = 0

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

N = int(input())
cnt = 0

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
a = int(input())

cnt = 0

for i in range(1,10):
	cnt += 1
	if i < a :
		print (cnt)
		exit()

for j in range(100,1000):
	cnt += 1
	if i < a :
		print (cnt)
		exit()

for k in range(10000,100000):
	cnt += 1
	if i < a :
		print (cnt)
		exit()



import sys

a = int(input())

cnt = 0

for i in range(1,10):
	cnt += 1
	if i == a :
		print (cnt)
		sys.exit()
if a < 100 :
	print (cnt)
	sys.exit()
for j in range(100,1000):
	cnt += 1
	if j == a :
		print (cnt)
		sys.exit()
        
if a < 10000 :
	print (cnt)
	sys.exit()
for k in range(10000,100000):
	cnt += 1
	if k == a :
		print (cnt)
		sys.exit()
if a == 100000 :
	print (cnt)
	sys.exit()


Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
digit = len(str(n))

a = 0
if digit % 2 == 0:
  while digit > 0:
    if digit % 2 != 0:
      a += 10 ** digit - 10 ** (digit-1) 
      print(a)
    digit -= 1
else:
  digit -= 1
  a += n - 10 ** (digit) + 1
  print(a)
  while digit > 0:
    if digit % 2 != 0:
      a += 10 ** digit - 10 ** (digit-1) 
    digit -= 1

print(a)

n = int(input())
digit = len(str(n))

a = 0
if digit % 2 == 0:
  while digit > 0:
    if digit % 2 != 0:
      a += 10 ** digit - 10 ** (digit-1)
    digit -= 1
else:
  digit -= 1
  a += n - 10 ** (digit) + 1
  while digit > 0:
    if digit % 2 != 0:
      a += 10 ** digit - 10 ** (digit-1) 
    digit -= 1

print(a)

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
num=input("N:")
count=0


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


num=input("")
count=0


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

Verdicts: Wrong Answer

Accepted
Problem: 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).

Submission attempts (in order):
m = input()

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)
elif 100000<= n < 1000000:
    print(90909)



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

n=int(input())

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



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())
 
i=1
x = 0
 
while True:
    m = 10 ** i - 1
    if N <= m:
      x += (N - (10 ** (i-1) - 1))
      break
	x += m
    i += 1
print(x)

N = int(input())

i=1
x = 0

while True:
    m = 10 ** i - 1
    if N <= m:
      x += (N - (10 ** (i-1) - 1))
      break
	x += m
print(x)

N = int(input())
 
i=1
x = 0
 
while True:
  m = 10 ** i - 1
  if N <= m:
    x += max((N - (10 ** (i-1) - 1)), 0)
    break
  x += (m - (10 ** (i-1) - 1))
  i += 2
print(x)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

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


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

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())
count = 0

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

N = int(input())
count = 0

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

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
if n1 < 10:
    print(n1)
elif n1 <= 99:
    print(9)
elif n1 < 1000:
    print(9 + (n1 - 99))
elif n1 <= 9999:
    print(909)
elif n1 < 100000:
    print(909 + (n1 - 999))
else:
    print(90909)

n1 = int(input())

if n1 < 10:
    print(n1)
elif n1 <= 99:
    print(9)
elif n1 < 1000:
    print(9 + (n1 - 99))
elif n1 <= 9999:
    print(909)
elif n1 < 100000:
    print(909 + (n1 - 9999))
else:
    print(90909)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
# -*- coding: utf-8 -*-
 
n = int(input())
if n / 10000 >= 1:
  print(9 + 900 + n - 10000 + 1)
else if n / 100 >= 1:
  print(9 + n - 100 + 1)
else if n / 10 >= 1:
  print(9)
else if n < 10:
  print(n)

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

Verdicts: Runtime Error

Accepted
Problem: 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).

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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).

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

print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
N = int(input())
ans = 0

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


N = int(input())
ans = 0

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


N = int(input())
ans = 0

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

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())
a = len(str(n))
b = 0
j = 2*i
if a%2 == 0:
    for j in range(a//2):
        b += 10**(2*j+1)-10**(2*j)
    print(b)
else:
    for j in range(a//2):
        b += 10**(2*j+1)
    print(n-10**(a-1)+b)

n = int(input())
a = len(str(n))
b = 0
c = a//2

if a%2 == 0:
    for j in range(c):
        b += 9*100**j
    print(b)
else:
    for j in range(c):
        b += 9*100**j
    print(n-10**(a-1)+1+b)

Verdicts: Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n = int(input())

intCount = 0

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

print(intCount)

intCount = 0

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

print(intCount)

n = int(input())

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

print(intCount)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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).

Submission attempts (in order):
n=input()
count=0
if n.len()==1:
  count=int(n)
else:
  count+=9
  if n.len()==3:
    count+=(int(n)//100)*100+int(n)%100+1
  else:
    count+=900
    if n.len()==5:
      count+=(int(n)//10000)*10000+int(n)%10000+1


n=input()
count=0
if len(n)==1:
  count=int(n)
if len(n)==2:
  count+=9
if len(n)==3:
    count+=(int(n)//100-1)*100+int(n)%100+10
if len(n)==4:
    count+=909
if len(n)==5:
      count+=(int(n)//10000-1)*10000+int(n)%10000+910
if len(n)==6:
      count+=90909
print(count)

Verdicts: Runtime Error

Accepted