問題一覧 > 通常問題

No.2156 Zoi Strings

レベル : / AI推定難易度 : 1100 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 148
作問者 : hibit_at / テスター : kotamanegi KowerKoint2010 keisuke6 Michirakara
お気に入りにしたユーザー ProblemId : 8813 / 自分の提出
問題文最終更新日: 2022-12-06 09:20:36
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 371 (Asakatsu Presents) (順位表) の他の問題:

Problem Statement

On the Discord server "Asakatsu", it has become a habit to post messages such as "ぞい", "ぞいぞい", and "ぞぞい" before contests.

Such strings are called "zoi strings".

A zoi string is defined as a string satisfying the following properties.

  • The string consists only of "ぞ" and "い".
  • The string starts with "ぞ".
  • The string contains at least one "い".
  • The string must not contain 2 consecutive "い".

Given a positive integer $N$, find the number of zoi strings of length $N$, modulo 998244353.

Input

$N$

  • $N$ is an integer.
  • $2 \leq N \leq 10^{18}$

Output

Output an integer on $1$ line. Print a newline at the end.

Sample

Sample 1
Input
2
Output
1

The only possible zoi string is "ぞい".

Sample 2
Input
4
Output
4

There are $4$ possibilities: "ぞぞぞい", "ぞいぞい", "ぞぞいぞ", and "ぞいぞぞ".

Sample 3
Input
100000
Output
56136313

A zoi string can be fairly long.

Output the remainder when divided by 998244353.

Sample 4
Input
1000000000000000000
Output
332172356

A zoi string can be very long.

Output the remainder when divided by 998244353.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。