結果

問題 No.1564 Sum of Products of Pairs
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-06-26 14:49:03
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 145 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 108,680 KB
最終ジャッジ日時 2023-09-07 16:44:06
合計ジャッジ時間 5,219 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,268 KB
testcase_01 AC 76 ms
71,192 KB
testcase_02 AC 71 ms
71,156 KB
testcase_03 AC 105 ms
90,476 KB
testcase_04 AC 78 ms
76,428 KB
testcase_05 AC 118 ms
95,192 KB
testcase_06 AC 102 ms
88,576 KB
testcase_07 AC 94 ms
82,984 KB
testcase_08 AC 82 ms
78,140 KB
testcase_09 AC 92 ms
84,160 KB
testcase_10 AC 121 ms
95,144 KB
testcase_11 AC 121 ms
98,636 KB
testcase_12 AC 109 ms
90,468 KB
testcase_13 AC 71 ms
71,456 KB
testcase_14 AC 72 ms
71,320 KB
testcase_15 AC 71 ms
71,212 KB
testcase_16 AC 73 ms
71,472 KB
testcase_17 AC 73 ms
71,220 KB
testcase_18 AC 142 ms
107,984 KB
testcase_19 AC 136 ms
104,992 KB
testcase_20 AC 143 ms
108,168 KB
testcase_21 AC 146 ms
108,344 KB
testcase_22 AC 137 ms
104,496 KB
testcase_23 AC 145 ms
108,680 KB
testcase_24 AC 144 ms
107,968 KB
testcase_25 AC 143 ms
108,048 KB
testcase_26 AC 143 ms
108,136 KB
testcase_27 AC 143 ms
108,552 KB
testcase_28 AC 72 ms
71,008 KB
testcase_29 AC 72 ms
71,212 KB
testcase_30 AC 71 ms
71,444 KB
testcase_31 AC 72 ms
71,256 KB
testcase_32 AC 72 ms
71,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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