結果
| 問題 | 
                            No.2055 12x34...
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ntuda
                         | 
                    
| 提出日時 | 2022-08-23 23:30:49 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 224 bytes | 
| コンパイル時間 | 370 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 495,960 KB | 
| 最終ジャッジ日時 | 2024-10-11 05:58:03 | 
| 合計ジャッジ時間 | 14,321 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 5 WA * 31 RE * 5 | 
ソースコード
from collections import defaultdict
N = int(input())
A = list(map(int,input().split()))
sum0 = defaultdict(int)
cnt = defaultdict(int)
for a in A:
    cnt[a] += 1
    sum0[a] += sum0[a-1] + cnt[a-1]
print(sum(sum0.values()))
            
            
            
        
            
ntuda