ZhenlongDai/ACPR huggingface dataset:
Problem: p02952
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
import collections
import itertools

def resolve():

    N=int(input())

    ans=0
    for i in range(1,N):
        if(10<=i<=99 or 1000<=i<=9999 or 100000<=i<=999999):
            continue
        ans+=1
    print(ans)
resolve()


Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
import math
import collections
import itertools

def resolve():

    N=int(input())

    ans=0
    for i in range(1,N+1):
        if(10<=i<=99 or 1000<=i<=9999 or 100000<=i<=999999):
            continue
        ans+=1
    print(ans)
resolve()

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
cnt = 0
for i in range(1, int(N)):
    if len(str(i)) % 2 == 1:
        cnt += 1
    else:
        continue
print(cnt)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
N = input()
cnt = 0
for i in range(1, int(N)+1):
    if len(str(i)) % 2 == 1:
        cnt += 1
    else:
        continue
print(cnt)

Problem: p02952
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())

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


Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
n = int(input())

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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(0, len(str(n)), 2):
  ans += min(n - 10 ** i, 10 ** (i + 1) - 10 ** i)
print(ans)
    

Failing test case input:
289

Expected output:
199


Actual output:
198


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())
ans = int(0)
s = round(math.log10(N))+1


if s == 1:
    ans = N
elif s==2:
    ans = 9
elif s==3:
    ans = N%100+10
elif s==4:
    ans = 909
elif s==5:
    ans = N%10000+910
elif s==6:
    ans = 90909


print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):
import math

N = int(input())
ans = int(0)
s = math.ceil(math.log10(N+1))


if s == 1:
    ans = N
elif s==2:
    ans = 9
