結果
| 問題 | No.1755 Almost Palindrome |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-20 14:07:34 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 2,000 ms |
| コード長 | 350 bytes |
| 記録 | |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 75,548 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-08 19:10:09 |
| 合計ジャッジ時間 | 898 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}