結果

問題 No.1564 Sum of Products of Pairs
ユーザー MaboyMaboy
提出日時 2021-06-27 13:45:08
言語 Swift
(5.10.0)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 158 bytes
コンパイル時間 8,980 ms
コンパイル使用メモリ 133,824 KB
実行使用メモリ 19,656 KB
最終ジャッジ日時 2023-09-07 17:21:53
合計ジャッジ時間 7,353 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
8,212 KB
testcase_01 AC 3 ms
8,076 KB
testcase_02 AC 3 ms
8,008 KB
testcase_03 AC 126 ms
13,772 KB
testcase_04 AC 16 ms
8,344 KB
testcase_05 AC 168 ms
14,332 KB
testcase_06 AC 123 ms
12,644 KB
testcase_07 AC 76 ms
9,828 KB
testcase_08 AC 40 ms
8,780 KB
testcase_09 AC 84 ms
10,072 KB
testcase_10 AC 178 ms
14,660 KB
testcase_11 AC 197 ms
17,388 KB
testcase_12 AC 131 ms
13,376 KB
testcase_13 AC 4 ms
8,020 KB
testcase_14 AC 3 ms
8,040 KB
testcase_15 AC 3 ms
8,216 KB
testcase_16 AC 3 ms
8,020 KB
testcase_17 AC 3 ms
8,076 KB
testcase_18 AC 264 ms
18,664 KB
testcase_19 AC 247 ms
18,696 KB
testcase_20 AC 262 ms
18,588 KB
testcase_21 AC 271 ms
18,504 KB
testcase_22 AC 261 ms
19,656 KB
testcase_23 AC 269 ms
18,464 KB
testcase_24 AC 272 ms
18,820 KB
testcase_25 AC 271 ms
18,464 KB
testcase_26 AC 268 ms
18,840 KB
testcase_27 AC 272 ms
19,168 KB
testcase_28 AC 4 ms
8,084 KB
testcase_29 AC 3 ms
8,056 KB
testcase_30 AC 3 ms
8,100 KB
testcase_31 AC 3 ms
8,008 KB
testcase_32 AC 4 ms
8,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let n = Int(readLine()!)!
let l = readLine()!.split(separator: " ").map{Int($0)!}.sorted(by:>)
var a = 0
for i in 0..<n{
    a += l[i*2] * l[i*2+1]
}
print(a)
0