elif s==3:
    ans = (N
elif s==4:
    ans = 909
elif s==5:
    ans = (N
elif s==6:
    ans = 90909


print(ans)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
nn=int(n)
cnt=nn-int('9'+(len(n)-1)*'0')
if len(n)==1:
    ans=nn
elif len(n)==2:
    ans=9
elif len(n)==3:
    ans=cnt+9
elif len(n)==4:
    ans=909
elif len(n)==5:
    ans=cnt+909
else:
    ans=90909
print(ans)


Failing test case input:
289

Expected output:
199


Actual output:
-602


Fixed submission (verdict: Accepted):
n=input()
nn=int(n)
cnt=nn-int('9'+(len(n)-2)*'0')
if len(n)==1:
    ans=nn
elif len(n)==2:
    ans=9
elif len(n)==3:
    ans=cnt
elif len(n)==4:
    ans=909
elif len(n)==5:
    ans=cnt-90
else:
    ans=90909
print(ans)
Problem: p02952
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
res = 0
for i in range(n + 1):
    if len(str(i)) % 2 == 1:
        res += 1
print(res)

Failing test case input:
289

Expected output:
199


Actual output:
200


Fixed submission (verdict: Accepted):
n = int(input())
res = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        res += 1
print(res)

Problem: p02952
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
count=0
for i in range(1,n+1):
    if len(str(n))%2==1:
        count+=1
print(count)

Failing test case input:
289

Expected output:
199


Actual output:
289


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

Failing test case input:
215

Expected output:
125


Actual output:
214


Fixed submission (verdict: Accepted):
n = int(input())

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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()

num = int(n)

s = 0

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

print(s)


Failing test case input:
289

Expected output:
199


Actual output:
197


Fixed submission (verdict: Accepted):
n = input()

num = int(n)

s = 0

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

print(s)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = 0
for i in range(1,N):
    s = str(i)
    if (len(s) % 2 != 0):
        ans+=1

print(ans)




Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
N = int(input())
ans = 0
for i in range(1,N+1):
    s = str(i)
    if (len(s) % 2 != 0):
        ans+=1

print(ans)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans = 0

for i in range(N):
    if ( 1 <= i and i < 10) or (100 <= i and i < 1000) or (10000 <= i and i < 100000):
        ans = ans + 1


print(ans)


Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
N = int(input())

ans = 0

for i in range(N+1):
    if ( 1 <= i and i < 10) or (100 <= i and i < 1000) or (10000 <= i and i < 100000):
        ans = ans + 1

print(ans)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
289

Expected output:
199


Actual output:
[2, 8, 9]
i: 1 odd: 9
99


Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int (input())
if N < 10:
  print (N)
elif N >=10 & N <100:
  print ("9")
elif N >=100 & N < 1000:
  print (N - 99 + 9)
elif N >= 1000 & N < 10000:
  print ("909")
elif N >=10000 & N < 100000:
  print (N - 9999 + 900 + 9)
elif N == 100000:
  print ("90909")

Failing test case input:
215

Expected output:
125


Actual output:
9


Fixed submission (verdict: Accepted):
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")

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

Failing test case input:
215

Expected output:
125


Actual output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
124


Fixed submission (verdict: Accepted):
n = int(input())
     
cnt = 0
for i in range(1, n+1):
    str_n = str(i)
    if len(str_n) % 2 != 0:
        cnt += 1
            
print(cnt)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
215

Expected output:
125


Actual output:
116
125


Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(1,n+1):
  if len(str(i)) == 1:
    ans += 1
    
print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
9


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
odd = []
for i in range(1, n):
    if len(str(i)) % 2 == 1:
        odd.append(i)
print(len(odd))


Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
n = int(input())
odd = []
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        odd.append(i)
print(len(odd))

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Ns = input()
N = int(Ns)
count = 0
for n in range(1, len(Ns), 2):
    count += 10 ** (n + 1) - 1
if len(Ns) % 2 == 1:
    count += N - 10 ** (len(Ns) - 1)
print(count)


Failing test case input:
215

Expected output:
125


Actual output:
214


Fixed submission (verdict: Accepted):
Ns = input()
N = int(Ns)
count = 0

for n in range(1, len(Ns)):
    if n % 2 == 0:
        continue
    count += 10 ** n - 10 ** (n - 1)

if len(Ns) % 2 == 1:
    count += N - 10 ** (len(Ns) - 1) + 1

print(count)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) % 2 != 0:
    ans += (10 ** (len(N)-1)) * (int(N[0])-1)
    ans += int(N[min(1, len(N)-1):]) + 1
    if N[0] != 1:
        ans -= 1

print(ans)


Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
N = input()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) == 1:
    ans = int(N)


elif len(N) % 2 != 0:
    ans += (10 ** (len(N)-1)) * (int(N[0])-1)
    ans += int(N[min(1, len(N)-1):]) + 1


print(ans)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans = 0

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

print(ans)


Failing test case input:
289

Expected output:
199


Actual output:
200


Fixed submission (verdict: Accepted):
N = int(input())
 
ans = 0
for i in range(N):
  if len(str(i+1))%2 != 0:
    ans += 1
 
print(ans)

Problem: p02952
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n    = int(input())
mx   = 10**5
li   = [0]*mx
cnt  = 0
unit = 10

for i in range(mx):
    chk = (i+1)

    if chk < 1:
        cnt+=1
    elif chk < 10:
        pass
    else:
        cnt+=1
        unit*100

    li[i] = cnt

print(li[n-1])

Failing test case input:
289

Expected output:
199


Actual output:
280


Fixed submission (verdict: Accepted):
n = int(input())

unit = 10
cnt = 0
flg = 1

for i in range(1,n+1):
    if i
        if flg==1:
            cnt+=1
    else:
        unit*=10
        flg^=1
        if flg==1:
            cnt+=1

print(cnt)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
keta = len(str(n))
if n == 1:
  print(n)
elif n == 2:
  print(n)
elif n == 3:
  ans = 9 + n - 99
  print(ans)
elif n == 4:
  ans = 999 - 99 + 9
  print(ans)
elif n == 5:
  ans = n - 9999 + 999 - 99 + 9
