시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB | 473 | 195 | 161 | 46.667% |
$A+B$ is a problem used to test one's basic knowledge for competitive programming. Here is yet another boring variation of it.
You have two integers, $A$ and $B$. You want to make them equal. To do so, you can perform several steps, where each step is one of the following:
Unfortunately, $A+B$ is a hard problem for us, so you are allowed to make at most 5000 steps.
In the first line, two space-separated integers $A$ and $B$ are given. These are the initial values of the variables $A$ and $B$.
In the first line, print a single integer $n$ ($0 \le n \le 5\,000$) denoting the number of steps.
In the next $n$ lines, print one of the following strings to denote your desired operation: A+=A, A+=B, B+=A, B+=B.
Any sequence of steps that yields the desired result will be judged correct.
This subtask has an additional constraint:
This subtask has no additional constraints.
2 3
4 B+=B B+=A A+=A A+=A
University > KAIST > 2019 KAIST RUN Spring Contest D번
Contest > Open Cup > 2018/2019 Season > Stage 19: Grand Prix of Daejeon A번