結果

問題 No.1564 Sum of Products of Pairs
ユーザー mono_0812mono_0812
提出日時 2021-06-26 13:36:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 192 ms / 2,000 ms
コード長 1,353 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 11,096 KB
実行使用メモリ 33,776 KB
最終ジャッジ日時 2023-09-07 16:31:52
合計ジャッジ時間 4,942 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
10,844 KB
testcase_01 AC 38 ms
10,960 KB
testcase_02 AC 38 ms
10,972 KB
testcase_03 AC 104 ms
21,200 KB
testcase_04 AC 45 ms
11,944 KB
testcase_05 AC 128 ms
25,728 KB
testcase_06 AC 99 ms
20,924 KB
testcase_07 AC 74 ms
17,148 KB
testcase_08 AC 57 ms
14,080 KB
testcase_09 AC 78 ms
17,700 KB
testcase_10 AC 132 ms
25,660 KB
testcase_11 AC 141 ms
27,716 KB
testcase_12 AC 103 ms
21,656 KB
testcase_13 AC 38 ms
10,852 KB
testcase_14 AC 38 ms
11,012 KB
testcase_15 AC 37 ms
11,004 KB
testcase_16 AC 36 ms
10,968 KB
testcase_17 AC 37 ms
10,872 KB
testcase_18 AC 176 ms
33,776 KB
testcase_19 AC 175 ms
32,180 KB
testcase_20 AC 188 ms
33,760 KB
testcase_21 AC 186 ms
33,376 KB
testcase_22 AC 169 ms
31,600 KB
testcase_23 AC 182 ms
33,224 KB
testcase_24 AC 187 ms
33,252 KB
testcase_25 AC 190 ms
33,268 KB
testcase_26 AC 192 ms
33,340 KB
testcase_27 AC 186 ms
33,416 KB
testcase_28 AC 38 ms
10,940 KB
testcase_29 AC 38 ms
10,820 KB
testcase_30 AC 41 ms
10,804 KB
testcase_31 AC 38 ms
10,932 KB
testcase_32 AC 39 ms
10,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect,collections,copy,heapq,itertools,math,string,sys,queue,time
from typing import Union, ValuesView
input = lambda: sys.stdin.readline().rstrip()
def I(): return input()
def IS(): return input().split()
def II(): return int(input())
def IIS(): return map(int,input().split())
def LIIS(): return list(map(int,input().split()))
def debug(*args): print(*args) if len(args)>0 else print(False);return
start_time=time.time()
def nt(): print(time.time()-start_time);return
def chmax(a: list, b: list) -> bool:
     assert len(a) == len(b) == 1, "1要素のlistを指定してください"
     if a[0] < b[0]:
         a[0] = b[0]
         return True
     return False
def chmin(a: list, b: list) -> bool:
    assert len(a) == len(b) == 1, "1要素のlistを指定してください"
    if a[0] > b[0]:
        a[0] = b[0]
        return True
    return False
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(X[-i])*(n**(i-1))
    return out#int out
ragen=range
INF=10**20
MOD=10**9+7
from decimal import Decimal as d, DefaultContext
##############################################################################
n=II()
A=LIIS()
A.sort()
ans=0
for i in range(n):
    ans+=A[i*2]*A[i*2+1]
print(ans)
0