結果

問題 No.1470 Mex Sum
ユーザー convexineqconvexineq
提出日時 2021-04-09 21:29:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 167 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 110,044 KB
最終ジャッジ日時 2023-09-07 09:55:59
合計ジャッジ時間 8,254 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,228 KB
testcase_01 AC 72 ms
71,484 KB
testcase_02 AC 79 ms
77,288 KB
testcase_03 AC 82 ms
77,360 KB
testcase_04 AC 84 ms
77,708 KB
testcase_05 AC 80 ms
77,452 KB
testcase_06 AC 81 ms
77,732 KB
testcase_07 AC 79 ms
77,452 KB
testcase_08 AC 81 ms
77,724 KB
testcase_09 AC 79 ms
77,772 KB
testcase_10 AC 79 ms
77,808 KB
testcase_11 AC 81 ms
77,428 KB
testcase_12 AC 123 ms
109,968 KB
testcase_13 AC 124 ms
110,044 KB
testcase_14 AC 125 ms
109,936 KB
testcase_15 AC 123 ms
109,876 KB
testcase_16 AC 123 ms
109,928 KB
testcase_17 AC 125 ms
109,840 KB
testcase_18 AC 124 ms
109,932 KB
testcase_19 AC 124 ms
109,968 KB
testcase_20 AC 121 ms
110,036 KB
testcase_21 AC 122 ms
109,576 KB
testcase_22 AC 122 ms
109,648 KB
testcase_23 AC 124 ms
109,392 KB
testcase_24 AC 121 ms
109,652 KB
testcase_25 AC 122 ms
109,648 KB
testcase_26 AC 125 ms
109,576 KB
testcase_27 AC 123 ms
109,456 KB
testcase_28 AC 124 ms
109,668 KB
testcase_29 AC 125 ms
109,656 KB
testcase_30 AC 124 ms
109,628 KB
testcase_31 AC 124 ms
109,516 KB
testcase_32 AC 125 ms
109,732 KB
testcase_33 AC 125 ms
109,620 KB
testcase_34 AC 124 ms
109,568 KB
testcase_35 AC 122 ms
109,384 KB
testcase_36 AC 120 ms
109,672 KB
testcase_37 AC 112 ms
108,996 KB
testcase_38 AC 119 ms
108,988 KB
testcase_39 AC 114 ms
108,812 KB
testcase_40 AC 119 ms
109,040 KB
testcase_41 AC 113 ms
108,996 KB
testcase_42 AC 112 ms
108,992 KB
testcase_43 AC 112 ms
109,124 KB
testcase_44 AC 119 ms
109,024 KB
testcase_45 AC 119 ms
108,964 KB
testcase_46 AC 116 ms
109,072 KB
testcase_47 AC 112 ms
109,168 KB
testcase_48 AC 114 ms
108,852 KB
testcase_49 AC 114 ms
109,052 KB
testcase_50 AC 115 ms
109,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
r = [0,0,0,0]
for i in a:
    r[min(i,3)] += 1
ans = r[1]*(r[1]-1)//2 + r[1]*r[3] + 2*r[1]*r[2] + n*(n-1)//2
print(ans)
0