結果

問題 No.1564 Sum of Products of Pairs
ユーザー hiragnhiragn
提出日時 2022-11-25 17:52:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 30,680 KB
最終ジャッジ日時 2024-04-09 23:57:11
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,624 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 27 ms
10,624 KB
testcase_03 AC 86 ms
20,040 KB
testcase_04 AC 31 ms
11,648 KB
testcase_05 AC 99 ms
23,172 KB
testcase_06 AC 77 ms
19,056 KB
testcase_07 AC 60 ms
16,136 KB
testcase_08 AC 41 ms
13,568 KB
testcase_09 AC 61 ms
16,652 KB
testcase_10 AC 108 ms
23,556 KB
testcase_11 AC 112 ms
24,784 KB
testcase_12 AC 80 ms
20,208 KB
testcase_13 AC 27 ms
10,624 KB
testcase_14 AC 27 ms
10,624 KB
testcase_15 AC 26 ms
10,752 KB
testcase_16 AC 26 ms
10,624 KB
testcase_17 AC 26 ms
10,752 KB
testcase_18 AC 147 ms
29,940 KB
testcase_19 AC 145 ms
29,044 KB
testcase_20 AC 158 ms
29,960 KB
testcase_21 AC 166 ms
30,524 KB
testcase_22 AC 145 ms
28,972 KB
testcase_23 AC 151 ms
30,672 KB
testcase_24 AC 153 ms
30,676 KB
testcase_25 AC 148 ms
30,680 KB
testcase_26 AC 155 ms
30,676 KB
testcase_27 AC 158 ms
30,552 KB
testcase_28 AC 28 ms
10,624 KB
testcase_29 AC 26 ms
10,624 KB
testcase_30 AC 26 ms
10,624 KB
testcase_31 AC 27 ms
10,752 KB
testcase_32 AC 26 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    a = sorted(list(map(int, input().split())))

    ans = sum([a[i] * a[i + 1] for i in range(0, 2 * n, 2)])
    print(ans)


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