結果
問題 |
No.1470 Mex Sum
|
ユーザー |
|
提出日時 | 2021-04-24 17:35:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 250 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 25,060 KB |
最終ジャッジ日時 | 2024-07-04 09:09:21 |
合計ジャッジ時間 | 17,433 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 10 TLE * 1 -- * 38 |
ソースコード
N = int(input()) A = list(map(int, input().split())) print(len(A)) A.sort() n = 0 for i in range(N): if A[i] > 1: n += N-1-i else: cnt1 = A[i+1:].count(2) cnt2 = N-1-i-cnt1 n += 3 * cnt1 + 2 * cnt2 print(n)