1. 프로그램이 일정 시간 안에 정상적으로 종료된다는 조건을 추가해 주세요. 현재 지문에 의하면 무한 루프를 돌아도 조건에 위배되지 않습니다. 아래 문장을 추가해 주세요. (제출번호 89053647, 89053661에서 assert문으로 최대 179번의 명령만 실행된다는 것을 확인했습니다.)
You can assume that programs will terminate before executing at most 180 instructions.
2. 입력의 마지막에 아래 문장을 추가해주세요.
In the beginning, the value of the $pc variable is set to 0. After executing an instruction, the value of the $pc is incremented by 1.
또한 입력 란의 jeq를 다음과 같이 수정해 주세요.
jeq -- Jump to the instruction on the value of the second argument and do not increment the $pc, if the value of the first argument equals $cmp
oh040411 1년 전 1
1. 프로그램이 일정 시간 안에 정상적으로 종료된다는 조건을 추가해 주세요. 현재 지문에 의하면 무한 루프를 돌아도 조건에 위배되지 않습니다. 아래 문장을 추가해 주세요. (제출번호 89053647, 89053661에서 assert문으로 최대 179번의 명령만 실행된다는 것을 확인했습니다.)
You can assume that programs will terminate before executing at most 180 instructions.
2. 입력의 마지막에 아래 문장을 추가해주세요.
In the beginning, the value of the
$pcvariable is set to 0. After executing an instruction, the value of the$pcis incremented by 1.또한 입력 란의 jeq를 다음과 같이 수정해 주세요.
jeq-- Jump to the instruction on the value of the second argument and do not increment the$pc, if the value of the first argument equals$cmp