結果

問題 No.63 ポッキーゲーム
ユーザー TakaTaka
提出日時 2016-04-09 16:35:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 74,740 KB
実行使用メモリ 42,040 KB
最終ジャッジ日時 2024-04-14 23:32:17
合計ジャッジ時間 6,919 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 128 ms
41,528 KB
testcase_03 AC 131 ms
41,424 KB
testcase_04 WA -
testcase_05 AC 129 ms
41,644 KB
testcase_06 AC 129 ms
41,008 KB
testcase_07 AC 132 ms
41,460 KB
testcase_08 AC 128 ms
41,440 KB
testcase_09 AC 131 ms
41,376 KB
testcase_10 AC 136 ms
41,264 KB
testcase_11 AC 403 ms
40,004 KB
testcase_12 AC 138 ms
41,472 KB
testcase_13 AC 414 ms
41,080 KB
testcase_14 AC 139 ms
41,440 KB
testcase_15 AC 140 ms
41,752 KB
testcase_16 AC 134 ms
41,756 KB
testcase_17 AC 397 ms
41,296 KB
testcase_18 AC 132 ms
41,380 KB
testcase_19 AC 171 ms
41,292 KB
testcase_20 AC 140 ms
41,524 KB
testcase_21 AC 134 ms
40,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
		
        Scanner sc = new Scanner(System.in);
		
       	int L = sc.nextInt();
        int K = sc.nextInt();
		
		int nokori=L-K*2;
		int yuu=0;
		
		if(nokori<=K*2){
			yuu=K;
		}else{
			while(nokori>K*2){
				nokori = L-K*2;
				yuu += K;
				L=nokori;
			}
		}
		
        System.out.println(yuu);
    }
}
0