結果

問題 No.604 誕生日のお小遣い
ユーザー YamaKasaYamaKasa
提出日時 2018-09-26 16:31:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 408 bytes
コンパイル時間 1,942 ms
コンパイル使用メモリ 73,956 KB
実行使用メモリ 41,624 KB
最終ジャッジ日時 2024-05-01 14:35:28
合計ジャッジ時間 5,339 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
41,428 KB
testcase_01 AC 108 ms
41,624 KB
testcase_02 AC 102 ms
41,604 KB
testcase_03 AC 102 ms
41,224 KB
testcase_04 AC 103 ms
41,568 KB
testcase_05 AC 109 ms
41,520 KB
testcase_06 AC 102 ms
41,192 KB
testcase_07 AC 104 ms
40,976 KB
testcase_08 AC 108 ms
41,404 KB
testcase_09 AC 115 ms
41,372 KB
testcase_10 AC 117 ms
41,252 KB
testcase_11 AC 102 ms
41,480 KB
testcase_12 AC 116 ms
41,388 KB
testcase_13 AC 110 ms
41,160 KB
testcase_14 AC 101 ms
41,284 KB
testcase_15 AC 101 ms
41,448 KB
testcase_16 AC 99 ms
41,428 KB
testcase_17 AC 116 ms
41,308 KB
testcase_18 AC 117 ms
39,968 KB
testcase_19 AC 114 ms
41,216 KB
testcase_20 AC 108 ms
41,376 KB
testcase_21 AC 111 ms
41,076 KB
testcase_22 AC 109 ms
41,576 KB
testcase_23 AC 112 ms
41,504 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