結果

問題 No.128 お年玉(1)
ユーザー len_proglen_prog
提出日時 2016-06-14 11:35:31
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 74,720 KB
実行使用メモリ 64,508 KB
最終ジャッジ日時 2024-04-08 18:46:28
合計ジャッジ時間 18,356 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,960 KB
testcase_01 AC 132 ms
57,968 KB
testcase_02 AC 136 ms
57,704 KB
testcase_03 AC 245 ms
56,144 KB
testcase_04 AC 138 ms
57,788 KB
testcase_05 AC 135 ms
57,944 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 133 ms
57,980 KB
testcase_09 AC 137 ms
57,956 KB
testcase_10 AC 649 ms
57,960 KB
testcase_11 AC 4,154 ms
57,836 KB
testcase_12 AC 644 ms
57,964 KB
testcase_13 AC 325 ms
57,832 KB
testcase_14 AC 661 ms
57,976 KB
testcase_15 AC 1,167 ms
57,948 KB
testcase_16 AC 243 ms
57,712 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long budget = scan.nextLong();
		int numOfKids = scan.nextInt();
		long handselAmount = 0;

		if(budget % numOfKids == 0){
			handselAmount = budget / numOfKids;
		}else{
			int handselAmountBase = 1000;

			while(handselAmount * numOfKids < budget){
				handselAmount += handselAmountBase;
			}

			handselAmount -= 1000;
		}

		System.out.println(handselAmount);
		scan.close();
	}

}
0