結果

問題 No.2752 文字列の数え上げ mod 998244353
ユーザー kusaf_
提出日時 2024-05-13 02:13:52
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 3,182 ms
コンパイル使用メモリ 245,820 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 09:21:24
合計ジャッジ時間 4,832 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;

const mint inv = mint(25).inv();

void solve() {
  ll N;
  cin >> N;

  cout << ((mint(26).pow(N) - 1) * 26 * inv).val() << "\n";
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll t;
  cin >> t;
  while(t--) { solve(); }
}
0