結果

問題 No.128 お年玉(1)
ユーザー len_proglen_prog
提出日時 2016-06-14 11:40:00
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 580 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 74,148 KB
実行使用メモリ 64,616 KB
最終ジャッジ日時 2024-04-08 18:45:47
合計ジャッジ時間 18,262 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
58,064 KB
testcase_01 AC 136 ms
57,856 KB
testcase_02 AC 136 ms
57,732 KB
testcase_03 AC 248 ms
57,976 KB
testcase_04 AC 137 ms
57,984 KB
testcase_05 AC 136 ms
57,928 KB
testcase_06 AC 136 ms
57,964 KB
testcase_07 AC 135 ms
56,136 KB
testcase_08 AC 138 ms
57,940 KB
testcase_09 AC 134 ms
57,852 KB
testcase_10 AC 646 ms
58,080 KB
testcase_11 AC 4,149 ms
58,096 KB
testcase_12 AC 647 ms
58,076 KB
testcase_13 AC 323 ms
57,844 KB
testcase_14 AC 663 ms
57,956 KB
testcase_15 AC 1,167 ms
55,768 KB
testcase_16 AC 242 ms
58,080 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 < 1000){
			handselAmount = 0;
		}else 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