elif n == 6:
  print(90909)


Failing test case input:
289

Expected output:
199


Actual output:

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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
289

Expected output:
199


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
cou = 0
for i in range(1, n+1):
    num = len(str(i))
    if num%2:
        cou+=1
print (cou)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
cnt = 0
cnt += (n - 10 ** (len(str(n)) - 1) + 1) * (len(str(n)) % 2 == 1)
n -= n - 10 ** (len(str(n)) - 1) + 1
print(n, cnt)
if n == 0:
    print(cnt)
    exit()
for i in range(len(str(n))):
    if (len(str(n)) - i) % 2 == 1:
        cnt += 10 ** (len(str(n)) - i - 1) * 9
    print(len(str(n)) - i, cnt)
print(cnt)

Failing test case input:
289

Expected output:
199


Actual output:
99 190
2 190
1 199
199


Fixed submission (verdict: Accepted):
n = int(input())
cnt = 0
cnt += (n - 10 ** (len(str(n)) - 1) + 1) * (len(str(n)) % 2 == 1)
n -= n - 10 ** (len(str(n)) - 1) + 1
if n == 0:
    print(cnt)
    exit()
for i in range(len(str(n))):
    if (len(str(n)) - i) % 2 == 1:
        cnt += 10 ** (len(str(n)) - i - 1) * 9
print(cnt)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
count = 0
for i in range(a):
  if len(str(i)) % 2 == 1:
    count += 1
print(count - 1)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
a = int(input())
count = 0
for i in range(a + 1):
  if len(str(i)) % 2 == 1:
    count += 1
print(count - 1)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
count=0
for i in range(a+1):
    if int(len(str(i)))%2!=0:
        count+=1
    else:
        continue
print(count)


Failing test case input:
215

Expected output:
125


Actual output:
126


Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
n = int(input())

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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

numOfDigit = 1
answer = 0

n = 1
while(N >= n * 10):
    if (numOfDigit % 2):
        answer += n * 9
    numOfDigit += 1
    n *= 10

if (numOfDigit % 2):
    answer += N % n + 1

if (N < 10):
    answer = N

print(answer)


Failing test case input:
215

Expected output:
125


Actual output:
25


Fixed submission (verdict: Accepted):
N = int(input())

numOfDigit = 1
answer = 0

n = 1
while(N >= n * 10):
    if (numOfDigit % 2):
        answer += n * 9
    numOfDigit += 1
    n *= 10

if (numOfDigit % 2):
    answer += N % (n * 10) - n + 1

print(answer)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = len(str(n))

i = 0
c = 0
while i < l:
  if i == 0:
    if n < 10:
      c = n
      break
    else:
      c = 9
      i = i + 1
  elif i%2 == 1:
    i = i + 1
    continue
  elif i == (l-1):
    print(10**i)
    c = c + (n-((10**i)-1))
    i = i + 1
  else:
    c = c + ((10**l)-(10**(l-1)))
    i = i + 1

print(c)

Failing test case input:
289

Expected output:
199


Actual output:
100
199


Fixed submission (verdict: Accepted):
n = int(input())
l = len(str(n))
 
i = 0
c = 0
while i < l:
  if i == 0:
    if n < 10:
      c = n
      break
    else:
      c = 9
      i = i + 1
  elif i%2 == 1:
    i = i + 1
    continue
  elif i == (l-1):
    c = c + (n-((10**i)-1))
    i = i + 1
  else:
    c = c + ((10**(i+1))-(10**i))
    i = i + 1
 
print(c)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n=input()

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







Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):

n=input()

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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
ans=1
for i in range(1,x-1):
    if len(str(i))%2!=0:
        ans+=1
print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
198


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin


