시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 20 15 13 86.667%

문제

EDSAC (ElectronicDelay Storage Automatic Calculator)은 프로그램을 주기억장치에 두고 실행할 수 있는 최초의 디지털 컴퓨터이다. EDSAC에는 가산기를 사용하는 명령어가 내장되어 있으며, 17비트 word 타입과 35비트 double word 타입을 기반으로 계산한다. 또한 입출력을 위해 5비트 텔레타이프 코드를 사용한다.

EDSAC 프로그램은 매우 간단한 어셈블리어로 만들 수 있다. 이 어셈블리어의 각 명령어는 문자 하나와 음이 아닌 십진수 주소값, 그리고 F나 D로 이뤄져 있다. F는 full word타입, D는 double word타입을 의미한다. 예를 들어 명령어 "A 128 F"는 가산기에 메모리 상에서 128 주소에 있는 full word 타입 변수값을 더하라는 의미이다. 이 연산은 이진수로 11100000100000000으로 표현된다. 앞의 11100은 "add"를 의미하는 5비트의 opcode이고, 다음 11비트 00010000000(=128)은 피연산자를 나타내며, 마지막의 0은 full word타입을 연산한다는 것을 의미한다. (double word 타입이라면 마지막 자리는 1이 된다.)

EDSAC 연산은 부동소수점 2의 보수 연산이지만, 단순한 정수 사칙연산이 아닌 현대 컴퓨터와 비슷한 방법으로 수를 연산한다. EDSAC의 연산 장치는 소수점이 가장 높은 자릿수(가장 왼쪽에 있는 자릿수)와 그 다음 자릿수(바로 오른쪽에 있는 자릿수) 사이에 있다고 가정한다. 따라서 17비트 word 타입 x의 표현 범위는 -1.0 ≤ x < 1.0이다.

 값 이진수 표현 
-1.0   10000000000000000
 1/2  01000000000000000
 3/4  01100000000000000
 -1/2 11000000000000000

따라서 가능한 가장 큰 양의 실수는 01111111111111111 = 0.9999847412109375이고, 가장 작은 양의 실수는 00000000000000001 = 2^(-16) = 0.0000152587890625이다.

우연의 일치인지 의도적인 설계인지, opcode add 연산과 텔레타이프 코드 'A'는 11100으로 일치하며, subtract 연산과 'S' 역시 01100으로 일치한다. 또한 텔레타이프 코드로 표현할 수 있는 알파벳은 "PQWERTYUIOJ#SZK*?F@D!HNM&LXGABCV"로 모두 32자인데, 5비트 opcode로 표현할 수 있는 수의 개수도 32개이다. (텔레타이프 코드로 P는 00000, Q는 00001로 위 순서대로 증가하여 V는 11111으로 표현된다.) 이 특성 덕분에 EDSAC 어셈블러를 만들기가 쉬워졌다.

그러나 EDSAC 어셈블러에는 특별히 데이터 값을 표현하는 특별한 코드가 없다. 그래서 한 EDSAC 프로그래머는 일반 명령어를 데이터 값 표현에 쓰기로 했다. 예를 들어 상수 3/4(01100000000000000)는 “S 0 F로 표현되며, 1/3(약 00101010101010101)은 “T 682 D”로 표현된다. (T=00101, 682=010101010101)

십진수가 입력으로 주어졌을 때 이를 적절한 EDSAC 명령어로 표현하는 프로그램을 작성하시오.

입력

입력의 첫째 줄에는 테스트 케이스의 수를 나타내는 정수 P(1 ≤ P ≤ 1000)가 하나 주어진다. 각 테스트 케이스는 십진수 D가 한 줄 주어진다. D는 sd.ddd....의 형태로 주어지는데, s는 마이너스 부호이고 생략될 수 있다. d는 십진수 한 자리(0-9)이다. 소수점 이하는 최소 한 자리 이상 최대 16자리 이하로 주어진다.

출력

각 테스트 케이스에 대해 입력으로 주어진 수를 표현하기 위한 EDSAC 명령어 한 줄을 출력한다. 출력은 opcode 문자 하나와 공백 하나, 음이 아닌 십진수 정수인 피연산자 하나와 공백 하나, 'F' 또는 'D'로 이뤄져 있다. 만약 입력으로 주어진 수가 정확히 17비트로 표현할 수 없는 수라면, 0에 더 가까운 수로 표현한다. (양수라면 내림, 음수라면 올림한다.)

D가 -1.0 <= D < 1.0 범위의 수가 아니라면 EDSAC 명령어 대신 "INVALID VALUE"를 출력한다.

예제 입력 1

16
0.5
-0.5
-1.0000000
0.1
0.0000152587890625
0.0000152587890624
0.0000152587890626
-0.0000152587890625
-0.0000152587890624
-0.0000152587890626
0.9999999999999999
-0.9999999999999999
-5.3
9.1
-1.0000000000000001
0.31415926

예제 출력 1

I 0 F
& 0 F
? 0 F
Q 1228 D
P 0 D
P 0 F
P 0 D
V 2047 D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> 2011 Greater New York Programming Contest C번

  • 문제의 오타를 찾은 사람: 2u_my_light
  • 문제를 번역한 사람: arine