結果
| 問題 |
No.1268 Fruit Rush 2
|
| コンテスト | |
| ユーザー |
tyawanmusi
|
| 提出日時 | 2020-10-23 22:44:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 845 ms / 2,000 ms |
| コード長 | 232 bytes |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 92,732 KB |
| 最終ジャッジ日時 | 2024-07-21 11:43:56 |
| 合計ジャッジ時間 | 13,305 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
n=int(input()) a=list(map(int,input().split())) a.sort() ans=0 from collections import defaultdict d1=defaultdict(int) d2=defaultdict(int) for i in a: d1[i]+=1 d2[i+1]+=d1[i]*d2[i-1]+d1[i]*d1[i-1] ans+=d2[i+1]+d1[i] print(ans)
tyawanmusi