結果

問題 No.604 誕生日のお小遣い
ユーザー htensaihtensai
提出日時 2019-11-14 11:49:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 2,110 ms
コンパイル使用メモリ 74,012 KB
実行使用メモリ 57,708 KB
最終ジャッジ日時 2023-10-21 19:57:25
合計ジャッジ時間 6,275 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 121 ms
57,472 KB
testcase_02 AC 120 ms
57,468 KB
testcase_03 AC 115 ms
57,240 KB
testcase_04 AC 115 ms
57,072 KB
testcase_05 AC 118 ms
57,428 KB
testcase_06 AC 114 ms
57,320 KB
testcase_07 AC 119 ms
57,384 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 121 ms
57,400 KB
testcase_11 AC 119 ms
57,524 KB
testcase_12 AC 116 ms
57,428 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 115 ms
57,224 KB
testcase_16 WA -
testcase_17 AC 127 ms
57,368 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	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 money = (a - 1) + b;
		long count = c / money;
		long mod = c % money;
		long ans = count * a + mod;
	    System.out.println(ans);
	}
}
0