結果
| 問題 |
No.1755 Almost Palindrome
|
| コンテスト | |
| ユーザー |
PCTprobability
|
| 提出日時 | 2021-10-16 01:17:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 315 ms / 2,000 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 347 ms |
| コンパイル使用メモリ | 82,180 KB |
| 実行使用メモリ | 84,352 KB |
| 最終ジャッジ日時 | 2025-01-03 12:34:33 |
| 合計ジャッジ時間 | 1,444 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
ソースコード
mod=998244353
dp=[0]*(1000100)
dp[1]=0
dp[2]=26*25
x=1
for i in range (3,1000100):
dp[i]+=dp[i-2]*26
dp[i]+=x*26*25*2-26*25*((i-1)%2)
dp[i]%=mod
if i%2==1:
x*=26
x%=mod
t=int(input())
for i in range (t):
n=int(input())
print(dp[n])
PCTprobability