結果

問題 No.920 あかあお
ユーザー masa_ahemasa_ahe
提出日時 2020-03-12 14:40:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 2,648 ms
コンパイル使用メモリ 74,056 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-04-29 06:54:17
合計ジャッジ時間 5,499 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,468 KB
testcase_01 AC 134 ms
41,200 KB
testcase_02 AC 131 ms
41,516 KB
testcase_03 AC 119 ms
40,188 KB
testcase_04 AC 129 ms
41,064 KB
testcase_05 AC 117 ms
39,912 KB
testcase_06 AC 132 ms
40,804 KB
testcase_07 AC 135 ms
40,916 KB
testcase_08 AC 127 ms
41,244 KB
testcase_09 AC 127 ms
41,064 KB
testcase_10 AC 130 ms
41,272 KB
testcase_11 AC 133 ms
41,188 KB
testcase_12 AC 136 ms
41,328 KB
testcase_13 AC 132 ms
41,212 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 a=Math.max(x,y);
		int b=x+y-a;
		if(a-b>z){
			System.out.println(b+z);
		}else{
			System.out.println(a+(z-a+b)/2);
		}
	}
}
0