結果
| 問題 | No.1470 Mex Sum |
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-04-09 22:05:22 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| + 504µs | |
| コード長 | 172 bytes |
| 記録 | |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 95,720 KB |
| 実行使用メモリ | 112,064 KB |
| 最終ジャッジ日時 | 2026-07-29 16:04:12 |
| 合計ジャッジ時間 | 7,809 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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