結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー hhgfhn1
提出日時 2018-10-30 18:20:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 201 ms / 5,000 ms
コード長 457 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,336 ms
コンパイル使用メモリ 86,000 KB
実行使用メモリ 47,032 KB
最終ジャッジ日時 2025-12-07 12:32:43
合計ジャッジ時間 8,713 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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);
		while(true) {
		if(x[2]-x[0]<3)break;
		x[0]++;
		x[2]-=2;
		Arrays.sort(x);
		}
		System.out.println(x[0]);
	}
}
0