def main():
    N = stdin.readline().rstrip()
    N_num = int(N)

    if len(N) == 1:
        print(N_num)

    elif len(N) == 2:
        print(9)

    elif len(N) == 3:
        print(N_num % 100 + 10)

    elif len(N) == 4:
        print(909)

    elif len(N) == 5:
        print(N_num % 10000 + 910)

    elif len(N) == 6:
        print(90909)


if __name__ == "__main__":
    main()


Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):
from sys import stdin


def main():
    N = stdin.readline().rstrip()
    N_num = int(N)

    if len(N) == 1:
        print(N_num)

    elif len(N) == 2:
        print(9)

    elif len(N) == 3:
        print((N_num % 100) + (N_num

    elif len(N) == 4:
        print(909)

    elif len(N) == 5:
        print((N_num % 10000) + (N_num

    elif len(N) == 6:
        print(90909)


if __name__ == "__main__":
    main()

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
count = -1
a = int(input())
for row in range(a):
	if len(str(row)) % 2 == 0:
		pass
	else:
		count += 1
print(count)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
count = 0
a = int(input())
for row in range(a):
	if len(str(row + 1)) % 2 == 0:
		pass
	else:
		count += 1
print(count)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()

buff = int(N)
N = list(N)

keta = len(N)
ans = 0
if keta % 2 == 0:
    gain = 1
    for i in range(0, keta-1, 2):
        ans += (9*gain)
        gain = gain * 100

    print(ans)

else:
    if keta == 1:
        print(N[0])
        exit()

    gain = 1
    for i in range(0, keta-1, 2):
        ans += (9*gain)
        gain = gain * 100

    gg = 1
    for i in range(keta-1):
        gg *= 10

    ans += buff%gg+1
    print(ans)


Failing test case input:
215

Expected output:
125


Actual output:
25


Fixed submission (verdict: Accepted):
N = input()

buff = int(N)
N = list(N)

keta = len(N)
ans = 0
if keta % 2 == 0:
    gain = 1
    for i in range(0, keta-1, 2):
        ans += (9*gain)
        gain = gain * 100

    print(ans)

else:
    if keta == 1:
        print(N[0])
        exit()

    gain = 1
    for i in range(0, keta-1, 2):
        ans += (9*gain)
        gain = gain * 100

    gg = 9
    for i in range(keta-2):
        gg *= 10
        gg += 9
    
    ans += buff-gg
    print(ans)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(n))%2==1:ans+=1
print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
289


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())


cnt = 0

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

print(cnt)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
n = int(input())

cnt = 0

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

print(cnt)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
cnt = 0
for i in range(1,n+1):
  if len(str(i))%2 == 0:
    cnt += 1
print(cnt)


Failing test case input:
215

Expected output:
125


Actual output:
90


Fixed submission (verdict: Accepted):
n = int(input())
cnt = 0
for i in range(1,n+1):
  if len(str(i))%2 != 0:
    cnt += 1
print(cnt)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

input = sys.stdin.readline


def main():
    n = input().strip()
    int_n = int(n)
    keta = len(n)
    
    
    
    
    
    cnt = 0
    for i in range(1, keta + 1, 2):
        print(i)
        max_num = 10 ** (i) - 1
        min_num = 10 ** (i - 1) - 1
        cnt += max_num - min_num
        if keta == i:
            cnt -= max_num - int_n
    print(cnt)


if __name__ == "__main__":
    main()


Failing test case input:
289

Expected output:
199


Actual output:
1
3
199


Fixed submission (verdict: Accepted):
import sys

input = sys.stdin.readline


def main():
    n = input().strip()
    int_n = int(n)
    keta = len(n)
    
    
    
    
    
    cnt = 0
    for i in range(1, keta + 1, 2):
        max_num = 10 ** (i) - 1
        min_num = 10 ** (i - 1) - 1
        cnt += max_num - min_num
        if keta == i:
            cnt -= max_num - int_n
    print(cnt)


if __name__ == "__main__":
    main()

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
result = 0
for i in range(1, n):
    k = len(str(i))
    if k % 2 == 1:
        result += 1
print("{}".format(result))

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
n = int(input())
result = 0
for i in range(n):
    k = len(str(i+1))
    if k % 2 == 1:
        result += 1
print("{}".format(result))

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
l = len(str(a))

ans = 0
if l % 2 == 0:
    while l >= 1:
        ans += (10 ** (l - 1) - 1) - (10 ** (l - 2) - 1)
        l -= 2
else:
    ans += a - (10 ** (l - 1) - 1) - (10 ** (l - 2) - 1)
    l -= 1
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2

print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
190


Fixed submission (verdict: Accepted):
a = int(input())
l = len(str(a))

ans = 0
if l % 2 == 0:
    while l >= 1:
        ans += (10 ** (l - 1) - 1) - (10 ** (l - 2) - 1)
        l -= 2
else:
    ans += a - (10 ** (l - 1) - 1)
    l -= 1
    while l >= 1:
        ans += (10 ** (l - 1) - 1)  - (10 ** (l - 2) - 1)
        l -= 2

print(ans)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
cnt = 0
for i in range(N+1):
    if len(str(i+1)) % 2 != 0:
        cnt += 1
print (cnt)


Failing test case input:
215

Expected output:
125


Actual output:
126


Fixed submission (verdict: Accepted):
N = int(input())
cnt = 0

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

print (cnt)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
int_n = int(input())

n = str(int_n)

n_len = len(n)

ans = 0
tmp = 0

if n_len == 1:
    ans = int_n
else:
    for i in range(1,n_len):
        if i % 2 == 1:
            tmp = (10 ** i) - (10 ** (i-1))
            ans += tmp
    if (n_len % 2) == 1:
        tmp = int(n[1:]) + 1
        ans += tmp

print(ans)

Failing test case input:
215

Expected output:
125


Actual output:
25


Fixed submission (verdict: Accepted):
n = input()
int_n = int(n)
n_len = len(n)

ans = 0
tmp = 0

if n_len == 1:
    ans = int_n
else:
    for i in range(1,n_len):
        if i % 2 == 1:
            ans += (10 ** i) - (10 ** (i-1))
    if (n_len % 2) == 1:
        tmp = int_n - (10**(n_len-1)) + 1
        ans += tmp
print(ans)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
count=0
for i in range(1,a+1):
    i=str(i)
    if len(i)%2!=0:
        count+=1
    else:
        continue


Failing test case input:
289

Expected output:
199


Actual output:

Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print(len(list(filter(lambda n: n % 2 == 1, range(1, int(input()) + 1)))))


Failing test case input:
289

Expected output:
199


Actual output:
145


Fixed submission (verdict: Accepted):
print(len((list(filter(lambda n: len(str(n)) % 2 == 1, range(1, int(input()) + 1))))))

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

cnt = 0
for i in range(1,N):
  t = int(i / 100)
  if t % 2 == 1 or i < 10:
    cnt += 1

print (cnt)

Failing test case input:
215

Expected output:
125


Actual output:
109


Fixed submission (verdict: Accepted):
N = int(input())

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

print (cnt)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1 and len(s)> 1:
    c += int(s[1:])+1

print(c)






Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):
a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1 and len(s)> 1:
    c += int(s[1:])+1 + (int(s[0])-1)*(10**(len(s)-1))
elif len(s)==1:
    c +=a

print(c)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
count = 0
for i in range(s):
  g = str(i)
  a = len(g)
  if a % 2 != 0:
    count += 1
print(count-1)

Failing test case input:
289

Expected output:
199


Actual output:
198


Fixed submission (verdict: Accepted):
s = int(input())
count = 0
for i in range(s+1):
  g = str(i)
  a = len(g)
  if a % 2 != 0:
    count += 1
print(count-1)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

Failing test case input:
289

Expected output:
199


Actual output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
cnt =0
for i in range(1,1+n):
  if len(str(n)) % 2 == 1:
    cnt += 1
print(cnt)
      


Failing test case input:
215

Expected output:
125


Actual output:
215


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
a = len(n)
c = 0
for i in range(a - 1):
    if i % 2 == 0:
        c += 9 * 10 ** i
n = int(n)
if a % 2:
    c += n % 10 ** (a - 1) + 1
print(c)

Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):
n = input()
a = len(n)
c = 0
for i in range(a - 1):
    if i % 2 == 0:
        c += 9 * 10 ** i
