QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 1024 MB 満点: 100 ハック可能 ✓

#15104. 绝对不是质数

統計

如果一个正整数不是素数,且无法通过从其十进制表示中删除某些数位来获得一个素数,则称该正整数为 antiprime 数。例如,104 是 antiprime 数,因为 0、1、4、10、14 和 104 都不是素数;但 2024 不是 antiprime 数,因为我们可以删除第一、二和四个数位,从而得到素数 2。

注意,素数是指恰好有两个不同正因数(1 和它本身)的整数。

给定一个整数 $n$,请计算恰好有 $n$ 位十进制数(无前导零)且是 antiprime 数的数字个数,结果对 $998\,244\,353$ 取模。

输入格式

输入包含一个整数 $n$ ($1 \le n \le 10^6$)。

输出格式

输出一个整数 —— $n$ 位 antiprime 数的数量对 $998\,244\,353$ 取模后的结果。

样例

输入样例 1

1

输出样例 1

5

说明

样例中提到的 1 位 antiprime 数有 1, 4, 6, 8 和 9。

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.