結果

問題 No.91 赤、緑、青の石
ユーザー k_kadorak_kadora
提出日時 2015-06-15 06:26:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 3,290 ms
コンパイル使用メモリ 72,552 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2023-09-06 12:13:16
合計ジャッジ時間 8,434 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
56,180 KB
testcase_01 AC 130 ms
56,260 KB
testcase_02 AC 126 ms
56,108 KB
testcase_03 AC 134 ms
56,232 KB
testcase_04 AC 131 ms
56,124 KB
testcase_05 AC 131 ms
56,032 KB
testcase_06 AC 127 ms
55,880 KB
testcase_07 AC 129 ms
55,972 KB
testcase_08 AC 128 ms
53,708 KB
testcase_09 AC 128 ms
56,088 KB
testcase_10 AC 129 ms
55,616 KB
testcase_11 AC 139 ms
55,892 KB
testcase_12 AC 143 ms
56,252 KB
testcase_13 AC 141 ms
55,808 KB
testcase_14 AC 142 ms
56,076 KB
testcase_15 AC 146 ms
55,848 KB
testcase_16 AC 130 ms
56,208 KB
testcase_17 AC 128 ms
55,768 KB
testcase_18 AC 124 ms
55,980 KB
testcase_19 AC 123 ms
55,804 KB
testcase_20 AC 120 ms
55,992 KB
testcase_21 AC 119 ms
56,020 KB
testcase_22 AC 119 ms
56,128 KB
testcase_23 AC 115 ms
56,044 KB
testcase_24 AC 117 ms
55,924 KB
testcase_25 AC 132 ms
55,832 KB
testcase_26 AC 135 ms
55,976 KB
testcase_27 AC 121 ms
55,860 KB
testcase_28 AC 114 ms
56,352 KB
testcase_29 AC 116 ms
55,768 KB
testcase_30 AC 128 ms
55,912 KB
testcase_31 AC 129 ms
55,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;
public class Yuki91{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		int temp,res=0;
		for(int i = 0;i<3;i++){
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		res = a[0];
		for(int i = 0;i<3;i++){
			a[i] -= res;
		}
		while(a[1] > 0){
			if(a[2] < 3)break;
			res++;
			a[2] -=3;
			a[1]--;
			if(a[1] > a[2]){
				temp = a[1];
				a[1] = a[2];
				a[2] = temp;
			}
		}
		res += a[2] / 5;
		System.out.println(res);
	}
}
0