結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー what_alnkwhat_alnk
提出日時 2015-10-25 02:06:12
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 214 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 15,392 KB
最終ジャッジ日時 2023-10-11 09:22:44
合計ジャッジ時間 44,163 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 77 ms
15,120 KB
testcase_02 AC 75 ms
15,152 KB
testcase_03 AC 74 ms
15,180 KB
testcase_04 AC 2,797 ms
15,140 KB
testcase_05 AC 79 ms
15,112 KB
testcase_06 AC 78 ms
15,040 KB
testcase_07 AC 80 ms
15,292 KB
testcase_08 AC 3,389 ms
15,252 KB
testcase_09 AC 496 ms
15,220 KB
testcase_10 AC 4,611 ms
15,124 KB
testcase_11 AC 2,488 ms
15,248 KB
testcase_12 AC 2,080 ms
15,140 KB
testcase_13 AC 1,699 ms
15,392 KB
testcase_14 AC 3,586 ms
15,248 KB
testcase_15 AC 557 ms
15,124 KB
testcase_16 AC 1,063 ms
15,172 KB
testcase_17 AC 1,486 ms
15,344 KB
testcase_18 AC 451 ms
15,240 KB
testcase_19 AC 152 ms
15,292 KB
testcase_20 AC 1,193 ms
15,348 KB
testcase_21 AC 738 ms
15,260 KB
testcase_22 AC 1,522 ms
15,260 KB
testcase_23 AC 3,120 ms
15,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i
b0 = 1
res = 0
while true
  break if b0 == n
  b1 = b0
  0.upto(b1) do |i|
    b2 = b1 - i
    b3 = b2 * 2 + i
    if b3 <= n then
      b0 = b3
      break
    end
  end
  res += 1
end
puts res
0