結果

問題 No.91 赤、緑、青の石
ユーザー tubo28tubo28
提出日時 2014-12-07 21:19:31
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,493 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 76,260 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 10:37:49
合計ジャッジ時間 4,064 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 114 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,384 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 396 ms
4,376 KB
testcase_28 AC 302 ms
4,380 KB
testcase_29 AC 143 ms
4,380 KB
testcase_30 AC 2 ms
4,380 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(int a, int b){
    int res=0;
    rep(i,2){
        int x = min(a,b/3);
        res += x;
        a-=x; b-=x*3;
        swap(a,b);
    }
    res += a/5 + b/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);
        do{
            for(int i=0;i<=m;i++){
                int t = i+solve(a[1]-i,a[2]-i);
                ans = max(ans,t);
                dump(i,ans);
            }
        }while(next_permutation(a,a+3));
        cout << ans << endl;
    }
}
0