結果

問題 No.91 赤、緑、青の石
ユーザー itezpace
提出日時 2016-08-02 07:37:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 369 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 65,340 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 06:59:32
合計ジャッジ時間 1,942 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int r,g,b;
  cin>>r>>g>>b;
  vector<int> v;
  v.push_back(r);
  v.push_back(g);
  v.push_back(b);
  while(1){
    sort(v.begin(),v.end(),greater<int>());
    if(v[0]-v[2]<3){
      break;
    } else {
      v[0]-=2;
      v[2]+=1;
    }
  }
  cout<<v[2]<<endl;
  return 0;
}
0