結果

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

テストケース

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

ソースコード

diff #

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

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

puts hakake(numbers)
0