結果

問題 No.176 2種類の切手
ユーザー noko2250noko2250
提出日時 2015-04-18 14:31:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 491 bytes
コンパイル時間 3,792 ms
コンパイル使用メモリ 75,596 KB
実行使用メモリ 41,636 KB
最終ジャッジ日時 2024-04-16 22:09:11
合計ジャッジ時間 9,362 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 130 ms
41,272 KB
testcase_04 AC 132 ms
41,336 KB
testcase_05 AC 132 ms
41,040 KB
testcase_06 AC 138 ms
41,432 KB
testcase_07 AC 118 ms
40,416 KB
testcase_08 AC 135 ms
41,516 KB
testcase_09 AC 130 ms
41,288 KB
testcase_10 AC 133 ms
41,544 KB
testcase_11 AC 131 ms
41,148 KB
testcase_12 AC 131 ms
41,412 KB
testcase_13 AC 128 ms
41,260 KB
testcase_14 AC 132 ms
41,196 KB
testcase_15 AC 133 ms
41,356 KB
testcase_16 AC 131 ms
41,492 KB
testcase_17 AC 130 ms
41,636 KB
testcase_18 AC 133 ms
41,284 KB
testcase_19 AC 133 ms
41,432 KB
testcase_20 AC 132 ms
41,612 KB
testcase_21 AC 131 ms
41,232 KB
testcase_22 AC 132 ms
41,552 KB
testcase_23 AC 135 ms
41,576 KB
testcase_24 AC 132 ms
41,436 KB
testcase_25 AC 132 ms
41,332 KB
testcase_26 WA -
testcase_27 AC 132 ms
41,152 KB
testcase_28 AC 134 ms
41,336 KB
testcase_29 AC 122 ms
40,272 KB
testcase_30 AC 132 ms
41,172 KB
testcase_31 AC 130 ms
41,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;


public class no176 {
void run() {
	Scanner sc = new Scanner(System.in);
	long A, B, T;
	A = sc.nextInt();
	B = sc.nextInt();
	T = sc.nextInt();
	long ans = Long.MAX_VALUE;
	for (long i = 0; A*i <= T+A && i <= A; i++) {
		ans = Math.min(ans, A*i + (T-A*i+B-1)/B * B);
	}
	System.out.println(ans);
}

void debug(Object... o) {
	System.out.println(Arrays.deepToString(o));
}

public static void main(String[] args) {
	new no176().run();
}
}
0