結果

問題 No.1564 Sum of Products of Pairs
ユーザー kept1994kept1994
提出日時 2021-08-26 00:32:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 82,652 KB
実行使用メモリ 104,612 KB
最終ジャッジ日時 2024-04-28 16:20:46
合計ジャッジ時間 4,293 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,796 KB
testcase_01 AC 32 ms
52,728 KB
testcase_02 AC 33 ms
52,988 KB
testcase_03 AC 65 ms
80,932 KB
testcase_04 AC 38 ms
60,592 KB
testcase_05 AC 79 ms
86,520 KB
testcase_06 AC 63 ms
78,676 KB
testcase_07 AC 53 ms
71,404 KB
testcase_08 AC 43 ms
65,552 KB
testcase_09 AC 57 ms
73,312 KB
testcase_10 AC 78 ms
86,868 KB
testcase_11 AC 82 ms
90,808 KB
testcase_12 AC 66 ms
81,904 KB
testcase_13 AC 32 ms
52,188 KB
testcase_14 AC 32 ms
53,364 KB
testcase_15 AC 31 ms
53,016 KB
testcase_16 AC 31 ms
52,076 KB
testcase_17 AC 32 ms
53,056 KB
testcase_18 AC 99 ms
103,464 KB
testcase_19 AC 96 ms
100,176 KB
testcase_20 AC 102 ms
103,836 KB
testcase_21 AC 103 ms
104,448 KB
testcase_22 AC 96 ms
99,188 KB
testcase_23 AC 106 ms
104,144 KB
testcase_24 AC 104 ms
104,612 KB
testcase_25 AC 101 ms
103,512 KB
testcase_26 AC 103 ms
103,992 KB
testcase_27 AC 104 ms
103,988 KB
testcase_28 AC 32 ms
52,676 KB
testcase_29 AC 30 ms
52,020 KB
testcase_30 AC 29 ms
53,020 KB
testcase_31 AC 29 ms
53,040 KB
testcase_32 AC 29 ms
52,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    ans = 0
    for k in range(N):
        ans += A[2 * k] * A[2 * k + 1]
    print(ans)

if __name__ == '__main__':
    main()
0