結果

問題 No.505 カードの数式2
ユーザー 6soukiti296soukiti29
提出日時 2017-07-01 20:50:11
言語 Nim
(2.0.2)
結果
RE  
実行時間 -
コード長 251 bytes
コンパイル時間 3,181 ms
コンパイル使用メモリ 69,848 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 13:14:32
合計ジャッジ時間 4,185 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 RE -
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 RE -
testcase_08 AC 1 ms
4,376 KB
testcase_09 RE -
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 RE -
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 RE -
testcase_17 WA -
testcase_18 AC 1 ms
4,376 KB
testcase_19 RE -
testcase_20 AC 2 ms
4,380 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils,sequtils
var
    N = stdin.readline.parseInt
    A = stdin.readline.split.map(parseInt)
    m,M : int
m = A[0]
M = A[0]
for a in A[1..high(A)]:
    (m, M) = (min([m + a,m - a,m * a,M * a]),max([M + a,M - a,M * a,m * a,m div a]))
echo M
0