結果

問題 No.481 1から10
ユーザー naotest2naotest2
提出日時 2017-05-22 16:24:38
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 227 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 11,884 KB
実行使用メモリ 16,172 KB
最終ジャッジ日時 2023-10-19 14:07:05
合計ジャッジ時間 2,220 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
16,088 KB
testcase_01 AC 86 ms
16,088 KB
testcase_02 AC 85 ms
16,088 KB
testcase_03 AC 87 ms
16,088 KB
testcase_04 RE -
testcase_05 AC 86 ms
16,088 KB
testcase_06 AC 87 ms
16,088 KB
testcase_07 AC 85 ms
16,088 KB
testcase_08 AC 89 ms
16,088 KB
testcase_09 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

numbers=gets.chomp.split.map {|x| x.to_i}

def hakake(nums)
  ret = 1
  for x in 0..nums.length
    if x > 0 and nums[x] != nums[x-1] + 1
      ret = nums[x] - 1
      break
    end
  end
  return ret
end

puts hakake(numbers)
0