結果

問題 No.1564 Sum of Products of Pairs
ユーザー mkawa2mkawa2
提出日時 2021-06-26 14:47:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 801 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 26,996 KB
最終ジャッジ日時 2023-09-07 16:43:55
合計ジャッジ時間 4,042 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,912 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 16 ms
7,900 KB
testcase_03 AC 77 ms
16,868 KB
testcase_04 AC 21 ms
9,180 KB
testcase_05 AC 104 ms
20,544 KB
testcase_06 AC 78 ms
16,420 KB
testcase_07 AC 52 ms
13,572 KB
testcase_08 AC 32 ms
10,624 KB
testcase_09 AC 56 ms
13,892 KB
testcase_10 AC 104 ms
20,896 KB
testcase_11 AC 112 ms
22,344 KB
testcase_12 AC 77 ms
17,036 KB
testcase_13 AC 15 ms
7,932 KB
testcase_14 AC 16 ms
7,908 KB
testcase_15 AC 15 ms
7,928 KB
testcase_16 AC 16 ms
7,980 KB
testcase_17 AC 16 ms
7,908 KB
testcase_18 AC 152 ms
26,432 KB
testcase_19 AC 141 ms
25,240 KB
testcase_20 AC 160 ms
26,276 KB
testcase_21 AC 155 ms
26,844 KB
testcase_22 AC 140 ms
25,344 KB
testcase_23 AC 161 ms
26,996 KB
testcase_24 AC 159 ms
26,908 KB
testcase_25 AC 159 ms
26,928 KB
testcase_26 AC 163 ms
26,996 KB
testcase_27 AC 160 ms
26,876 KB
testcase_28 AC 15 ms
7,880 KB
testcase_29 AC 16 ms
7,872 KB
testcase_30 AC 16 ms
7,928 KB
testcase_31 AC 16 ms
7,796 KB
testcase_32 AC 15 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
md = 998244353
# md = 10**9+7

n = II()
aa = LI()
aa.sort()
ans = 0
for i in range(n):
    ans += aa[i*2]*aa[i*2+1]
print(ans)
0