結果
問題 | No.2926 Botaoshi |
ユーザー |
![]() |
提出日時 | 2024-10-12 15:32:21 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 153 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 87,168 KB |
最終ジャッジ日時 | 2024-10-12 15:32:59 |
合計ジャッジ時間 | 5,551 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 42 |
ソースコード
N = int(input())S = list(input())DP = [0]*3mod = 998244353v = list('LRU.').index(S[0])if v==3:DP=[1]*3else:DP[v]=1for s in S[1:]:NDP = [0]*3if s=='L' or s=='.':NDP[0]=(DP[0]+DP[2])%modif s=='R' or s=='.':NDP[1]=sum(DP)%modif s=='U' or s=='.':NDP[2]=sum(DP)%modDP = NDPprint(sum(DP)%mod)