| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 217 | 121 | 116 | 57.426% |
Given three integers and the arithmetic operators ($+,ドル $-,ドル $*,ドル $/$), determine the smallest non-negative integer possible without changing the order of the initial integers. Order of the operators is without their normal precedence, just left-to-right. Note: integer division is fine only if the remainder is zero. For example, 9ドル/3$ is okay, 10ドル/3$ is not.
For example:
For 2ドル,ドル 3ドル$ and 5ドル,ドル the answer is 0ドル$ (2ドル+3-5$)
For 9ドル,ドル 9ドル$ and 9ドル,ドル the answer is 0ドル$ (9ドル-9\ /\ 9$)
For 5ドル,ドル 7ドル$ and 3ドル,ドル the answer is 1ドル$ (5ドル-7+3$)
Given three integers, determine the smallest non-negative result that can be computed by placement of the given operators between the numbers. The operators may only be placed between numbers, not in front (they are not unary operators). An operator must be placed between each pair of numbers, numbers cannot be concatenated.
The single line of input contains three integers, all in the range from 1ドル$ to 1ドル{,}000$.
Output a single integer, which is the smallest non-negative value possible applying the arithmetic operators.
2 3 5
0
9 9 9
0
5 7 3
1
ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2022 K번