結果

問題 No.176 2種類の切手
ユーザー htensaihtensai
提出日時 2019-11-27 09:08:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 2,456 ms
コンパイル使用メモリ 73,932 KB
実行使用メモリ 41,668 KB
最終ジャッジ日時 2024-04-25 07:47:30
合計ジャッジ時間 8,219 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,196 KB
testcase_01 AC 138 ms
41,172 KB
testcase_02 AC 136 ms
41,284 KB
testcase_03 AC 137 ms
41,108 KB
testcase_04 AC 120 ms
39,968 KB
testcase_05 AC 132 ms
41,084 KB
testcase_06 AC 134 ms
41,084 KB
testcase_07 AC 135 ms
41,160 KB
testcase_08 AC 120 ms
40,488 KB
testcase_09 AC 134 ms
41,072 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 131 ms
41,120 KB
testcase_13 AC 141 ms
41,264 KB
testcase_14 AC 138 ms
41,292 KB
testcase_15 AC 140 ms
41,088 KB
testcase_16 AC 136 ms
41,364 KB
testcase_17 WA -
testcase_18 AC 135 ms
41,072 KB
testcase_19 AC 136 ms
41,304 KB
testcase_20 AC 135 ms
41,240 KB
testcase_21 AC 121 ms
40,252 KB
testcase_22 AC 135 ms
41,048 KB
testcase_23 AC 133 ms
41,280 KB
testcase_24 AC 133 ms
41,248 KB
testcase_25 WA -
testcase_26 AC 137 ms
41,444 KB
testcase_27 AC 136 ms
41,244 KB
testcase_28 AC 138 ms
41,096 KB
testcase_29 AC 137 ms
41,276 KB
testcase_30 AC 136 ms
41,152 KB
testcase_31 AC 134 ms
40,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();
		long b = sc.nextInt();
		long t = sc.nextInt();
		long min = Long.MAX_VALUE;
		for (int i = 0; i <= a && b * i <= t; i++) {
		    long value = (t - b * i + a - 1) / a * a + b * i;
		    min = Math.min(value, min);
		}
		System.out.println(min);
	}
}
0