結果

問題 No.920 あかあお
ユーザー masa_ahe
提出日時 2020-03-12 14:40:29
言語 Java
(openjdk 23)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 74,140 KB
実行使用メモリ 54,056 KB
最終ジャッジ日時 2024-11-18 08:12:51
合計ジャッジ時間 3,862 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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