結果

問題 No.63 ポッキーゲーム
ユーザー (,,゚Д゚)TERIA な の で す(,,゚Д゚)TERIA な の で す
提出日時 2014-11-16 04:33:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 398 bytes
コンパイル時間 5,062 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 57,980 KB
最終ジャッジ日時 2023-08-25 18:46:11
合計ジャッジ時間 7,191 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,860 KB
testcase_01 AC 119 ms
56,052 KB
testcase_02 AC 120 ms
55,648 KB
testcase_03 AC 121 ms
55,708 KB
testcase_04 AC 118 ms
56,000 KB
testcase_05 AC 118 ms
55,304 KB
testcase_06 AC 118 ms
55,972 KB
testcase_07 AC 119 ms
56,336 KB
testcase_08 AC 118 ms
55,612 KB
testcase_09 AC 119 ms
55,684 KB
testcase_10 AC 120 ms
55,796 KB
testcase_11 AC 119 ms
55,724 KB
testcase_12 AC 117 ms
55,892 KB
testcase_13 AC 119 ms
55,772 KB
testcase_14 AC 121 ms
56,020 KB
testcase_15 AC 124 ms
55,756 KB
testcase_16 AC 119 ms
55,896 KB
testcase_17 AC 120 ms
55,740 KB
testcase_18 AC 121 ms
55,788 KB
testcase_19 AC 120 ms
57,980 KB
testcase_20 AC 120 ms
55,608 KB
testcase_21 AC 121 ms
56,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Kyosaya{
	public static void main(String args[])
	{
		Scanner s=new Scanner(System.in);
		int pocky = s.nextInt();
		int gnaw = s.nextInt();
		if(gnaw*2>= pocky){
			System.out.println(0);
		}else{
			int result = pocky-(pocky-(pocky/gnaw/2)*gnaw);
				if(result*2 == pocky){
					result= result - gnaw;
				}
		System.out.println(result);
		}
	}
}
0