結果

問題 No.63 ポッキーゲーム
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2020-12-29 22:53:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 441 ms / 5,000 ms
コード長 548 bytes
コンパイル時間 3,820 ms
コンパイル使用メモリ 75,060 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-04-15 23:13:56
合計ジャッジ時間 8,275 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,352 KB
testcase_01 AC 130 ms
41,364 KB
testcase_02 AC 129 ms
41,252 KB
testcase_03 AC 132 ms
41,212 KB
testcase_04 AC 132 ms
41,064 KB
testcase_05 AC 139 ms
41,192 KB
testcase_06 AC 133 ms
41,188 KB
testcase_07 AC 135 ms
41,332 KB
testcase_08 AC 134 ms
41,140 KB
testcase_09 AC 135 ms
41,392 KB
testcase_10 AC 142 ms
41,472 KB
testcase_11 AC 428 ms
40,948 KB
testcase_12 AC 140 ms
41,332 KB
testcase_13 AC 441 ms
41,304 KB
testcase_14 AC 147 ms
41,144 KB
testcase_15 AC 141 ms
41,188 KB
testcase_16 AC 136 ms
41,412 KB
testcase_17 AC 407 ms
41,516 KB
testcase_18 AC 137 ms
40,984 KB
testcase_19 AC 174 ms
41,444 KB
testcase_20 AC 137 ms
41,208 KB
testcase_21 AC 148 ms
41,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

// https://yukicoder.me/problems/no/289
public class Pockey63 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);

    // String 1つ分を読み込む
    int s1 = Integer.parseInt(sc.next());
    int s2 = Integer.parseInt(sc.next());
    int result = 0;
    while (s1 > s2 * 2) {
      s1 -= s2 * 2;
      if (s1 >= 0) {
        result += s2;
      }
    }
    // 標準出力に書き出す。
    System.out.println(result);
  }
}
0