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):
a = int(input())
for i in range(1, a + 1):
  if len(str(i)) % 2 ==1: ans+=1   
print(ans)


a = int(input())
ans = 0
for i in range(1, a + 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())
sum = 0
for i in range[1,N+1]:
  if len(i) // 2:
    i += 1
  else:
    sum += 1
    i += 1
print(sum)

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

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

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

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 = int(input())
nm = N//10
sum = 0
for i range(nm):
    if N%2 ==0:
        sum += (10**i-1)
if nm%2 != 0:
    sum += N-(10**nm)+1

N = int(input())
nm = len(str(N))-1
summ = 0
for i in range(nm):
    if N%2 ==0:
        summ += (10**i-1)
if nm%2 == 0:
    summ += N-(10**nm)+1
print(summ)


N = int(input())
nm = N//10
summ = 0
for i in range(nm):
    if N%2 ==0:
        summ += (10**i-1)
if nm%2 != 0:
    summ += N-(10**nm)+1
print(summ)


N = int(input())
nm = len(str(N))-1
summ = 0
for i in range(nm):
    if i ==0:
      summ += 9
    elif i%2 ==0:
      summ += (10**(i+1))
    print(summ)
if nm%2 == 0:
    summ += N-(10**nm)+1
print(summ)

N = int(input())
nm = len(str(N))-1
summ = 0
for i in range(nm):
    if i ==0:
      summ += 9
    elif i%2 ==0:
      summ += (10**(i+1)-10**(i))
if nm%2 == 0:
    summ += N-(10**nm)+1
print(summ)

Verdicts: Runtime Error

Wrong Answer

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):
number = int(input())
ans = 0

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

print(ans)

number = int(input())
ans = 0

for i in range(1,number+1):
  if len(str(i)) % 2 != 0:
    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):
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 = input()
l = []
for i in range(1,int(n)+1):
  if len(i)%2 != 0:
    l.append(i)

print(len(l))

n = input()
l = []
for i in range(1,int(n)+1):
  if len(str(i))%2 != 0:
    l.append(i)

print(len(l))

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())  
#n=11
#l=len(str(n))
if l ==1:
    print(n)
elif l==2:
    print(9)
elif l==3:
    print(9+n-99)
elif l==4:
    print(9+900)
elif l==5:
    print(9+900+n-9999)
elif l==6:
    print(9+900+90000)
    

n=int(input())  
#n=11
l=len(str(n))
if l ==1:
    print(n)
elif l==2:
    print(9)
elif l==3:
    print(9+n-99)
elif l==4:
    print(9+900)
elif l==5:
    print(9+900+n-9999)
elif l==6:
    print(9+900+90000)
    

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

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 = str(input())

N = int(len(n))
result = 0

if N == 1:
    result = n
