結果

問題 No.740 幻の木
ユーザー kazukikazuki
提出日時 2018-11-11 21:35:18
言語 Ruby
(3.3.0)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 11,512 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-08-21 07:47:19
合計ジャッジ時間 2,157 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,164 KB
testcase_01 AC 80 ms
15,116 KB
testcase_02 AC 80 ms
15,160 KB
testcase_03 AC 81 ms
15,136 KB
testcase_04 AC 80 ms
15,152 KB
testcase_05 AC 81 ms
15,112 KB
testcase_06 AC 140 ms
15,092 KB
testcase_07 AC 82 ms
15,344 KB
testcase_08 AC 80 ms
15,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m, p, q = gets.split.map!{|x| x.to_i}

month = 1
month_count = 0

while n>0
  if month>=p && month <p+q
    n -= m*2
  else
    n -= m
  end

  month += 1

  if month == 13
    month = 1
  end

  month_count += 1

end

puts month_count
0