結果
| 問題 |
No.2752 文字列の数え上げ mod 998244353
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-10 22:52:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 571 bytes |
| コンパイル時間 | 1,961 ms |
| コンパイル使用メモリ | 192,872 KB |
| 最終ジャッジ日時 | 2025-02-21 13:05:08 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll MOD=998244353;
void solve();
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int test_case;
cin>>test_case;
while (test_case--){
solve();
}
}
namespace Lib{
ll modpow(ll a,ll n){
long long ret=1,t=a;
while(n>0){
if(n&1)ret=ret*t%MOD;
t=t*t%MOD;
n/=2;
}
return ret;
}
}
constexpr ll inv25=319438193;
void solve(){
ll L;
cin>>L;
cout<<(Lib::modpow(26,L)+MOD-1)%MOD*inv25%MOD*26%MOD<<'\n';
}