結果

問題 No.63 ポッキーゲーム
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2020-12-29 22:51:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 547 bytes
コンパイル時間 3,929 ms
コンパイル使用メモリ 78,048 KB
実行使用メモリ 41,484 KB
最終ジャッジ日時 2024-04-15 23:11:58
合計ジャッジ時間 7,784 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,264 KB
testcase_01 AC 110 ms
40,084 KB
testcase_02 AC 121 ms
41,116 KB
testcase_03 AC 106 ms
40,220 KB
testcase_04 WA -
testcase_05 AC 122 ms
41,056 KB
testcase_06 AC 122 ms
41,136 KB
testcase_07 AC 127 ms
40,924 KB
testcase_08 AC 122 ms
40,924 KB
testcase_09 AC 126 ms
41,180 KB
testcase_10 AC 130 ms
40,972 KB
testcase_11 AC 416 ms
41,400 KB
testcase_12 AC 131 ms
41,264 KB
testcase_13 WA -
testcase_14 AC 128 ms
41,012 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 137 ms
41,252 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