結果

問題 No.91 赤、緑、青の石
ユーザー tubo28tubo28
提出日時 2014-12-07 20:52:26
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,515 bytes
コンパイル時間 1,328 ms
コンパイル使用メモリ 75,476 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-02 10:25:19
合計ジャッジ時間 2,631 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 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,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 1 ms
4,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
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);

int f(int& x1,int& x2){
    int t1 = min(x2/3,x1);
    int t2 = x2/5 + x1/5;
    if(t1 < t2){
        x1 -= t1;
        x2 -= t1*3;
        return t2;
    } else {
        x1 -= x1/5*5;
        x2 -= x2/5*5;
        return t1;
    }
}

int main(){
    int a[3];
    while(cin>>a[0]){
        rep(i,2)cin>>a[i+1];
        sort(a,a+3);
        int ans=0;
        {
            int x = min({a[0],a[1],a[2]});
            ans += x;
            rep(i,3)a[i]-=x;
            dump(x);
        }
        {
            int t = f(a[1],a[2]);
            int u = f(a[2],a[1]);
            ans += t+u;
        }
        cout << ans << endl;
    }
}
0