結果

問題 No.1470 Mex Sum
ユーザー Super SolenoidSuper Solenoid
提出日時 2021-05-03 00:32:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 16,372 KB
最終ジャッジ日時 2023-09-28 14:58:33
合計ジャッジ時間 6,654 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,752 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 24 ms
8,816 KB
testcase_03 AC 22 ms
8,852 KB
testcase_04 AC 23 ms
9,032 KB
testcase_05 AC 23 ms
8,788 KB
testcase_06 AC 24 ms
8,944 KB
testcase_07 AC 24 ms
8,836 KB
testcase_08 AC 23 ms
8,932 KB
testcase_09 AC 23 ms
8,932 KB
testcase_10 AC 23 ms
8,932 KB
testcase_11 AC 23 ms
8,860 KB
testcase_12 AC 88 ms
15,360 KB
testcase_13 AC 87 ms
15,392 KB
testcase_14 AC 87 ms
15,472 KB
testcase_15 AC 88 ms
15,632 KB
testcase_16 AC 86 ms
15,424 KB
testcase_17 AC 85 ms
15,240 KB
testcase_18 AC 85 ms
15,348 KB
testcase_19 AC 87 ms
15,420 KB
testcase_20 AC 87 ms
15,280 KB
testcase_21 AC 89 ms
15,668 KB
testcase_22 AC 89 ms
16,228 KB
testcase_23 AC 89 ms
16,244 KB
testcase_24 AC 89 ms
16,144 KB
testcase_25 AC 89 ms
16,204 KB
testcase_26 AC 89 ms
16,272 KB
testcase_27 AC 89 ms
16,176 KB
testcase_28 AC 89 ms
16,204 KB
testcase_29 AC 90 ms
16,184 KB
testcase_30 AC 89 ms
16,176 KB
testcase_31 AC 90 ms
16,260 KB
testcase_32 AC 89 ms
16,224 KB
testcase_33 AC 90 ms
16,372 KB
testcase_34 AC 89 ms
16,152 KB
testcase_35 AC 89 ms
16,200 KB
testcase_36 AC 91 ms
16,196 KB
testcase_37 AC 80 ms
12,084 KB
testcase_38 AC 79 ms
12,076 KB
testcase_39 AC 80 ms
12,060 KB
testcase_40 AC 82 ms
12,108 KB
testcase_41 AC 82 ms
12,152 KB
testcase_42 AC 82 ms
12,028 KB
testcase_43 AC 83 ms
12,056 KB
testcase_44 AC 82 ms
12,036 KB
testcase_45 AC 82 ms
12,108 KB
testcase_46 AC 84 ms
12,200 KB
testcase_47 AC 83 ms
12,100 KB
testcase_48 AC 83 ms
12,016 KB
testcase_49 AC 83 ms
11,964 KB
testcase_50 AC 83 ms
12,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

B = [int(s) for s in A if s>2]
C = [int(s) for s in A if s==2]
D = [int(s) for s in A if s<2]

b = len(B)
c = len(C)
d = len(D)

mex = (b+c)*(b+c-1)/2 +d*(d+2*b+3*c-1)
print(int(mex))
0