传统题 1000ms 256MiB

C - Doubled

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

C - Doubled

Score : $300$ points

Problem Statement

Given is an integer $N$.
How many integers $x$ between $1$ and $N$ (inclusive) satisfy the following condition?

  • The decimal representation (without leading zeros) of $x$ has an even number of digits, and its first and second halves are equal as strings.

Constraints

  • $N$ is an integer.
  • $1 ≤ N < 10^{12}$

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.


33
3

Three numbers $11$, $22$, and $33$ satisfy the condition.


1333
13

For example, the decimal representation of $1313$ has four digits, and its first and second halves are both $13$, so $1313$ satisfies the condition.


10000000
999

2024春季入门组刷题营(七)

未参加
状态
已结束
规则
IOI
题目
8
开始于
2024-4-21 13:00
结束于
2024-4-21 15:00
持续时间
2 小时
主持人
参赛人数
12