結果
| 問題 |
No.2055 12x34...
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-26 22:46:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 207 bytes |
| コンパイル時間 | 249 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 489,836 KB |
| 最終ジャッジ日時 | 2024-09-29 11:46:52 |
| 合計ジャッジ時間 | 12,557 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 31 RE * 5 |
ソースコード
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
res = 0
d = defaultdict(int)
for i in range(n):
c = d[a[i] - 1]
res += c
d[a[i]] += c + 1
print(res)