bubbler   1년 전

List with two elements is given. The first element contains A and the second element contains B.

이 문장에 따르면 시작은 [A, B] 입니다.

DOLLAR - If the first element of a list contains expression s and the second element contain expression t then this command removes those two elements from list and creates new first element containing expression (t$s).

예제 1의 출력인 SWAP DOLLAR를 수행하면 [A, B]가 [B, A]가 되고 (SWAP), 그 다음 first(s)가 B고 second(t)가 A이므로 DOLLAR의 결과는 (A$B)가 되어야 하는데, 이는 입력과 반대입니다.

다른 예제도 확인한 결과 시작을 [B, A]로 바꾸면 모든 예제가 맞는 것을 확인했습니다. 또한 그렇게 풀었을 때 AC를 받는 것도 확인했습니다. 따라서 맨 첫 줄의 문장에서 B와 A를 서로 바꾸는 것이 맞을 것 같습니다.

댓글을 작성하려면 로그인해야 합니다.