結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー t98slider
提出日時 2021-08-08 06:19:03
言語 C++14
(gcc 13.3.0 + boost 1.89.0)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 296 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,521 ms
コンパイル使用メモリ 165,948 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2025-12-07 12:38:17
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

int main(){
    int r,g,b;
    cin>>r>>g>>b;
    vector<int> a={r,g,b};
    sort(a.begin(),a.end());
    int ans=0;
    while(a[0]>=ans){
        ans=max(ans,a[0]);
        a[0]++,a[2]-=2;
        sort(a.begin(),a.end());
    }
    cout<<ans<<endl;
}
0