結果

問題 No.920 あかあお
ユーザー htensaihtensai
提出日時 2019-11-10 20:42:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 2,883 ms
コンパイル使用メモリ 74,452 KB
実行使用メモリ 57,520 KB
最終ジャッジ日時 2023-10-24 11:38:57
合計ジャッジ時間 5,471 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
57,464 KB
testcase_01 AC 115 ms
56,132 KB
testcase_02 AC 124 ms
57,364 KB
testcase_03 AC 125 ms
57,076 KB
testcase_04 AC 125 ms
57,496 KB
testcase_05 AC 113 ms
56,040 KB
testcase_06 AC 124 ms
57,420 KB
testcase_07 AC 125 ms
57,356 KB
testcase_08 AC 122 ms
57,216 KB
testcase_09 AC 123 ms
57,520 KB
testcase_10 AC 125 ms
57,392 KB
testcase_11 AC 125 ms
57,244 KB
testcase_12 AC 114 ms
56,188 KB
testcase_13 AC 128 ms
57,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int z = sc.nextInt();
		int max = 0;
		for (int i = 0; i <= z; i++) {
		    max = Math.max(max, Math.min(x + i, y + z - i));
		}
		System.out.println(max);
	}
}
0