結果

問題 No.1470 Mex Sum
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-09 21:30:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 943 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 105,684 KB
最終ジャッジ日時 2023-09-07 10:00:00
合計ジャッジ時間 8,242 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,372 KB
testcase_01 AC 70 ms
71,284 KB
testcase_02 AC 78 ms
76,912 KB
testcase_03 AC 78 ms
77,084 KB
testcase_04 AC 79 ms
77,384 KB
testcase_05 AC 78 ms
77,072 KB
testcase_06 AC 77 ms
77,412 KB
testcase_07 AC 78 ms
77,124 KB
testcase_08 AC 78 ms
77,592 KB
testcase_09 AC 79 ms
77,244 KB
testcase_10 AC 78 ms
77,440 KB
testcase_11 AC 80 ms
77,128 KB
testcase_12 AC 113 ms
105,436 KB
testcase_13 AC 111 ms
105,312 KB
testcase_14 AC 112 ms
105,496 KB
testcase_15 AC 111 ms
105,272 KB
testcase_16 AC 109 ms
105,452 KB
testcase_17 AC 109 ms
105,160 KB
testcase_18 AC 111 ms
105,308 KB
testcase_19 AC 112 ms
105,376 KB
testcase_20 AC 111 ms
105,360 KB
testcase_21 AC 112 ms
105,340 KB
testcase_22 AC 112 ms
105,396 KB
testcase_23 AC 114 ms
105,444 KB
testcase_24 AC 110 ms
105,488 KB
testcase_25 AC 110 ms
105,408 KB
testcase_26 AC 112 ms
105,620 KB
testcase_27 AC 112 ms
105,444 KB
testcase_28 AC 109 ms
105,520 KB
testcase_29 AC 112 ms
105,512 KB
testcase_30 AC 110 ms
105,372 KB
testcase_31 AC 112 ms
105,472 KB
testcase_32 AC 111 ms
105,560 KB
testcase_33 AC 109 ms
105,552 KB
testcase_34 AC 110 ms
105,684 KB
testcase_35 AC 111 ms
105,244 KB
testcase_36 AC 110 ms
105,624 KB
testcase_37 AC 105 ms
104,284 KB
testcase_38 AC 106 ms
104,368 KB
testcase_39 AC 105 ms
104,536 KB
testcase_40 AC 105 ms
104,380 KB
testcase_41 AC 112 ms
104,184 KB
testcase_42 AC 106 ms
104,376 KB
testcase_43 AC 105 ms
104,364 KB
testcase_44 AC 105 ms
104,356 KB
testcase_45 AC 107 ms
104,324 KB
testcase_46 AC 105 ms
104,432 KB
testcase_47 AC 106 ms
104,152 KB
testcase_48 AC 105 ms
104,372 KB
testcase_49 AC 104 ms
104,196 KB
testcase_50 AC 107 ms
104,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))
count = [0]*4
for a in A:
    count[min(a,3)] += 1

ans = 0
ans += (n-count[1])*(n-count[1]-1)//2
ans += count[1]*count[3]*2
ans += count[1]*(count[1]-1)
ans += count[1]*count[2]*3
print(ans)
0