elif N % 2 != 0:
    result += (int(n) - (10 ** (N-1))) + 1
    count = 0
    for i in range(N // 2):
        count += 1 
        a = "9" * count
        result += int(a)
else:
    for i in range(N // 2):
        count += 1 
        a = "9" * count
        result += int(a)

print(result)

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 = input()
n = len(list(n))
d_list = [9, 900, 90000]
if n >= 5:
  ans = 90909
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + N % 1000
elif n >= 2:
  ans = 9
else:
  ans = N % 10
print(ans)

N = int(input())
n = len(list(str(N)))
if n >= 6:
  ans = 90909
elif n >= 5:
  ans = 909 + (N - 9999)
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + (N - 99)
elif n >= 2:
  ans = 9
else:
  ans = N
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())
if N < 10:
  print (N)
if N >=10 & N <100:
  print ("9")
if N >=100 & N < 1000:
  print (N - 99 + 9)
if N >= 1000 & N < 10000:
  print ("909")
if N >=10000 & N < 100000:
  print (N - 9999 + 900 + 9)
if N == 100000:
  print ("90909")

N = int (input())
if N < 10:
  print (N)
if N >=10 & N <100:
  print ("9")
if N >=100 & N < 1000:
  print (N - 99 + 9)
if N >= 1000 & N < 10000:
  print ("909")
if N >=10000 & N < 100000:
  print (N - 9999 + 900 + 9)
if N == 100000:
  print ("90909")

N = int (input())
if N < 10:
  print (N)
if N >=10 && N <100:
  print ("9")
if N >=100 && N < 1000:
  print (N - 99 + 9)
if N >= 1000 && N < 10000:
  print ("909")
if N >=10000 && N < 100000:
  print (N - 9999 + 900 + 9)
if N == 100000:
  print ("90909")

N = int (input())
if N < 10:
  print (N)
elif N >=10 and N <100:
  print ("9")
elif N >=100 and N < 1000:
  print (N - 99 + 9)
elif N >= 1000 and N < 10000:
  print ("909")
elif N >=10000 and N < 100000:
  print (N - 9999 + 900 + 9)
elif N == 100000:
  print ("90909")

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

digit = len(N)
ans = 0

if digit != 1:
  ans = '09' * (digit // 2)
  ans = int(ans)

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

  print(ans)




N = input()

digit = len(N)
ans = 0

if digit != 1:
  ans = '09' * (digit // 2)
  ans = int(ans)

if digit % 2 == 1:
  ans += int(N) - 10**(digit - 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):
print(len(list(filter(lambda n: n % 2 == 1, range(1, int(input()) + 1)))))


print(len((list(filter(lambda n: len(str(n)) % 2 == 1, range(1, int(input()) + 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())
cnt = 0
for i in range(N+1):
	if len(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: 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(N):
  if len(i)%2 == 1:
    cnt += 1
print(cnt)


N = int(input())
cnt = 0
for i in range(N):
  if len(i)%2 == 1:
    cnt += 0
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

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
if N > 99999:
    ans += 90909
elif 99999 >= N > 10000:  
    tmp = (N % 100000)  
    print("Nが6桁、または5桁: tmp = ", tmp)
    ans += tmp - 10000
    ans += 909
elif 9999 >= N > 100:  
    tmp = (N % 1000)
    print("Nが4桁、または3桁: tmp = ", tmp)
    ans += tmp - 100
    ans += 9
elif N == 1000:
    ans += 909
elif 99 >= N >= 1:
    print("Nが2桁、または1桁: N = ", N)
    ans += (N % 10)

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 = input()
ans = 0
for i in range(1, N + 1):
    if lens(str(i)) % 2 is 1:
      ans += 1
      
print(ans)

N = int(input())
ans = 0
for i in range(1, N + 1):
    if lens(str(i)) % 2 is 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())
for i in range(5):
    if 10**i <= n <= 10**(i+1):
        keta = i+1
        break

if keta ==1 or keta == 2:
    count = n
elif keta == 3:
    count = 9 + (n - 100)
elif keta == 4:
    count = 9 + 899
else:
    count = 9 + 899 + (n - 89999)

print(count)

n = int(input())
for i in range(5):
    if n == 100000:
        keta = 6
    elif 10**i <= n < 10**(i+1):
        keta = i+1
        break

if keta ==1:
    count = n
elif keta == 2:
    count = 9
elif keta == 3:
    count = 9 + (n - 99)
elif keta == 4:
    count = 9 + 900
elif keta == 5:
    count = 9 + 900 + (n - 9999)
else:
    count = 90909

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())
cnt=0
for i in range(1,n+1):
  if len(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())
cnt = 0
for i in range(1, n + 1):
    if len(str(n)) % 2:
        cnt += 1
print(cnt)

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

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 = int(input())
#print(num)
cnt=0
for i in range(num):
    if len(str(i))%2==1:
        cnt = cnt+1
    
        
print(cnt)

num = int(input())
#print(num)
cnt=0
for i in range(1,num+1):
  #print(i)
  if len(str(i))%2==1:
    cnt = 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<=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)

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)


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())
ans+=0
for i in range(1,a+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)

a=int(input())
ans=0
for i in range(1,a+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):
print(len([None for i in range(int(input())+1) if len(str(i)) % 2]))

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

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(N-100000*(N//100000)+1+N-1000*(N//1000)+1*N-10*(N//10)+1)

N = int(input())

keta = len(str(N))
cnt = 0

for i in range(1,keta,2):
    cnt += 9 * (10**(i-1))

if keta % 2 == 1:
    cnt += N - (10**(keta-1)) + 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 = input()
c=0
a = [x for i in range(n)]
for x in a:
  if len(str(x)) % 2 == 1:
    c += 1
    
print(c)

n = int(input())
c=0
a = [i for i in range(n+1)]
for x in a:
  if len(str(x)) % 2 == 1:
    c += 1
    
print(c-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):
n=int(input())
t=0
for i in range(n):
  l=len(str(i))
  if l%2!=0:
    t+=1
print(t)


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


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 = len(str(N))
ans = 0
n = 1
while l >= n:
	q = '9' * (n - 1)
	if q == '':
		q = '0'
	c = 9 * int(q) + 9
	print(N, c)
	if N > c:
		ans += c
	else:
		ans += N - (10 ** (n - 1)) + 1
	n += 2
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())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%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)

N = int(input())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%2==1:
    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())
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)
  
    

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


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

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

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

n = int(input())
count = 0
 
for i in n:
  if len(i)//2 != 0:
    count += 1
 
print(count)

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 n:
  if len(i)% != 0:
    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

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):
a = map(int,input().split())
unchi = 0
while a>=1:
    a -=1
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
print(unchi)


a = int(input())
unchi = 0
for i in range(1,a):
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
print(unchi)


a = int(input())
unchi = -1
for i in range(1,a):
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
print(unchi)


a = int(input())
unchi = 0
while a>=1:
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
    a -= 1
print(unchi)


Verdicts: Runtime Error

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())
sm = 0
for i in range(n):
    if len(str(i)) % 2 == 1:
        sm += 1
        
