結果

問題 No.920 あかあお
ユーザー ks2mks2m
提出日時 2019-11-08 22:01:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 3,157 ms
コンパイル使用メモリ 74,124 KB
実行使用メモリ 53,584 KB
最終ジャッジ日時 2023-10-24 11:20:55
合計ジャッジ時間 3,299 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
53,564 KB
testcase_01 AC 50 ms
53,568 KB
testcase_02 AC 50 ms
53,572 KB
testcase_03 AC 50 ms
53,572 KB
testcase_04 AC 50 ms
53,564 KB
testcase_05 AC 51 ms
53,584 KB
testcase_06 AC 51 ms
53,572 KB
testcase_07 AC 49 ms
51,532 KB
testcase_08 AC 50 ms
53,564 KB
testcase_09 AC 51 ms
53,564 KB
testcase_10 AC 51 ms
53,572 KB
testcase_11 AC 51 ms
51,540 KB
testcase_12 AC 50 ms
53,572 KB
testcase_13 AC 51 ms
53,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int x = Integer.parseInt(sa[0]);
		int y = Integer.parseInt(sa[1]);
		int z = Integer.parseInt(sa[2]);
		br.close();

		if (x > y + z) {
			System.out.println(y + z);
		} else if (x + z < y) {
			System.out.println(x + z);
		} else {
			System.out.println((x + y + z) / 2);
		}
	}
}
0