結果
問題 | No.91 赤、緑、青の石 |
ユーザー |
![]() |
提出日時 | 2014-12-07 19:51:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 913 ms / 5,000 ms |
コード長 | 961 bytes |
コンパイル時間 | 669 ms |
コンパイル使用メモリ | 85,196 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 06:44:33 |
合計ジャッジ時間 | 29,606 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
#define _USE_MATH_DEFINES #include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <cfloat> #include <climits> #include <cstring> #include <cmath> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> i_i; typedef pair<ll, int> ll_i; typedef pair<double, int> d_i; typedef pair<ll, ll> ll_ll; typedef pair<double, double> d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-9; int main() { int R, G, B; cin >> R >> G >> B; vector<int> a(3); a[0] = R; a[1] = G; a[2] = B; int maxi = 0; for (int t = 0; t < 100000000; t++) { sort(a.begin(), a.end()); maxi = max(maxi, a[0]); if (a[2] >= 2) { a[0]++; a[2] -= 2; } } cout << maxi << endl; }