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.