結果
問題 |
No.2752 文字列の数え上げ mod 998244353
|
ユーザー |
![]() |
提出日時 | 2024-05-10 21:36:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 58 ms / 2,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 1,778 ms |
コンパイル使用メモリ | 195,308 KB |
最終ジャッジ日時 | 2025-02-21 12:24:08 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/modint> using namespace std; using mint = atcoder::modint998244353; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int t; cin >> t; mint inv25 = mint(25).inv(); for (; t--;) { long long l; cin >> l; mint ans = mint(26).pow(l + 1) - 26; ans *= inv25; cout << ans.val() << "\n"; } }