結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
machy
|
| 提出日時 | 2015-06-13 17:16:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 5,000 ms |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 614 ms |
| コンパイル使用メモリ | 80,420 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-07 12:22:10 |
| 合計ジャッジ時間 | 1,961 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
#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)/2 + max(0, g-i)/2 + max(0, b-i)/2;
int short_cnt = max(0, i-r) + max(0, i-g) + max(0, i-b);
if(over >= short_cnt) ans = i;
}
cout << ans << endl;
return 0;
}
machy