結果

問題 No.1564 Sum of Products of Pairs
ユーザー lllllll88938494lllllll88938494
提出日時 2022-01-11 18:17:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 147 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 104,708 KB
最終ジャッジ日時 2024-04-26 20:43:17
合計ジャッジ時間 4,354 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,676 KB
testcase_01 AC 38 ms
53,216 KB
testcase_02 AC 42 ms
51,816 KB
testcase_03 AC 76 ms
81,144 KB
testcase_04 AC 43 ms
60,836 KB
testcase_05 AC 87 ms
86,492 KB
testcase_06 AC 72 ms
78,828 KB
testcase_07 AC 61 ms
70,584 KB
testcase_08 AC 51 ms
65,148 KB
testcase_09 AC 63 ms
73,564 KB
testcase_10 AC 89 ms
87,660 KB
testcase_11 AC 94 ms
91,464 KB
testcase_12 AC 79 ms
81,512 KB
testcase_13 AC 39 ms
52,128 KB
testcase_14 AC 39 ms
52,292 KB
testcase_15 AC 39 ms
52,896 KB
testcase_16 AC 39 ms
53,348 KB
testcase_17 AC 38 ms
52,812 KB
testcase_18 AC 114 ms
102,864 KB
testcase_19 AC 108 ms
99,684 KB
testcase_20 AC 117 ms
103,664 KB
testcase_21 AC 116 ms
104,024 KB
testcase_22 AC 109 ms
99,044 KB
testcase_23 AC 117 ms
104,068 KB
testcase_24 AC 116 ms
103,952 KB
testcase_25 AC 117 ms
104,708 KB
testcase_26 AC 115 ms
104,120 KB
testcase_27 AC 118 ms
103,328 KB
testcase_28 AC 37 ms
52,600 KB
testcase_29 AC 38 ms
52,076 KB
testcase_30 AC 37 ms
51,548 KB
testcase_31 AC 36 ms
52,620 KB
testcase_32 AC 38 ms
52,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ns=list(map(int,input().split()))
ns.sort(reverse=True)
cnt=0

for i in range(1,n*2,2):
    cnt+=ns[i]*ns[i-1]

print(cnt)
    
    
0