結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー 184
提出日時 2014-12-08 07:41:13
言語 C++11(廃止可能性あり)
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 565 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 463 ms
コンパイル使用メモリ 66,404 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-05 00:20:17
合計ジャッジ時間 1,475 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 25 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
using namespace std;

//namaega184

int main(){
	
	
	int rgb[3];scanf("%d%d%d",&rgb[0],&rgb[1],&rgb[2]);
	int ans;
	sort(rgb,rgb+3);ans=rgb[0];
	for(int i=1;i<3;i++)rgb[i]-=rgb[0];
	rgb[2]-=rgb[1];
	if(rgb[1]==0){
		ans+=rgb[2]/5;
	}
	else{
		if((rgb[2]/2)<rgb[1]){
			rgb[2];
			ans+=rgb[2]/2+(rgb[1]-=rgb[2]/2)/2;
		}
		else{
			ans+=rgb[1];
			rgb[2]-=rgb[1]*2;
			ans+=rgb[2]/5;
		}
		
	} 
	
	printf("%d\n",ans);
	
	return 0;
}
0