Official

A - 二人の水筒 / Two Water Bottles Editorial by admin Editorial for printing

swe-2-high

Explanation

The total water available is \(A + B\) milliliters, so we only need to test whether \(A + B \geq C\). The program reads \(A\), \(B\), \(C\) and prints Yes if a + b >= c holds, otherwise No.

Why it works: the only usable water is the sum \(A + B\), and “enough” means that sum is at least \(C\). The two possible outcomes are exactly the two results of this single comparison, so the conditional output is always correct. Since \(A + B \leq 20000\), everything fits in an int.

The running time is \(O(1)\) and the space usage is \(O(1)\).

posted:
last update: