結果

問題 No.91 赤、緑、青の石
ユーザー hhgfhn1
提出日時 2018-10-30 17:19:47
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 2,113 ms
コンパイル使用メモリ 74,924 KB
実行使用メモリ 56,508 KB
最終ジャッジ日時 2024-11-19 10:41:40
合計ジャッジ時間 7,766 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int r=scanner.nextInt();
		int b=scanner.nextInt();
		int g=scanner.nextInt();
		int x[]=new int[3];
		x[0]=r;
		x[1]=b;
		x[2]=g;
		Arrays.sort(x);
		int tmp=(x[2]-x[0])/3;
		x[0]+=tmp;
		x[2]-=tmp*2;
		Arrays.sort(x);
		tmp=(x[2]-x[0])/3;
		x[0]+=tmp;
		x[2]-=tmp*2;
		Arrays.sort(x);
		System.out.println(x[0]);
	}
}
0