結果

問題 No.91 赤、緑、青の石
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-30 17:19:47
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 2,453 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 41,544 KB
最終ジャッジ日時 2024-04-30 00:44:49
合計ジャッジ時間 7,577 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 118 ms
40,156 KB
testcase_08 AC 128 ms
41,164 KB
testcase_09 AC 121 ms
41,168 KB
testcase_10 AC 128 ms
41,060 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 117 ms
41,160 KB
testcase_17 AC 128 ms
41,248 KB
testcase_18 AC 111 ms
40,260 KB
testcase_19 AC 125 ms
41,112 KB
testcase_20 AC 127 ms
41,272 KB
testcase_21 AC 120 ms
41,120 KB
testcase_22 AC 121 ms
40,136 KB
testcase_23 AC 118 ms
40,520 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 128 ms
41,508 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 129 ms
41,276 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

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