問題一覧 > 教育的問題

No.2752 Counting Strings mod 998244353

レベル : / AI推定難易度 : 500 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 91
作問者 : 👑 p-adic / テスター : 👑 箱星 taiga0629kyopro
お気に入りにしたユーザー ProblemId : 8619 / 自分の提出
問題文最終更新日: 2023-03-06 12:21:44
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 429 (順位表) の他の問題:

Problem Statement

Consider the following problem:

A positive integer $L$ is given as input.

Find the total number of strings of length at least $1$ and at most $L$ consisting only of lowercase English letters, modulo $998244353$. (Hereafter, this value is called the answer to this problem.)

 

A positive integer $T$ is given at the beginning of the input. Then, answer $T$ problems.

Input

The input is given from Standard Input in $1 + T$ lines in the following format:

  • Line $1$ contains $T$.
  • For each positive integer $t$ not exceeding $T$, line $1+t$ contains the input $L$ for the $t$-th problem.

Constraints

The input satisfies the following constraints:

  • $T$ is an integer satisfying $1 \leq T \leq 10^5$
  • The input $L$ for each problem is an integer satisfying $1 \leq L \leq 10^{18}$

Output

For each positive integer $t$ not exceeding $T$, output the answer to the $t$-th problem on line $t$.

Print a newline at the end.

Sample

Sample 1
Input
1
1
Output
26

There are $26$ strings of length $1$ consisting only of lowercase English letters. The remainder of $26$ divided by $998244353$ is $26$.

Sample 2
Input
3
2
1
2

As this shows, $L$ may not be monotonically increasing.

Output
702
26
702

There are $26$ strings of length $1$ and $26^2 = 676$ strings of length $2$ consisting only of lowercase English letters. The remainder of $26 + 676 = 702$ divided by $998244353$ is $702$.

Sample 3
Input
1
8
Output
561122557

There are $217180147158$ strings of length at least $1$ and at most $8$ consisting only of lowercase English letters. The remainder of $217180147158$ divided by $998244353$ is $561122557$.

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