結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-12 04:27:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 5,000 ms |
| コード長 | 570 bytes |
| 記録 | |
| コンパイル時間 | 679 ms |
| コンパイル使用メモリ | 77,376 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-07 12:36:01 |
| 合計ジャッジ時間 | 1,940 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
void solve() {
std::vector<int> xs(3);
for (auto& x : xs) std::cin >> x;
std::sort(xs.begin(), xs.end());
int d = xs[0];
int ans = d;
for (auto& x : xs) x -= d;
while (xs[1] >= 1 && xs[2] >= 3) {
++ans;
xs[1] -= 1;
xs[2] -= 3;
if (xs[1] > xs[2]) std::swap(xs[1], xs[2]);
}
ans += xs[2] / 5;
std::cout << ans << std::endl;
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}