結果

問題 No.63 ポッキーゲーム
ユーザー tshigitshigi
提出日時 2016-08-01 10:28:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 212 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 11,472 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-08-25 19:14:27
合計ジャッジ時間 2,848 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,260 KB
testcase_01 AC 76 ms
15,020 KB
testcase_02 AC 76 ms
15,308 KB
testcase_03 AC 77 ms
15,276 KB
testcase_04 AC 78 ms
15,144 KB
testcase_05 AC 81 ms
15,024 KB
testcase_06 AC 78 ms
15,132 KB
testcase_07 AC 78 ms
15,088 KB
testcase_08 AC 79 ms
15,096 KB
testcase_09 AC 77 ms
15,328 KB
testcase_10 AC 77 ms
15,248 KB
testcase_11 AC 77 ms
15,144 KB
testcase_12 AC 77 ms
15,088 KB
testcase_13 AC 78 ms
15,248 KB
testcase_14 AC 76 ms
15,316 KB
testcase_15 AC 78 ms
15,088 KB
testcase_16 AC 77 ms
15,276 KB
testcase_17 AC 79 ms
15,120 KB
testcase_18 AC 78 ms
15,052 KB
testcase_19 AC 78 ms
15,264 KB
testcase_20 AC 79 ms
15,272 KB
testcase_21 AC 78 ms
15,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

inputs = STDIN.readlines.map(&:chomp)
l, k = inputs[0].split(/\s+/).map(&:to_i)

def yuu_length(l, k)
  if l % (2 * k) == 0
    (l / (2 * k) - 1) * k
  else
    (l / (2 * k)) * k
  end
end

puts yuu_length(l, k)
0