n = int(n)
if a % 2:
    c += n - 10 ** (a - 1 ) + 1
print(c)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
215

Expected output:
125


Actual output:
25


Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

result = list(filter(lambda i: len(str(i)) % 2 != 0, range(1,N)))
print(len(result))

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
N = int(input())

result = list(filter(lambda i: len(str(i)) % 2 != 0, range(1,N+1)))
print(len(result))

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
if N<10:
  print(N)
elif N<100:
  print(9)
elif N<1000:
  print(N-91)
elif N<10000:
  print(909)
elif N<100000:
  print(N-9091)
else:
  print(90909)


Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
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)
else:
  print(90909)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



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

for i in range(d):
    if i%2 == 1: continue
    count += min(ans, 9*(10**i))
    ans -= 9*(10**i)

print(count)

Failing test case input:
289

Expected output:
199


Actual output:
289


Fixed submission (verdict: Accepted):



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

for i in range(d):
    if i%2 == 0: count += min(ans, 9*(10**i))
    ans -= 9*(10**i)

print(count)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
odd_num = 0
for i in range (1,N+1):
    if i%2==0:
        odd_num += 1
print(odd_num)

Failing test case input:
215

Expected output:
125


Actual output:
107


Fixed submission (verdict: Accepted):
N = int(input())
odd_num = 0
for i in range (1,N+1):
    if len(str(i))%2==1:
        odd_num += 1
