結果
| 問題 |
No.1470 Mex Sum
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-04-09 22:05:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 2,000 ms |
| コード長 | 172 bytes |
| コンパイル時間 | 177 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 106,752 KB |
| 最終ジャッジ日時 | 2024-06-25 05:34:14 |
| 合計ジャッジ時間 | 6,547 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 49 |
ソースコード
import collections N = int(input()) A = list(map(int, input().split())) CA = collections.Counter(A) print( N*(N-1)//2 + CA[1]*(N-CA[1]) + CA[1]*(CA[1]-1)//2 + CA[1]*CA[2])
H20