結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
![]() |
提出日時 | 2015-06-13 17:14:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 496 bytes |
コンパイル時間 | 538 ms |
コンパイル使用メモリ | 74,072 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 19:47:53 |
合計ジャッジ時間 | 2,338 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 24 WA * 4 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <iomanip> #include <map> using namespace std; typedef long long LL; int main(){ int r, g, b; cin >> r >> g >> b; int ans = 0; for(int i = 1; i <= 10000000; i++){ int over = max(0, r-i) + max(0, g-i) + max(0, b-i); int short_cnt = max(0, i-r) + max(0, i-g) + max(0, i-b); if(over / 2 >= short_cnt) ans = i; } cout << ans << endl; return 0; }