結果

問題 No.91 赤、緑、青の石
ユーザー tubo28tubo28
提出日時 2014-12-07 21:14:24
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,598 bytes
コンパイル時間 1,746 ms
コンパイル使用メモリ 77,424 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-02 10:36:43
合計ジャッジ時間 4,764 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 71 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 247 ms
4,380 KB
testcase_28 AC 190 ms
4,376 KB
testcase_29 AC 89 ms
4,376 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <sstream>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<" ["<<__LINE__<<"]"<<endl)
struct DUMP:ostringstream{template<class T>DUMP &operator,(const T&t){if(this->tellp())*this<<", ";*this<<t;return *this;}};
#else
#define dump(...)
#endif
typedef double R;

const double pi = acos(-1);

// 1 1 1
// 1 3
// 5

int solve(vi& a){
    int res=0;
    {
        int x = min(a[1],a[2]/3);
        res += x;
        a[1]-=x; a[2]-=x*3;
    }
    {
        int y = min(a[2],a[1]/3);
        res += y;
        a[2]-=y; a[1]-=y*3;
    }
    {
        res += a[1]/5 + a[2]/5;
    }
    return res;
}

int main(){
    int a[3];
    while(cin>>a[0]){
        rep(i,2)cin>>a[i+1];
        int ans = 0;
        int m=min({a[0],a[1],a[2]});
        sort(a,a+3);
        for(int i=0;i<=m;i++){
            int t=0;
            t += i;
            vi b(a,a+3);
            rep(j,3)b[j]-=i;
            t += solve(b);
            ans = max(ans,t);
            dump(i,ans);
        }
        cout << ans << endl;
    }
}
0