結果

問題 No.1470 Mex Sum
ユーザー H20
提出日時 2021-04-09 21:33:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 151 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 107,112 KB
最終ジャッジ日時 2024-06-25 04:25:27
合計ジャッジ時間 6,520 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N = int(input())
A = list(map(int, input().split())) 
CA = collections.Counter(A)
print(N*(N-1)//2+CA[1]*(CA[1]-1)//2+CA[1]*CA[2]*2)
0