結果

問題 No.91 赤、緑、青の石
ユーザー ikdikd
提出日時 2016-07-23 20:07:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 772 ms
コンパイル使用メモリ 64,068 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 08:02:46
合計ジャッジ時間 2,090 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
5,248 KB
testcase_01 AC 19 ms
5,376 KB
testcase_02 AC 13 ms
5,376 KB
testcase_03 AC 23 ms
5,376 KB
testcase_04 AC 12 ms
5,376 KB
testcase_05 AC 27 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 8 ms
5,376 KB
testcase_12 AC 24 ms
5,376 KB
testcase_13 AC 26 ms
5,376 KB
testcase_14 AC 19 ms
5,376 KB
testcase_15 AC 28 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 42 ms
5,376 KB
testcase_26 AC 40 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 28 ms
5,376 KB
testcase_31 AC 39 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){

    vector<int> C(3);
    for(int i=0; i<3; i++){
        cin>> C[i];
    }

    sort(C.begin(), C.end());

    int cnt=0;
    while(C[0]>0){
        cnt++;
        C[0]--; C[1]--; C[2]--;
    }

    while(C[1]>0&&C[2]-2>0){
        C[1]--;
        C[2]-=3;
        cnt++;
        sort(C.begin(), C.end());
    }

    if(C[1]==0) cnt+=C[3]/5;

    cout<< cnt<< endl;

    return 0;
}
0