print(odd_num)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
num = 0
for i in range(n):
  if len(str(n))%2 == 1:
    num += 1
print(num)

Failing test case input:
215

Expected output:
125


Actual output:
215


Fixed submission (verdict: Accepted):
n = int(input())
num = 0
for i in range(n):
  if len(str(i+1))%2 == 1:
    num += 1
print(num)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
digit=1
count=0
while(10**digit<n):
  if(digit%2==1):
    count=count+9*10**(digit-1)
  digit=digit+1
if(digit%2==1):
  count=count+n-10**(digit-1)
print(count)


Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
n=int(input())
digit=1
count=0
while(10**digit<=n):
  if(digit%2==1):
    count=count+9*10**(digit-1)
  digit=digit+1
if(digit%2==1):
  count=count+n-10**(digit-1)+1
print(count)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = 0

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


Failing test case input:
289

Expected output:
199


Actual output:
145


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
str_n = str(n)
keta = len(str_n)
res = 0
for num in range(1, keta, 2):
  res += 9 * (10 ** (num - 1))
if(keta % 2 == 1):
  last = 0
  if(keta == 1):
    last = n
  else:
  	last = (int(str_n[1:]) + 1) + (int(str_n[0]) - 1) * 9 * len(str_n[1:])
  res += last
print(res)

Failing test case input:
215

Expected output:
125


Actual output:
43


Fixed submission (verdict: Accepted):
n = int(input())
str_n = str(n)
keta = len(str_n)
res = 0
for num in range(1, keta, 2):
  res += 9 * (10 ** (num - 1))
if(keta % 2 == 1):
  last = 0
  if(keta == 1):
    last = n
  else:
    last = (n - 10 ** len(str_n[1:])) + 1
  res += last
print(res)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

ans = 0

for i in range(n):
  if 1<=i<=9:
    ans += 1
    break
  if 100<=i<=999:
    ans += 1
    break
  if 10000<=i<=99999:
    ans += 1
    break
print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())

ans = 0

