結果

問題 No.2752 文字列の数え上げ mod 998244353
ユーザー hitonanode
提出日時 2024-05-10 22:30:19
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 1,061 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 06:24:33
合計ジャッジ時間 2,309 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

#include <atcoder/modint>
using mint = atcoder::modint998244353;

mint solve(long long L) {
    const mint D = 26;
    return (D.pow(L + 1) - D) / (D - 1);
}

int main() {
    cin.tie(nullptr), ios::sync_with_stdio(false);

    int T;
    cin >> T;
    while (T--) {
        long long L;
        cin >> L;
        cout << solve(L).val() << '\n';
    }
}
0