結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
goodbaton
|
| 提出日時 | 2015-08-04 22:05:01 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 334µs | |
| コード長 | 950 bytes |
| 記録 | |
| コンパイル時間 | 398 ms |
| コンパイル使用メモリ | 93,728 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-19 04:18:54 |
| 合計ジャッジ時間 | 2,170 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstring>
typedef long long ll;
using namespace std;
#define mod 1000000009
#define INF 10000000
#define LLINF 2000000000000000000LL
#define SIZE 101
int main(){
int R,G,B,ans=0;
scanf("%d%d%d",&R,&G,&B);
ans+=min(R,min(G,B));
R-=ans;
G-=ans;
B-=ans;
int l=0,r=max(R,max(G,B)),mid,rest;
while(l<r){
mid = (l+r+1)/2;
rest=0;
rest+=max(R-mid,0)/2;
rest+=max(G-mid,0)/2;
rest+=max(B-mid,0)/2;
rest-=max(mid-R,0);
rest-=max(mid-G,0);
rest-=max(mid-B,0);
if(rest>=0){
l=mid;
}else{
r=mid-1;
}
}
printf("%d\n",ans+l);
return 0;
}
goodbaton