結果

問題 No.63 ポッキーゲーム
ユーザー mits58mits58
提出日時 2016-07-02 13:31:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 463 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 1,954 ms
コンパイル使用メモリ 71,508 KB
実行使用メモリ 56,268 KB
最終ジャッジ日時 2023-08-25 19:13:23
合計ジャッジ時間 6,316 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
55,732 KB
testcase_01 AC 113 ms
55,824 KB
testcase_02 AC 112 ms
55,896 KB
testcase_03 AC 115 ms
55,760 KB
testcase_04 AC 108 ms
56,120 KB
testcase_05 AC 108 ms
55,872 KB
testcase_06 AC 105 ms
55,468 KB
testcase_07 AC 110 ms
55,828 KB
testcase_08 AC 110 ms
55,660 KB
testcase_09 AC 114 ms
55,904 KB
testcase_10 AC 122 ms
55,768 KB
testcase_11 AC 450 ms
56,060 KB
testcase_12 AC 116 ms
55,848 KB
testcase_13 AC 463 ms
56,036 KB
testcase_14 AC 118 ms
55,688 KB
testcase_15 AC 118 ms
55,812 KB
testcase_16 AC 111 ms
55,636 KB
testcase_17 AC 436 ms
55,608 KB
testcase_18 AC 124 ms
55,936 KB
testcase_19 AC 171 ms
55,624 KB
testcase_20 AC 128 ms
55,680 KB
testcase_21 AC 128 ms
56,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long l=sc.nextLong();
			long k=sc.nextLong();
			long ans=0;
			while(true){
				if(l-2*k<=0) break;
				else{
					ans+=k;
					l-=2*k;
				}
			}
			System.out.println(ans);
		}
	}
}
0