結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
5,248 KB
testcase_01 AC 18 ms
5,376 KB
testcase_02 AC 12 ms
5,376 KB
testcase_03 AC 20 ms
5,376 KB
testcase_04 AC 10 ms
5,376 KB
testcase_05 AC 23 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 7 ms
5,376 KB
testcase_12 AC 20 ms
5,376 KB
testcase_13 AC 27 ms
5,376 KB
testcase_14 AC 16 ms
5,376 KB
testcase_15 AC 25 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 38 ms
5,376 KB
testcase_26 AC 37 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 26 ms
5,376 KB
testcase_31 AC 34 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