結果

問題 No.1755 Almost Palindrome
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2021-10-16 01:17:13
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 86,304 KB
最終ジャッジ日時 2023-09-01 23:28:35
合計ジャッジ時間 1,768 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
83,640 KB
testcase_01 AC 93 ms
83,844 KB
testcase_02 AC 330 ms
86,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0