結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
|
提出日時 | 2023-05-03 08:17:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 5,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 600 ms |
コンパイル使用メモリ | 65,072 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 15:22:07 |
合計ジャッジ時間 | 1,587 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
#include <iostream> using namespace std; int main() { int R, G, B; cin >> R >> G >> B; int maxnum = (R + G + B) / 3; int res; for (res = maxnum; res >= 0; --res) { int r = R - res; int g = G - res; int b = B - res; if (r > 0) r /= 2; if (g > 0) g /= 2; if (b > 0) b /= 2; if (r + g + b >= 0) break; } cout << res << endl; }