結果

問題 No.63 ポッキーゲーム
ユーザー UEUEUE66UEUEUE66
提出日時 2018-05-26 00:04:34
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,351 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 13,030 ms
コンパイル使用メモリ 232,864 KB
実行使用メモリ 63,936 KB
最終ジャッジ日時 2023-09-12 19:39:05
合計ジャッジ時間 36,345 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 981 ms
62,600 KB
testcase_01 AC 995 ms
62,828 KB
testcase_02 AC 979 ms
62,508 KB
testcase_03 AC 984 ms
62,288 KB
testcase_04 AC 972 ms
62,604 KB
testcase_05 AC 991 ms
62,484 KB
testcase_06 AC 990 ms
62,404 KB
testcase_07 AC 982 ms
62,800 KB
testcase_08 AC 981 ms
62,524 KB
testcase_09 AC 989 ms
62,436 KB
testcase_10 AC 1,001 ms
62,316 KB
testcase_11 AC 1,351 ms
62,624 KB
testcase_12 AC 978 ms
62,400 KB
testcase_13 AC 1,351 ms
62,768 KB
testcase_14 AC 988 ms
62,324 KB
testcase_15 AC 981 ms
62,620 KB
testcase_16 AC 988 ms
62,548 KB
testcase_17 AC 1,336 ms
62,496 KB
testcase_18 AC 976 ms
62,520 KB
testcase_19 AC 1,012 ms
62,824 KB
testcase_20 AC 970 ms
62,344 KB
testcase_21 AC 991 ms
63,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner

object pokky {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    var l = sc.nextInt
    val k = sc.nextInt
    var y = 0
    var count = 0

    while(l > 0) {
      l = l - 2 * k
      if (l <= 0) {
        y = k * count
      }
      count += 1
    }
    println(y)
  }
}
0