結果

問題 No.1564 Sum of Products of Pairs
ユーザー ygd.ygd.
提出日時 2021-06-28 19:58:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 108,032 KB
最終ジャッジ日時 2023-09-07 20:59:57
合計ジャッジ時間 6,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,244 KB
testcase_01 AC 74 ms
71,464 KB
testcase_02 AC 74 ms
71,144 KB
testcase_03 AC 113 ms
89,936 KB
testcase_04 AC 82 ms
75,624 KB
testcase_05 AC 120 ms
94,400 KB
testcase_06 AC 108 ms
88,228 KB
testcase_07 AC 95 ms
82,460 KB
testcase_08 AC 86 ms
77,708 KB
testcase_09 AC 97 ms
83,276 KB
testcase_10 AC 122 ms
94,684 KB
testcase_11 AC 128 ms
97,748 KB
testcase_12 AC 109 ms
89,908 KB
testcase_13 AC 76 ms
71,388 KB
testcase_14 AC 74 ms
71,316 KB
testcase_15 AC 74 ms
71,172 KB
testcase_16 AC 74 ms
70,988 KB
testcase_17 AC 73 ms
71,448 KB
testcase_18 AC 153 ms
107,172 KB
testcase_19 AC 143 ms
104,216 KB
testcase_20 AC 147 ms
107,492 KB
testcase_21 AC 149 ms
107,596 KB
testcase_22 AC 143 ms
103,780 KB
testcase_23 AC 151 ms
108,032 KB
testcase_24 AC 150 ms
107,352 KB
testcase_25 AC 150 ms
107,388 KB
testcase_26 AC 149 ms
107,624 KB
testcase_27 AC 148 ms
107,876 KB
testcase_28 AC 75 ms
71,380 KB
testcase_29 AC 74 ms
71,296 KB
testcase_30 AC 73 ms
71,468 KB
testcase_31 AC 73 ms
71,496 KB
testcase_32 AC 74 ms
71,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    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)


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