Logo
(追記) (追記ここまで)

22793번 - Radix 3 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB115484645.098%

문제

The Great Sand Council (GSC) of the planet Phleebutt (apologies to Sierra) have devised a base 3 number system to suit their physiology. The symbols used to represent the three valid digits of their number system are ‘0’, ‘1’, and ‘-’, following the unusual configuration of their hands (don’t ask). The decimal counterparts of the three symbols are, respectively, 0, 1 and −1.

Each position in a number has a value three times greater than the position immediately to its right. For example, the number ‘10-’ has the value 8 in decimal, since 1×9+ 0×3+ (−1)× = 8. Similarly, the number ‘-1’ has the decimal value −2, since (−1)×3+1 = −2. GSC representations of integers never start with a digit of zero, except for ‘0’ (a single zero) which has the decimal value 0.

You have to write a program that can convert 32-bit signed decimal integers into their equivalent GSC representations.

입력

Your program will receive a list of integers as input. Each integer will appear in a separate line and be between −231 and 231 − 1. The end of list is indicated by the end of file.

출력

You have to echo the input numbers followed by their GSC representations, as shown in the Sample Output (including all extra symbols).

제한

예제 입력 1

10
2
-17
42
1024

예제 출력 1

10 = 101 GSC
2 = 1- GSC
-17 = -101 GSC
42 = 1---0 GSC
1024 = 111-0-1 GSC

힌트

출처

ICPC > Regionals > Africa and Arab > South Africa Regional Contest > The 2002 ACM South Africa Programming Contest A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /