結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
|
提出日時 | 2021-08-08 06:19:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 46 ms / 5,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 1,712 ms |
コンパイル使用メモリ | 172,312 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 07:32:12 |
合計ジャッジ時間 | 3,127 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int r,g,b; cin>>r>>g>>b; vector<int> a={r,g,b}; sort(a.begin(),a.end()); int ans=0; while(a[0]>=ans){ ans=max(ans,a[0]); a[0]++,a[2]-=2; sort(a.begin(),a.end()); } cout<<ans<<endl; }