結果

問題 No.1564 Sum of Products of Pairs
ユーザー O2MTO2MT
提出日時 2021-07-26 16:39:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 140 bytes
コンパイル時間 746 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 108,356 KB
最終ジャッジ日時 2023-09-29 13:21:40
合計ジャッジ時間 7,163 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,328 KB
testcase_01 AC 72 ms
71,388 KB
testcase_02 AC 71 ms
71,388 KB
testcase_03 AC 106 ms
90,408 KB
testcase_04 AC 79 ms
76,292 KB
testcase_05 AC 119 ms
94,904 KB
testcase_06 AC 104 ms
88,668 KB
testcase_07 AC 95 ms
83,144 KB
testcase_08 AC 86 ms
78,372 KB
testcase_09 AC 96 ms
84,108 KB
testcase_10 AC 120 ms
95,004 KB
testcase_11 AC 123 ms
98,324 KB
testcase_12 AC 108 ms
90,500 KB
testcase_13 AC 71 ms
71,288 KB
testcase_14 AC 70 ms
71,140 KB
testcase_15 AC 73 ms
71,544 KB
testcase_16 AC 74 ms
71,372 KB
testcase_17 AC 74 ms
71,300 KB
testcase_18 AC 146 ms
108,012 KB
testcase_19 AC 140 ms
104,512 KB
testcase_20 AC 144 ms
108,184 KB
testcase_21 AC 145 ms
107,948 KB
testcase_22 AC 138 ms
104,196 KB
testcase_23 AC 147 ms
108,356 KB
testcase_24 AC 147 ms
107,928 KB
testcase_25 AC 145 ms
107,844 KB
testcase_26 AC 146 ms
108,088 KB
testcase_27 AC 145 ms
108,284 KB
testcase_28 AC 73 ms
71,556 KB
testcase_29 AC 71 ms
71,444 KB
testcase_30 AC 72 ms
71,256 KB
testcase_31 AC 73 ms
71,588 KB
testcase_32 AC 73 ms
71,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(0,2*N-1,2):
  ans += A[i]*A[i+1]

print(ans)
0