結果

問題 No.63 ポッキーゲーム
ユーザー HaleakalaHaleakala
提出日時 2018-02-18 23:02:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 351 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 3,974 ms
コンパイル使用メモリ 76,044 KB
実行使用メモリ 56,116 KB
最終ジャッジ日時 2023-09-18 07:28:07
合計ジャッジ時間 7,330 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,952 KB
testcase_01 AC 116 ms
55,612 KB
testcase_02 AC 111 ms
55,792 KB
testcase_03 AC 112 ms
55,980 KB
testcase_04 AC 113 ms
55,848 KB
testcase_05 AC 111 ms
56,060 KB
testcase_06 AC 113 ms
55,708 KB
testcase_07 AC 116 ms
55,492 KB
testcase_08 AC 115 ms
55,912 KB
testcase_09 AC 117 ms
55,496 KB
testcase_10 AC 119 ms
55,896 KB
testcase_11 AC 351 ms
56,116 KB
testcase_12 AC 122 ms
55,988 KB
testcase_13 AC 351 ms
55,688 KB
testcase_14 AC 123 ms
55,896 KB
testcase_15 AC 121 ms
55,912 KB
testcase_16 AC 117 ms
55,724 KB
testcase_17 AC 337 ms
55,976 KB
testcase_18 AC 118 ms
55,508 KB
testcase_19 AC 149 ms
55,956 KB
testcase_20 AC 120 ms
56,000 KB
testcase_21 AC 128 ms
55,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Answer {
	public static void main(String str[]) {
        Scanner sc = new Scanner(System.in);

        int length = Integer.valueOf(sc.next());
        int oneTime = Integer.valueOf(sc.next());

        int i=0;
        while(oneTime*2 < length) {
        	length -= oneTime*2;
        	i++;
        }

        System.out.println(i*oneTime);
	}
}
0