結果

問題 No.604 誕生日のお小遣い
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-15 19:30:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 4,202 ms
コンパイル使用メモリ 71,672 KB
実行使用メモリ 60,656 KB
最終ジャッジ日時 2023-08-27 07:20:39
合計ジャッジ時間 8,362 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
60,656 KB
testcase_01 AC 126 ms
55,992 KB
testcase_02 AC 128 ms
56,284 KB
testcase_03 AC 127 ms
55,672 KB
testcase_04 AC 127 ms
55,884 KB
testcase_05 AC 126 ms
56,000 KB
testcase_06 WA -
testcase_07 AC 126 ms
56,124 KB
testcase_08 AC 129 ms
55,732 KB
testcase_09 AC 128 ms
56,380 KB
testcase_10 AC 125 ms
56,000 KB
testcase_11 AC 126 ms
56,116 KB
testcase_12 AC 128 ms
55,840 KB
testcase_13 AC 132 ms
55,588 KB
testcase_14 AC 125 ms
55,984 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