結果
問題 | No.740 幻の木 |
ユーザー | gemmaro |
提出日時 | 2020-02-11 10:04:06 |
言語 | Ruby (3.3.0) |
結果 |
AC
|
実行時間 | 175 ms / 2,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 16,256 KB |
最終ジャッジ日時 | 2024-04-08 14:32:06 |
合計ジャッジ時間 | 1,629 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 89 ms
16,256 KB |
testcase_01 | AC | 84 ms
16,256 KB |
testcase_02 | AC | 85 ms
16,256 KB |
testcase_03 | AC | 85 ms
16,256 KB |
testcase_04 | AC | 85 ms
16,256 KB |
testcase_05 | AC | 86 ms
16,256 KB |
testcase_06 | AC | 175 ms
16,256 KB |
testcase_07 | AC | 89 ms
16,256 KB |
testcase_08 | AC | 87 ms
16,256 KB |
コンパイルメッセージ
Syntax OK
ソースコード
# frozen_string_literal: true N, M, P, Q = gets.chomp.split.map(&:to_i) fall = Array.new(12, M) (P - 1..P + Q - 2).each do |i| fall[i] *= 2 end remain = N result = 1 fall.cycle.each_with_index do |f, i| remain -= f if remain <= 0 result = i + 1 break end end puts result