結果
| 問題 |
No.1755 Almost Palindrome
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-20 14:07:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 172 ms / 2,000 ms |
| コード長 | 350 bytes |
| コンパイル時間 | 775 ms |
| コンパイル使用メモリ | 68,492 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-06-11 15:01:00 |
| 合計ジャッジ時間 | 1,370 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
int T,N;
main()
{
cin>>T;
for(;T--;)
{
cin>>N;
mint ans;
if(N%2==1)
{
ans=(N-1)/2*mint(26).pow((N-1)/2)*25*2;
}
else
{
int n=N/2;
ans=(2*n*mint(26).pow(n-1)-(mint(26).pow(n)-1)/25)*26*25;
}
cout<<ans.val()<<endl;
}
}