結果

問題 No.999 てん vs. ほむ
ユーザー gemmarogemmaro
提出日時 2020-11-07 00:34:32
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 319 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 11,200 KB
実行使用メモリ 34,108 KB
最終ジャッジ日時 2023-09-29 19:52:02
合計ジャッジ時間 6,274 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,372 KB
testcase_01 AC 76 ms
15,164 KB
testcase_02 AC 76 ms
15,188 KB
testcase_03 AC 74 ms
15,092 KB
testcase_04 AC 74 ms
15,192 KB
testcase_05 AC 75 ms
15,168 KB
testcase_06 AC 73 ms
15,096 KB
testcase_07 AC 72 ms
15,084 KB
testcase_08 AC 103 ms
15,476 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

class Array
  def points
    (0..size).map do |n_left|
      left = take(n_left)
      right = drop(n_left)

      left.sum - right.sum
    end
  end
end

def solve
  diffs = A.each_slice(2).map { |l, r| l - r }
  diffs.points.max
end

N = gets.to_i
A = gets.split.map(&:to_i)

puts solve
0