結果

問題 No.1564 Sum of Products of Pairs
ユーザー burita083burita083
提出日時 2021-06-27 01:59:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 152 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 31,012 KB
最終ジャッジ日時 2023-09-07 17:07:57
合計ジャッジ時間 5,025 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,876 KB
testcase_01 AC 16 ms
7,872 KB
testcase_02 AC 16 ms
7,912 KB
testcase_03 AC 86 ms
18,852 KB
testcase_04 AC 22 ms
9,220 KB
testcase_05 AC 111 ms
22,476 KB
testcase_06 AC 80 ms
17,708 KB
testcase_07 AC 55 ms
14,216 KB
testcase_08 AC 34 ms
11,224 KB
testcase_09 AC 59 ms
14,740 KB
testcase_10 AC 120 ms
22,868 KB
testcase_11 AC 130 ms
24,484 KB
testcase_12 AC 88 ms
19,032 KB
testcase_13 AC 16 ms
7,824 KB
testcase_14 AC 15 ms
7,752 KB
testcase_15 AC 16 ms
7,872 KB
testcase_16 AC 15 ms
7,828 KB
testcase_17 AC 15 ms
7,824 KB
testcase_18 AC 176 ms
30,212 KB
testcase_19 AC 166 ms
29,236 KB
testcase_20 AC 181 ms
30,320 KB
testcase_21 AC 181 ms
30,892 KB
testcase_22 AC 163 ms
29,108 KB
testcase_23 AC 183 ms
30,988 KB
testcase_24 AC 181 ms
30,992 KB
testcase_25 AC 186 ms
31,012 KB
testcase_26 AC 181 ms
30,900 KB
testcase_27 AC 177 ms
30,868 KB
testcase_28 AC 15 ms
7,788 KB
testcase_29 AC 15 ms
7,788 KB
testcase_30 AC 15 ms
7,868 KB
testcase_31 AC 16 ms
7,796 KB
testcase_32 AC 15 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

A = list(map(int, input().split()))
A.sort(reverse=True)

ans = 0
for i in range(2*N):
  if i%2==0:
    ans += A[i]*A[i+1]

print(ans)
0