結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
machy
|
| 提出日時 | 2015-06-13 17:16:31 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 5,000 ms |
| + 492µs | |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 378 ms |
| コンパイル使用メモリ | 98,960 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-19 04:16:36 |
| 合計ジャッジ時間 | 2,421 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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