結果
| 問題 |
No.91 赤、緑、青の石
|
| ユーザー |
|
| 提出日時 | 2020-04-12 04:25:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 547 bytes |
| コンパイル時間 | 901 ms |
| コンパイル使用メモリ | 76,788 KB |
| 最終ジャッジ日時 | 2025-01-09 17:36:41 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 WA * 6 |
ソースコード
#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]);
}
std::cout << ans << std::endl;
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}