print(sm)

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

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

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):
a=int(input())
b=0
for i in range(1,a+1):
    if len(str(i))%2==1:
        print(i)
        b+=1
print(b)

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

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

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

if 1 <= n <= 99:
    print(min(n,9))
elif 100<= n <= 9999:
    print(min(n-90,910))
elif:
    print(n-9080)

n = int(input())

if 1 <= n <= 99:
    print(min(n,9))
elif 100<= n <= 9999:
    print(min(n-90,909))
else:
    print(min(90909,n-10000+910))

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_1=9
count_3=900
count_5=90000

count=0

if n = 100000:
  count+=90909

if 10000 <= n and n < 100000:
  m=n-9999
  count+=m
  count+=909

if 1000 <= n and n < 10000:
  count+=909

if 100 <=n and n < 1000:
  l=n-99
  count+=l
  count+=9

if 10 <= n and n < 100:
  count +=9

if n < 10:
  count+=n

print(count)

n=int(input())
 
count=0
 
if n == 100000:
  count+=90909

if 10000 <= n and n < 100000:
  m=n-9999
  count+=m
  count+=909

if 1000 <= n and n < 10000:
  count+=909

if 100 <=n and n < 1000:
  l=n-99
  count+=l
  count+=9

if 10 <= n and n < 100:
  count +=9

if n < 10:
  count+=n

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

if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(n - 90 + 9)
elif keta == 4:
    print(909)
elif keta == 5:
    print(n - 9000 + 900 - 90 + 9)
else:
    print(90909)

n = input()
keta = len(n)
n = int(n)

if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(n - 90)
elif keta == 4:
    print(909)
elif keta == 5:
    print(n - 9000  - 90 )
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):
n = int(input())

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

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)

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

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())
ans = 0
for i in range(i,n+1):
  if len(str(i))%2 != 0:
    ans += 1
print(ans)
 

n = int(input())
ans = 0
for i in range(1,n+1):
  if len(str(i))%2 != 0:
    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("Enter Something"))
count=0
for n in range(1,N+1):
    if len(str(n))%2!=0:
        count+=1
print(count)

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


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


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

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

N = int(input())

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)    

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())
sum = 0
for i in range(1,n+1):
    length = 1
    num = i
    while num >= 10:
        num = num/10
        length += 1
    if (length % 2) == 1:
        print('i:'+str(i)+ ' length' + str(length))
        sum += 1
print(sum)

n=int(input())
sum = 0
for i in range(n):
    length = 1
    num = i
    while num >= 10:
        num = num/10
        length += 1
    if (length % 2) == 1:
        sum += 1
print(sum)

n=int(input())
sum = 0
for i in range(1,n+1):
    length = 1
    num = i
    while num >= 10:
        num = num/10
        length += 1
    if (length % 2) == 1:
        sum += 1
print(sum)

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())
ans=0
for i in range(n):
  if len(str(i))%2==1:
    ans+=1
  else:
    pass
print(ans)



n=int(input())
ans=0
for i in range(n):
  if len(str(i+1))%2==1:
    ans+=1
  else:
    pass
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):
a, b, c = map(int,input().split())
print(max(0,c-(a-b))

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):
a = int(input())

sum=0
i=0

while i<len(str(a)):
  j=str(a)[-i:]
  sum=sum+int(j)+1
  i=i+2


a = int(input())
 
sum=0
i=0
 
while i<len(str(a)):
	if i==int(len(str(a)))-1:
		sum=sum+a-10**i+1
	else:
		sum=sum+10**(i+1)-10**(i)
	#print(i,sum)
	i=i+2
print(sum)

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())
count=0
for i in range(1,a+1):
    i=str(i)
    if len(i)%2!=0:
        count+=1
    else:
        continue


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


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

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())
c=0
for i in range(1,n+1):
    if str(i)%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: 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 = 0
for i in range(0,N):
  I = str(i)
  if len(I) % 2 == 1:
    a = a + 1
print(a)

