結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 119 ms
40,280 KB
testcase_04 AC 130 ms
41,320 KB
testcase_05 AC 130 ms
41,160 KB
testcase_06 AC 132 ms
41,240 KB
testcase_07 AC 133 ms
41,068 KB
testcase_08 AC 133 ms
41,136 KB
testcase_09 AC 135 ms
41,152 KB
testcase_10 AC 135 ms
41,288 KB
testcase_11 AC 132 ms
41,308 KB
testcase_12 AC 131 ms
41,528 KB
testcase_13 AC 137 ms
41,628 KB
testcase_14 AC 129 ms
41,140 KB
testcase_15 AC 128 ms
41,128 KB
testcase_16 AC 128 ms
41,332 KB
testcase_17 AC 133 ms
41,416 KB
testcase_18 AC 133 ms
41,168 KB
testcase_19 AC 133 ms
41,492 KB
testcase_20 AC 134 ms
41,308 KB
testcase_21 AC 134 ms
41,376 KB
testcase_22 AC 135 ms
41,268 KB
testcase_23 AC 132 ms
41,204 KB
testcase_24 AC 131 ms
41,420 KB
testcase_25 AC 130 ms
41,332 KB
testcase_26 WA -
testcase_27 AC 131 ms
41,204 KB
testcase_28 AC 135 ms
41,388 KB
testcase_29 AC 136 ms
41,012 KB
testcase_30 AC 131 ms
41,440 KB
testcase_31 AC 130 ms
40,884 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 (int 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