Official
A - 羊の数え直し / Recounting the Sheep Editorial by admin Editorial for printing
swe-2-highThere were \(A+B\) sheep in the morning, so the count is consistent exactly when the evening count \(C\) equals \(A+B\). The program reads the three integers and prints Yes if a + b == c, otherwise No. Merging the two flocks does not change the total number of sheep, so the equality ‘morning total = evening count’ holds if and only if no sheep was lost or gained. A single comparison therefore decides the answer. Both time and space are \(O(1)\).
posted:
last update: