結果

問題 No.63 ポッキーゲーム
ユーザー Makot3Makot3
提出日時 2017-07-01 07:29:37
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 181 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-15 09:51:04
合計ジャッジ時間 7,185 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
12,160 KB
testcase_01 AC 91 ms
12,160 KB
testcase_02 AC 92 ms
12,160 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 AC 88 ms
12,160 KB
testcase_05 AC 93 ms
12,160 KB
testcase_06 AC 91 ms
12,160 KB
testcase_07 AC 94 ms
12,288 KB
testcase_08 AC 92 ms
12,288 KB
testcase_09 AC 109 ms
12,160 KB
testcase_10 AC 246 ms
12,288 KB
testcase_11 AC 100 ms
12,288 KB
testcase_12 AC 409 ms
12,160 KB
testcase_13 WA -
testcase_14 AC 410 ms
12,160 KB
testcase_15 AC 408 ms
12,160 KB
testcase_16 AC 131 ms
12,160 KB
testcase_17 WA -
testcase_18 AC 120 ms
12,288 KB
testcase_19 AC 2,185 ms
12,160 KB
testcase_20 WA -
testcase_21 AC 749 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:8: warning: mismatched indentations at 'end' with 'else' at 6
Syntax OK

ソースコード

diff #

l, k = gets.split(' ').map(&:to_i)
k2 = k * 2
if k == 1
 if k2 > l
   puts 0
 else
   puts l / k2
  end
else
  i = 0
  while l - k2 > 0
    l -= k2
    i += 1
  end
  puts k * i
end
0