結果
| 問題 |
No.2053 12345...
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2022-12-30 02:28:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 182 bytes |
| コンパイル時間 | 790 ms |
| コンパイル使用メモリ | 82,136 KB |
| 実行使用メモリ | 142,908 KB |
| 最終ジャッジ日時 | 2024-11-25 00:35:27 |
| 合計ジャッジ時間 | 5,134 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 7 |
ソースコード
from collections import *
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
ans = 0
for a in A:
ans += D[a - 1]
D[a] += D[a - 1] + 1
print(ans)
rlangevin