結果

問題 No.1564 Sum of Products of Pairs
ユーザー LyricalMaestro
提出日時 2024-01-23 00:47:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 103,296 KB
最終ジャッジ日時 2024-09-28 06:33:08
合計ジャッジ時間 4,639 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://yukicoder.me/problems/no/1564

def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    answer = 0
    for i in range(N):
        a = A[2 * i]
        b = A[2 * i + 1]
        answer += a * b
    print(answer)

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