結果

問題 No.91 赤、緑、青の石
ユーザー k_kadora
提出日時 2015-06-15 06:26:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 155 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 3,363 ms
コンパイル使用メモリ 74,528 KB
実行使用メモリ 41,812 KB
最終ジャッジ日時 2024-06-24 06:50:19
合計ジャッジ時間 8,892 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

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