結果

問題 No.63 ポッキーゲーム
ユーザー リチウムリチウム
提出日時 2014-11-11 23:26:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 365 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 3,093 ms
コンパイル使用メモリ 72,088 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2023-08-25 18:44:06
合計ジャッジ時間 7,609 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,940 KB
testcase_01 AC 121 ms
55,732 KB
testcase_02 AC 120 ms
55,992 KB
testcase_03 AC 122 ms
56,276 KB
testcase_04 AC 121 ms
56,048 KB
testcase_05 AC 120 ms
56,240 KB
testcase_06 AC 120 ms
55,724 KB
testcase_07 AC 123 ms
56,336 KB
testcase_08 AC 121 ms
55,932 KB
testcase_09 AC 125 ms
55,944 KB
testcase_10 AC 126 ms
55,536 KB
testcase_11 AC 364 ms
55,560 KB
testcase_12 AC 127 ms
56,172 KB
testcase_13 AC 365 ms
55,940 KB
testcase_14 AC 126 ms
55,876 KB
testcase_15 AC 127 ms
56,088 KB
testcase_16 AC 124 ms
55,780 KB
testcase_17 AC 349 ms
56,012 KB
testcase_18 AC 125 ms
56,036 KB
testcase_19 AC 154 ms
56,040 KB
testcase_20 AC 128 ms
56,180 KB
testcase_21 AC 136 ms
56,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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