for i in range(n+1):
  
    if 1<=i<=9:
      ans += 1
      continue
    if 100<=i<=999:
      ans += 1
      continue
    if 10000<=i<=99999:
      ans += 1
      continue
print(ans)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

str = "37"

num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int("9"*(numbers))
while numbers > 0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)

Failing test case input:
289

Expected output:
199


Actual output:
9


Fixed submission (verdict: Accepted):
str = input()
num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int("9"*(numbers))
while numbers > 0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
cnt=0

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

print(cnt)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
n=int(input())
cnt=0

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

print(cnt)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

count = 0
for n in range(1, N):
    if not (len(str(n)) / 2).is_integer():
        count += 1

print(count)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
N = int(input())

count = 0
for n in range(1, N + 1):
    if not (len(str(n)) / 2).is_integer():
        count += 1

print(count)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
a=0
for i in range(int(n)):
  lenn = len(range(i))
  N = lenn % 2
  if N == 0:
    a = a + 1
print(a)

Failing test case input:
289

Expected output:
199


Actual output:
145


Fixed submission (verdict: Accepted):
n = input()
a=0
for i in range(int(n)):
  lenn = len(str(i+1))
  N = lenn % 2
  if N == 1:
    a = a + 1
print(a)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
if len(N) == 1:
    print(N)
elif len(N) == 2:
    print(9)
elif len(N) == 3:
    print(9 + int(N[0])*100 - 100 + int(N[1:]))
elif len(N) == 4:
    print(9 + 900)
elif len(N) == 5:
    print(9 + 900 + 10000*int(N[0]) - 10000 + int(N[1:]))
elif len(N) == 6:
    print(9 + 900 + 90000)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
N = input()
if len(N) == 1:
    print(N)
elif len(N) == 2:
    print(9)
elif len(N) == 3:
    print(9 + int(N[0])*100 - 100 + int(N[1:]) + 1)
elif len(N) == 4:
    print(9 + 900)
elif len(N) == 5:
    print(9 + 900 + 10000*int(N[0]) - 10000 + int(N[1:]) + 1)
elif len(N) == 6:
    print(9 + 900 + 90000)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
re =0
for i in range(1,num+1):
    if len(str(i)) % 2 != 0:
        re += 1
        print(re)
        


Failing test case input:
215

Expected output:
125


Actual output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


Fixed submission (verdict: Accepted):
num = int(input())
re =0
for i in range(1,num+1):
    if len(str(i)) % 2 != 0:
        re += 1
print(re)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

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

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

print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):


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

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

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

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

  print(ans)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
nlen = len(N)
cnt = 0
for i in range(1, nlen):
  if i % 2:
    cnt += (10 ** i) - (10 ** (i - 1))
print(cnt)
N = int(N)
if nlen % 2:
  cnt += N - 10 ** (nlen - 1) + 1
print(cnt)

Failing test case input:
289

Expected output:
199


Actual output:
9
199


Fixed submission (verdict: Accepted):
N = input()
nlen = len(N)
cnt = 0
for i in range(1, nlen):
  if i % 2:
    cnt += (10 ** i) - (10 ** (i - 1))
N = int(N)
if nlen % 2:
  cnt += N - 10 ** (nlen - 1) + 1
print(cnt)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
count = 0
for i in range(1,a):
  if len(str(i))%2 != 0:
    count += 1
print(count)

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
a = int(input())
count = 0
for i in range(1,a+1):
  if len(str(i))%2 != 0:
    count += 1
print(count)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
n = len(list(str(N)))
if n >= 5:
  ans = 90909
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + (N % 100 + 1)
elif n >= 2:
  ans = 9
else:
  ans = N
print(ans)

Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):
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)
Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
c = 0
for i in range(1, N+1):
    if len(str(N)) % 2 == 1:
        c += 1
print(c)

Failing test case input:
289

Expected output:
199


Actual output:
289


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

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
289

Expected output:
199


Actual output:
9
9
199


Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
count = 0
for i in range(N):
  if i % 2 == 0:
    continue
  else:
    count += 1
