結果

問題 No.2138 Add Bacon
ユーザー ぬ
提出日時 2022-12-01 17:13:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 73,644 KB
実行使用メモリ 41,436 KB
最終ジャッジ日時 2024-04-17 06:38:22
合計ジャッジ時間 6,170 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
41,104 KB
testcase_01 AC 115 ms
40,388 KB
testcase_02 AC 125 ms
41,252 KB
testcase_03 AC 122 ms
40,736 KB
testcase_04 AC 115 ms
39,956 KB
testcase_05 AC 126 ms
41,064 KB
testcase_06 AC 123 ms
41,424 KB
testcase_07 AC 115 ms
39,884 KB
testcase_08 AC 122 ms
40,996 KB
testcase_09 AC 126 ms
41,392 KB
testcase_10 AC 128 ms
41,024 KB
testcase_11 AC 128 ms
41,032 KB
testcase_12 AC 114 ms
41,436 KB
testcase_13 AC 114 ms
40,132 KB
testcase_14 AC 123 ms
41,100 KB
testcase_15 AC 115 ms
39,868 KB
testcase_16 AC 115 ms
41,424 KB
testcase_17 AC 126 ms
40,992 KB
testcase_18 AC 117 ms
39,872 KB
testcase_19 AC 120 ms
40,156 KB
testcase_20 AC 115 ms
40,264 KB
testcase_21 AC 127 ms
41,008 KB
testcase_22 AC 130 ms
41,284 KB
testcase_23 AC 127 ms
41,192 KB
testcase_24 AC 121 ms
39,928 KB
testcase_25 AC 119 ms
40,248 KB
testcase_26 AC 118 ms
40,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(),b = sc.nextInt(),c = sc.nextInt(),d = sc.nextInt(),e = sc.nextInt();
		int ans = a-b;
		if(d>e)ans += c*(d-e);
		System.out.println(ans);
		sc.close();
	}
}
0