結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー ngtkana
提出日時 2020-03-26 00:38:24
言語 C++17
(gcc 13.3.0 + boost 1.89.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 449 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,488 ms
コンパイル使用メモリ 200,728 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-12-07 12:35:49
合計ジャッジ時間 2,748 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    std::vector<lint>a(3);
    for(lint&x:a)std::cin>>x;
    while(true){
        std::sort(a.begin(),a.end());
        if(a.back()-a.front()<3)break;
        a.front()++;
        a.back()-=2;
    }
    std::cout<<*std::min_element(a.begin(),a.end())<<'\n';
}
0