N = int(input())
a = 0
for i in range(1,N+1):
  s = str(i)
  if len(s) % 2 == 1:
    a = a + 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):
n=int(input())
digits=len(str(n))
cnt=0
for i in range(int(digits/2)):
  cnt+=9*(10**(i*2))
cnt+=n-10**(digits-1)+1
print(cnt)

n=int(input())
digits=len(str(n))
cnt=0
for i in range(int(digits/2)):
  cnt+=9*(10**(i*2))
if digits%2==1:
  cnt+=n-10**(digits-1)+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):
def f(N):
    x=0
    for i in range(N):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x
N=int(input())
print(f(N))
            
       

def f(N):
    x=0
    for i in range(N+1):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x
N=int(input())
print(f(N))
            
       

def f(N):
    x=0
    for i in range(N+1):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x-1
N=int(input())
print(f(N))
        

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

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(str(j+1)) % 2 != 0):
            num += 1

    print(num)

if __name__ == "__main__":
    main()

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):
def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()

# start

n = int_single()

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

print(res)


def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()

# start

n = int_single()

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

print(r)


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 = input().rstrip()
n_sp = list(map(int, list(n)))
print(n_sp)
dig  = len(n_sp)
odd = 0

if dig == 1:
    print(n_sp[0])

else:
    for i in range(1, dig, 2):
        odd += int("9" * i) - 10 ** (i-1) + 1
        print("i: " + str(i) + " odd: " + str(odd))

    if dig%2 == 1:
        odd += int(n) - n_sp[0]  * 10 ** (dig-1) +1

    print(odd)

n = input().rstrip()
n_sp = list(map(int, list(n)))
dig  = len(n_sp)
odd = 0
 
if dig == 1:
    print(n_sp[0])

else:
    for i in range(1, dig, 2):
        odd += int("9" * i) - 10 ** (i-1) + 1
 
    if dig%2 == 1:
        odd += int(n) - 10 ** (dig-1) +1
 
    print(odd)

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())
cnt=0
for i in range(n):
    if len(str(n)) %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: 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):
# 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)


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


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(1,n+1):
  if len(i)%2==1:
    ans=ans+1
print(ans)


n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    ans=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 = input()

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

print(count)
  
  

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

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

ans=0
N=int(input())
for i in range(1,N+1):
    if len(str(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())
num = int(input())
num_digit = len(str(num))

if num_digit == 1:
    print(0)
elif num_digit == 2:
    print(9)
elif num_digit == 3:
    print(9 + (num - 100 + 1))
elif num_digit == 4:
    print(909)
elif num_digit == 5:
    print(909 + (num - 10000 + 1))

num = int(input())
num_digit = len(str(num))

if num_digit == 1:
    print(num)
elif num_digit == 2:
    print(9)
elif num_digit == 3:
    print(9 + (num - 100 + 1))
elif num_digit == 4:
    print(909)
elif num_digit == 5:
    print(909 + (num - 10000 + 1))
elif num_digit == 6:
    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):
n = int(input())

cnt = 0
for i in range(1,n+1):
    if len(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())
ans = 0
for i in range(1,N+1):
  if len(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())

length = len(str(n))

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

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

print(res)


n = int(input())

length = len(str(n))

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

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

print(res)


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

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
            s+=1
            ans+=s
    else:
        if i%2==0:
            ans+=10**(i+1)-10**i
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())
ans = 0
for n in range(1,N+1):
    if len(str(n)) % 2 == 1:
    ans += 1
print(ans)

N = int(input())
ans = 0
for n in range(1,N+1):
    if len(str(n)) % 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())
con=0
for i in range(1,n+1):
  if i%2==1:
    con+=1
print(con)

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


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 1<=i and i<10:
        print(i)
        count+=1
    elif 100<=i and i<1000:
        print(i)
        count+=1
    elif 10000<=i and i<100000:
        print(i)
        count+=1
    i+=1
print(count)


n=int(input())
count=0
for i in range(1,n+1):
    if 1<=i and i<10:
        count+=1
    elif 100<=i and i<1000:
        count+=1
    elif 10000<=i and i<100000:
        count+=1
    i+=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())
a = 0
for i in (1, n+1):
  if len(str(i)) % 2 == 1:
    a += 1
print(a)

n = int(input())
a = 0
for i in range(1, n+1):
  if len(str(i)) % 2 == 1:
    a += 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):

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
n=int(input())

a=n//10000
b=(n-10000*a)//1000
c=(n-10000*a-1000*b)//100
d=(n-10000*a-1000*b-100*c)//10
e=(n-10000*a-1000*b-100*c-10*d)

