結果

問題 No.63 ポッキーゲーム
ユーザー springspring
提出日時 2019-06-12 15:49:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 2,451 ms
コンパイル使用メモリ 74,088 KB
実行使用メモリ 41,572 KB
最終ジャッジ日時 2024-04-19 04:52:43
合計ジャッジ時間 5,830 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
40,916 KB
testcase_01 AC 110 ms
40,984 KB
testcase_02 AC 124 ms
41,540 KB
testcase_03 AC 108 ms
40,860 KB
testcase_04 AC 112 ms
40,392 KB
testcase_05 AC 106 ms
39,812 KB
testcase_06 AC 133 ms
41,396 KB
testcase_07 AC 121 ms
41,096 KB
testcase_08 AC 121 ms
41,372 KB
testcase_09 AC 120 ms
40,976 KB
testcase_10 AC 117 ms
39,832 KB
testcase_11 AC 116 ms
40,912 KB
testcase_12 AC 119 ms
40,992 KB
testcase_13 AC 119 ms
40,876 KB
testcase_14 AC 121 ms
41,440 KB
testcase_15 AC 113 ms
40,912 KB
testcase_16 AC 119 ms
41,240 KB
testcase_17 AC 133 ms
41,220 KB
testcase_18 AC 120 ms
40,632 KB
testcase_19 AC 112 ms
41,104 KB
testcase_20 AC 140 ms
41,060 KB
testcase_21 AC 142 ms
41,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pocky = sc.nextInt();
		int longP = sc.nextInt();
		sc.close();
		if(pocky%(longP*2)==0){
			System.out.println(((pocky/(longP*2))-1)*longP);
		}else{
			System.out.println((pocky/(longP*2))*longP);
		}
	}// mainmethod

} // clas
0