#885
Bronze IV
OKTALNI
시간 제한
1s
메모리 제한
32MB
제출
2
정답
1
맞힌 사람
1
정답 비율
50.0%

문제

Slavko is learning about different numeral systems. Slavko is not the brightest when it comes to math, so he is starting out converting binary numerals to octal. The algorithm Slavko uses is this:

  • Pad the binary numeral with zeros on the left until the number

of digits is divisible by three.

  • Group adjacent binary digits into groups of 3 digits.

  • Replace each group of binary digits with the corresponding

octal digit (as in the table on the right). Write a program that converts a binary numeral to octal so that Slavko can verify his results. 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7

입력

The input contains a binary numeral. The number of digits will be less than 100, and the first digit will be 1.

출력

Output the number in octal.

예제 입력 1

1010

예제 출력 1

12

예제 입력 2

11001100

예제 출력 2

314
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
#순위사용자언어시간메모리코드 길이
9459🥇
서준
Python7ms8136KB259B
난이도 투표
Bronze IV1명 투표· 3개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
#사용자문제결과언어시간메모리코드 길이제출 시간
9459
맞았습니다
Python7ms8136KB259B2026. 07. 13. 11:39
9458
틀렸습니다
Python--255B2026. 07. 13. 11:38