if a=0:
	if b=0:
		if c=0:
			if d=0:
				print(n)
			else:
				print(9)
		else:
		 print(n-90)
	else:
		print(909)
else:
	print(n-9090)
	
print(90909)		


    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
n=int(input())

a=n//10000
b=(n-10000*a)//1000
c=(n-10000*a-1000*b)//100
d=(n-10000*a-1000*b-100*c)//10
e=(n-10000*a-1000*b-100*c-10*d)

if a==0:
	if b==0:
		if c==0:
			if d==0:
				print(n)
			else:
				print(9)
		else:
		 print(n-90)
	else:
		print(909)

if n==100000:
	print(90909)

else:
	print(n-9090)
	


    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
n=int(input())

a=n//10000
b=(n-10000*a)//1000
c=(n-10000*a-1000*b)//100
d=(n-10000*a-1000*b-100*c)//10
e=(n-10000*a-1000*b-100*c-10*d)


if n==100000:
	print(90909)

elif a==0:
	if b==0:
		if c==0:
			if d==0:
				print(n)
			else:
				print(9)
		else:
		  print(n-90)
	else:
		print(909)
else:
	print(n-9090)
	

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 // 10 + 1) % 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())
a=0
for i in range(N):
  if i+1//10==0:
    a+=1
  elif i+1//100==0:
    a+=0
  elif i+1//1000==0:
    a+=1
  elif i+1//10000==0:
    a+=0
  else:
    a+=1
print(a)
  


N=int(input())
a=0
for i in range(N):
  if i//10==0:
    a+=1
  elif i//100:
  elif i//1000:
    a+=1
  elif i//10000:
  else:
    a+=1
print(a)
  

N=int(input())
a=0
for i in range(N):
  if (i+1)//10==0:
    a+=1
  elif (i+1)//100==0:
    a+=0
  elif (i+1)//1000==0:
    a+=1
  elif (i+1)//10000==0:
    a+=0
  elif (i+1)//100000==0:
    a+=1
  else:
    a+=0
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):
A = int(input())

count =  0

if A<10:
    count= A
elif A <100:
    count = 9 
elif A < 1000:
    count = 9 + A - 99
elif A < 10000:
    count = 9 + 900
elif A < 100000:
    count = 9 + 900 + (A-9999)
elif A =100000:
    count = 90909
else:
    

print(count)


A = int(input())

count =  0

if A<10:
    count= A
elif A <100:
    count = 9 
elif A < 1000:
    count = 9 + A - 99
elif A < 10000:
    count = 9 + 900
elif A < 100000:
    count = 9 + 900 + (A-9999)
else:
    count = 90909
    

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())
cnt = 0
for i in range(1,N+1):
    print(i)
    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

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(n+1):
  if len(i)%2 == 1:
    count += 1
    
print(count)


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


n = int(input())
count = 0
for i in range(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

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):
import math
n=int(input())
m=int(math.log10(n))
print(m)

import math
n=int(input())
m=int(math.log10(n)+1)
ans=0
def count(x):
  global ans
  if x>0:
    ans+=10**(x)-10**(x-1)
    count(x-2)
  else:
    return ans
if m%2==0:
  count(m-1)
else:
  count(m-2)
  ans+=n-10**(m-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):
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()


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


def uneven_numbers(n):

    ans = 0

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

    return ans

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

if __name__ == '__main__':
    main()


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



import sys    
import os     
import math

N=int(input())
count=0

for i in range(N+1):
    if i==0:
        continue
    if i<10:
        count +=1
    if i<100:
        continue
    elif i<1000:
        count +=1
    elif i<10000:
        continue
    elif i<100000:
        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):
# -*- coding: utf-8 -*-
i = input()
n = len(i)
ans = 0
for j in range(n + 1):
  if j == n and j % 2:
    ans += int(i) - int(str(9) * (j - 1))
  elif j % 2 == 1:
    ans += 10 ** j - int(str(9) * (j - 1)) - 1
print(ans)

# -*- coding: utf-8 -*-
i = input()
n = len(i)
ans = 0
for j in range(n + 1):
  if j == n and j % 2 == 1 and j == 1:
    ans += int(i)
  elif j == n and j % 2 == 1:
    ans += int(i) - int(str(9) * (j - 1))
  elif j == 1:
    ans += 9
  elif j % 2 == 1:
    ans += 10 ** j - int(str(9) * (j - 1)) - 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())
a=range(n)
cnt=0
for x in a:
    if len(str(x))%2==1:
        cnt+=1
print(cnt)

n=int(input())
a=range(n+1)
cnt=-1
for x in a:
    if len(str(x))%2==1:
        cnt+=1
print(cnt)


Verdicts: Wrong Answer

Accepted