結果
| 問題 | 
                            No.2055 12x34...
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-08-21 13:36:36 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 185 bytes | 
| コンパイル時間 | 388 ms | 
| コンパイル使用メモリ | 82,212 KB | 
| 実行使用メモリ | 120,892 KB | 
| 最終ジャッジ日時 | 2024-10-10 06:06:26 | 
| 合計ジャッジ時間 | 5,481 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 5 WA * 36 | 
ソースコード
n = int(input())
A = list(map(int,input().split()))
mod = 998244353
ans = 0
dic = {}
for a in A:
    ans += dic.get(a-1,0)
    ans %= mod
    dic[a] = (dic.get(a-1,0)+1)%mod
print(ans)