問題一覧 > 通常問題

No.3584 Camouflage Mole

レベル : / AI推定難易度 : 600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 68
作問者 : marc2825 / テスター : siganai
お気に入りにしたユーザー ProblemId : 13242 / 自分の提出
問題文最終更新日: 2026-08-29 00:42:22
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 504 (順位表) の他の問題:

Problem Statement

The string camouflage contains mole hidden as a (not necessarily contiguous) subsequence.

For a string \(S\) of length \(N\) consisting of the 26 lowercase English letters a-z, define \(f(S)\) as "the number of (not necessarily contiguous) subsequences of \(S\) that are equal to the string mole"†.

There are \(26^N\) lowercase English strings of length \(N\) in total. Find the sum of \(f(S)\) over all these strings \(S\), modulo \(998244353\).


† More precisely, \(f(S)\) is the number of $4$-tuples \((i,j,k,l)\) satisfying \(1 \le i < j < k < l \le N\) and \(S_i=\mathrm{m},\ S_j=\mathrm{o},\ S_k=\mathrm{l},\ S_l=\mathrm{e}\).

Constraints

  • \(4 \le N \le 2 \times 10^5\)
  • All inputs are integers.

Input

The input is given from standard input in the following format.

$N$

Output

Print the answer modulo \(998244353\) on a single line.

Sample

Sample 1
Input
4
Output
1

The only string of length 4 that contains mole as a subsequence is the string mole itself.

Sample 2
Input
6
Output
10140

Sample 3
Input
100
Output
774511835

Since the answer can be very large, print it modulo $998244353$.

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