結果

問題 No.604 誕生日のお小遣い
ユーザー YamaKasaYamaKasa
提出日時 2018-09-26 16:31:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 108 ms / 1,000 ms
コード長 408 bytes
コンパイル時間 1,830 ms
コンパイル使用メモリ 72,656 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2023-08-14 01:31:45
合計ジャッジ時間 5,325 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
55,968 KB
testcase_01 AC 102 ms
55,900 KB
testcase_02 AC 105 ms
55,276 KB
testcase_03 AC 100 ms
56,000 KB
testcase_04 AC 104 ms
55,708 KB
testcase_05 AC 101 ms
55,892 KB
testcase_06 AC 102 ms
56,336 KB
testcase_07 AC 103 ms
55,944 KB
testcase_08 AC 103 ms
55,716 KB
testcase_09 AC 101 ms
56,048 KB
testcase_10 AC 103 ms
55,684 KB
testcase_11 AC 102 ms
55,588 KB
testcase_12 AC 102 ms
55,980 KB
testcase_13 AC 108 ms
55,816 KB
testcase_14 AC 102 ms
55,780 KB
testcase_15 AC 103 ms
56,004 KB
testcase_16 AC 102 ms
55,744 KB
testcase_17 AC 108 ms
55,948 KB
testcase_18 AC 104 ms
55,616 KB
testcase_19 AC 103 ms
55,844 KB
testcase_20 AC 103 ms
55,592 KB
testcase_21 AC 108 ms
56,248 KB
testcase_22 AC 102 ms
56,252 KB
testcase_23 AC 103 ms
55,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long A = scan.nextLong();
		long B = scan.nextLong();
		long C = scan.nextLong();
		scan.close();
		long t = C / (A + B - 1);
		//long ans = t * A + Math.min(A, C % (A + B - 1));
		//System.out.println(ans);
		System.out.println(t * A + Math.min(C - t * (A + B - 1), A));
	}
}
0