結果

問題 No.1564 Sum of Products of Pairs
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-06-26 13:04:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 134 bytes
コンパイル時間 798 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 30,924 KB
最終ジャッジ日時 2023-09-07 16:15:40
合計ジャッジ時間 4,997 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,796 KB
testcase_01 AC 15 ms
7,944 KB
testcase_02 AC 14 ms
7,784 KB
testcase_03 AC 79 ms
18,840 KB
testcase_04 AC 21 ms
9,056 KB
testcase_05 AC 103 ms
22,304 KB
testcase_06 AC 75 ms
17,696 KB
testcase_07 AC 52 ms
14,228 KB
testcase_08 AC 32 ms
11,052 KB
testcase_09 AC 55 ms
14,720 KB
testcase_10 AC 108 ms
22,972 KB
testcase_11 AC 117 ms
24,544 KB
testcase_12 AC 82 ms
19,060 KB
testcase_13 AC 15 ms
7,852 KB
testcase_14 AC 16 ms
7,928 KB
testcase_15 AC 15 ms
7,832 KB
testcase_16 AC 15 ms
7,880 KB
testcase_17 AC 15 ms
7,852 KB
testcase_18 AC 160 ms
30,192 KB
testcase_19 AC 148 ms
29,192 KB
testcase_20 AC 162 ms
30,128 KB
testcase_21 AC 166 ms
30,908 KB
testcase_22 AC 152 ms
29,088 KB
testcase_23 AC 165 ms
30,848 KB
testcase_24 AC 164 ms
30,864 KB
testcase_25 AC 164 ms
30,916 KB
testcase_26 AC 164 ms
30,920 KB
testcase_27 AC 165 ms
30,924 KB
testcase_28 AC 15 ms
7,832 KB
testcase_29 AC 15 ms
7,896 KB
testcase_30 AC 16 ms
7,868 KB
testcase_31 AC 15 ms
7,944 KB
testcase_32 AC 15 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
    ans += a[2 * i] * a[2 * i + 1]
print(ans)
0