print(count)

Failing test case input:
215

Expected output:
125


Actual output:
107


Fixed submission (verdict: Accepted):
N = int(input())
count = 0
for i in range(1, N+1):
  if len(str(i)) % 2 == 0:
    continue
  else:
    count += 1
print(count)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N <= 9:
  print(N)
elif 10 <= N <= 99:
  print(9)
elif 100 <= N <= 9999:
  print(909)
elif 10000 <= N <= 100000:
  print(90909)

Failing test case input:
289

Expected output:
199


Actual output:
909


Fixed submission (verdict: Accepted):
N = int(input())
if N <= 9:
  print(N)
elif 10 <= N <= 99:
  print(9)
elif 100 <= N <= 999:
  print(N-90)
elif 1000 <= N <= 9999:
  print(909)
elif 10000 <= N <= 99999:
  print(N-9090)
else:
  print(90909)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

Failing test case input:
215

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
N = int(input())

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

Problem: p02952
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = input()

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

print(count)

Failing test case input:
289

Expected output:
199


Actual output:
190


Fixed submission (verdict: Accepted):
N = input()

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

print(int(count))
Problem: p02952
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n= int(input())
res = 0
for i in range(1,n+1):
    if i%2 == 1:
        res += 1
print(res)

Failing test case input:
289

Expected output:
199


Actual output:
145


Fixed submission (verdict: Accepted):
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)

Problem: p02952
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m=int(input())
ans=0
for i in range(m+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)



Failing test case input:
289

Expected output:
199


Actual output:
200


Fixed submission (verdict: Accepted):
m=int(input())
ans=0
for i in range(1,m+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)

Problem: p02952
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
num = [i for i in range (1,int(input())+1)]
ans = 0

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

print(ans)

Failing test case input:
215

Expected output:
125


Actual output:
25


Fixed submission (verdict: Accepted):
num = [i for i in range (1,int(input())+1)]
ans = 0

if num[-1]<=9 :
	ans = num[-1]
elif num[-1]<=99 :
	ans = 9
elif num[-1]<=999 :
	ans = num[-1]-90
elif num[-1]<=9999:
	ans = 909
elif num[-1]<=99999 :
	ans = num[-1]-9090
else :
	ans = 90909

print(ans)

Problem: p02952
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
rank = len(str(n))
first = int(str(n)[0])

ans = 0

for i in range( rank ):
    if i % 2 != 0:
        ans += 9 * 10 ** (i-1)
if rank % 2 != 0:
    ans += ( first - 1 ) * (10 ** rank)
    ans += n - first * ( 10 ** rank ) + 1
print ( ans )

Failing test case input:
289

Expected output:
199


Actual output:
-701


Fixed submission (verdict: Accepted):
n = int(input())
rank = len(str(n))
first = int(str(n)[0])

ans = 0

for i in range( rank ):
    if i % 2 != 0:
        ans += 9 * 10 ** (i-1)
if rank % 2 != 0:
    ans += ( first - 1 ) * (10 ** (rank-1))
    ans += n - first * ( 10 ** (rank-1) ) + 1
print ( ans )

Problem: p02952
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
from operator import itemgetter
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
keta = len(str(n))
rs = 0
if keta % 2 == 1:
    rs += n % (10 ** (keta - 1)) + 1
li = [0, 9, 0, 900, 0, 90000]
keta -= 1
while keta > 0:
    rs += li[keta]
    keta -= 1
print(rs)

Failing test case input:
289

Expected output:
199


Actual output:
99


Fixed submission (verdict: Accepted):
import sys
from operator import itemgetter
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
keta = len(str(n))
rs = 0
if keta % 2 == 1:
    rs += n - (10 ** (keta - 1)) + 1
li = [0, 9, 0, 900, 0, 90000]
keta -= 1
while keta > 0:
    rs += li[keta]
    keta -= 1
print(rs)