-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1748.py
More file actions
35 lines (31 loc) · 682 Bytes
/
1748.py
File metadata and controls
35 lines (31 loc) · 682 Bytes
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
##### Time Over #####
# num = int(input())
# answer = 0
# for i in range(1,num+1):
# answer += len(str(i))
# print(answer)
##### Mine #####
# num = int(input())
# answer = 0
# num_len = len(str(num))
# if num<10:
# answer = num
# else:
# div = 10**(num_len-1)
# answer += (num%div+1)*num_len
# answer += ((num//div)-1)*div*num_len
# num_len-=1
# while num_len > 0:
# answer += 9*(10**(num_len-1))*num_len
# num_len-=1
# print(answer)
##### Short & Ez #####
num = input()
num_len = len(num) - 1
c = 0
i = 0
while i < num_len:
c += 9 * (10 ** i) * (i + 1)
i += 1
c += ((int(num) - (10 ** num_len)) + 1) * (num_len + 1)
print(c)