QOJ.ac

QOJ

Limite de temps : 0.3 s Limite de mémoire : 256 MB Points totaux : 100

#2382. 数字

Statistiques

回文数是指一个从左向右读和从右向左读都一样的整数。例如,数字 $142241$ 和 $102201$ 是回文数,而 $1023401$ 和 $10510$ 则不是。你需要将一个数字 $n$ 表示为两个回文数之和。请找出实现这一目标的方案数。

输入格式

仅一行,包含一个整数 $n$ ($1 \le n \le 10^{18}$)。

输出格式

输出一个数字,即表示 $n$ 为两个回文数之和的方案数。

样例

样例输入 1

156

样例输出 1

4

样例输入 2

9524

样例输出 2

4

样例输入 3

42657

样例输出 3

6

样例输入 4

5735832847451

样例输出 4

28

说明

在第一个测试中,以下数字对是符合条件的:$(5, 151), (55, 101), (101, 55), (151, 5)$。

在第二个测试中,以下数字对是符合条件的:$(515, 9009), (636, 8888), (8888, 636), (9009, 515)$。

在第三个测试中,以下数字对是符合条件的:$(33, 42624), (333, 42324), (4884, 37773), (37773, 4884), (42324, 333), (42624, 33)$。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.