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

15612번 - Cube Bits 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 512 MB38019113645.033%

문제

The new computers are here! However, we made a mistake during the order: we thought we were ordering machines with qubits; in fact, we ordered several hundred computers powered by cube-bits.

The programs and data we had ready were prepared in base 10. To feed the data into the new computer, which uses a cubic system of counting, we will need to convert it to base 3 first.

Write a program to convert a stream of decimal numbers into ternary format, so they fit the new system’s input bus.

입력

The input consists of:

  • One line with an integer n (1 ≤ n ≤ 106), the size of the data stream.
  • n lines with one decimal integer vi (0 ≤ v < 320), the decimal representation of the i-th integer in the data stream.

출력

Output n lines, giving the numbers converted to base-3, in the same order as given. In the interest of conserving disk space, do not print leading zeroes.

제한

예제 입력 1

4
12
14
13
15

예제 출력 1

110
112
111
120

예제 입력 2

2
2147483648
3486784400

예제 출력 2

12112122212110202102
22222222222222222222

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2017 연습 세션 PC번

  • 문제를 만든 사람: Robin Lee
(追記) (追記ここまで)

출처

대학교 대회

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

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