結果

問題 No.505 カードの数式2
ユーザー wotsushiwotsushi
提出日時 2017-04-22 10:52:26
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 11,128 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-09-28 21:15:06
合計ジャッジ時間 4,623 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,088 KB
testcase_01 AC 84 ms
15,144 KB
testcase_02 AC 84 ms
15,136 KB
testcase_03 AC 87 ms
15,268 KB
testcase_04 AC 84 ms
15,128 KB
testcase_05 AC 84 ms
15,208 KB
testcase_06 AC 83 ms
15,204 KB
testcase_07 AC 83 ms
15,076 KB
testcase_08 AC 84 ms
15,244 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 86 ms
15,096 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 85 ms
15,024 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 84 ms
15,088 KB
testcase_20 AC 85 ms
15,072 KB
testcase_21 AC 85 ms
15,100 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 84 ms
15,084 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
a = gets.split.map(&:to_i)
OP = [:+, :-, :*, :/]
ans = a.inject([0, 0]) {|memo, x|
  d = memo.product(OP).map {|v, o|
    if not (x == 0 and o == :/)
      v.send(o, x)
    else
      0
    end
  }
  [d.min, d.max]
}.max
puts ans
0