QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 2048 MB 總分: 100

#24214. 圣诞节的 n 天

统计

本题是一道计分(SCORED)题。共有十个数据子组,各子组将独立评测。通过某个子组中的所有测试数据将获得本题 $0.1$ 的分数(排行榜上会显示为 $0.1$,但在 Kattis 的返回结果中可能显示为 $10$)。通过全部十个子组中的所有测试数据将获得 $1$ 道完整题目的分数。你可以继续提交代码以尝试提高你的得分。

本题的时间罚时按如下规则计算:

  • 从比赛开始到使你得分增加的最后一次提交为止,每分钟记一分罚时。

  • 在该最后一次增加得分的提交之前,每次未能增加得分的提交记二十分罚时,但编译错误除外(编译错误不计罚时)。

  • 如果你的得分始终未超过零,则不计任何罚时。

还记得那首《圣诞节的十二天》("The 12 Days of Christmas")吗?

“在圣诞节的第一天,我的挚爱送给我:梨树上的一只山鹑。”

太棒了。我本来想要一部 iPhone 的。

“在圣诞节的第二天,我的挚爱送给我:两只斑鸠,以及梨树上的一只山鹑。”

好吧,现在我有四只鸟了:今天的两只斑鸠和一只山鹑,加上昨天的一只山鹑。我的猫都要疯了。

“在圣诞节的第三天,我的挚爱送给我:三只法国母鸡、两只斑鸠,以及梨树上的一只山鹑。”

怎么全是鸟?今天又多了六只,所以我现在一共有十只鸟,而且根本没地方放(除非塞进猫肚子里)。我的挚爱还能把这事持续多久?

给定一个整数 $n$,在 $n$ 天之后我一共收到了多少件礼物?由于这个数值可能很大,请将其对 $998\,244\,353$ 取模后输出。

输入格式

输入仅一行,包含一个整数 $n$,表示我的挚爱送给我礼物的天数。

共有十个数据子组,每个子组对 $n$ 有不同的范围限制:

  1. ($1 \le n \le 10$)

  2. ($10 < n \le 1\,000$)

  3. ($1\,000 < n \le 10^5$)

  4. ($10^5 < n \le 10^7$)

  5. ($10^7 < n \le 10^9$)

  6. ($10^9 < n \le 10^{11}$)

  7. ($10^{11} < n \le 10^{13}$)

  8. ($10^{13} < n \le 10^{15}$)

  9. ($10^{15} < n \le 10^{17}$)

  10. ($10^{17} < n \le 10^{18}$)

输出格式

输出一个整数,表示恰好 $n$ 天后我收到的礼物总数。由于这个数可能非常大,请将其对 $998\,244\,353$ 取模后输出。

样例

输入格式 1

1

输出格式 1

1

输入格式 2

2

输出格式 2

4

输入格式 3

3

输出格式 3

10

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.