結果

問題 No.91 赤、緑、青の石
ユーザー naimonon77
提出日時 2015-09-22 15:32:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 7 ms / 5,000 ms
コード長 769 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 68,496 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 06:51:04
合計ジャッジ時間 1,510 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
using namespace std;


#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double lb;

/* ここからが本編 */
int main(void)
{
   int i,j,k;
   int e[3];
   int ans = 0;
   int tmp;
   cin >> e[0] >> e[1] >> e[2] ;
   sort(e,e+3);

   ans += e[0];
   e[2] -= e[0]; e[1] -= e[0];  e[0] = 0;

   /* e[0] = 0 */
   while(1) {
      if(e[1] > e[2]) swap(e[1],e[2]);
      if(e[2] >= 3 && e[1] >= 1) {
         ans++; e[2] -= 3; e[1] -= 1;
      }
      else break;
   }

   tmp = e[2] / 5;
   ans += tmp;
   cout << ans << endl;
   return 0;
}
0