結果

問題 No.604 誕生日のお小遣い
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-15 19:33:00
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 397 bytes
コンパイル時間 3,257 ms
コンパイル使用メモリ 71,660 KB
実行使用メモリ 60,128 KB
最終ジャッジ日時 2023-08-27 07:24:53
合計ジャッジ時間 7,872 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
60,128 KB
testcase_01 AC 112 ms
55,980 KB
testcase_02 AC 111 ms
55,744 KB
testcase_03 AC 116 ms
55,928 KB
testcase_04 AC 114 ms
55,856 KB
testcase_05 AC 113 ms
55,692 KB
testcase_06 AC 116 ms
55,944 KB
testcase_07 AC 119 ms
55,440 KB
testcase_08 AC 120 ms
55,964 KB
testcase_09 AC 116 ms
56,036 KB
testcase_10 AC 117 ms
56,024 KB
testcase_11 AC 120 ms
56,148 KB
testcase_12 AC 122 ms
54,016 KB
testcase_13 AC 123 ms
55,792 KB
testcase_14 AC 120 ms
55,860 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No604 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long k,K,sum;
		for(k = 0;(A+B-1) * k < C;k++) {
		}
		k -= 1;
		sum = (A+B-1) * k;
		if(C - sum <= A - 1) {
			K = C - sum;
		}else {
			K = A;
		}
		System.out.println(k * A + K);
	}
}

0