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