No.1729 ~Check the Samples Carefully!~ Hexadecimal and Octal (1)
Problem Statement
You are given an integer $N$ whose base-$16$ representation contains no digits other than A,B,C,D,E,F.
Here, the digits A ~ F represent ten through fifteen, respectively.
Output the digit that appears most frequently when $N$ is written in base $8$.
If there are multiple such digits, output all of them in ascending order.
Input
$N$
- $0 \le N \le {(16^{200})}_{10}$
- $N$ is given in base-$16$ representation
- $N$ consists only of
A,B,C,D,E,F
Output
Output the digits that appear most frequently when $N$ is converted to base $8$, in ascending order of digit value, separated by spaces on 1 line.
Print a newline at the end.
Sample
Sample 1
Input
A
Output
1 2
A in base $16$ is 10 in base $10$ and 12 in base $8$.
Sample 2
Input
CCCCCCCCCC
Output
1 4
Converted to base $10$, it is 879609302220, in which $2$ and $0$ appear most frequently, the same number of times.
Converted to base $8$, $1$ and $4$ appear most frequently, the same number of times.
Sample 3
Input
ECACCCBCCACEDCFFACACB
Output
1
Be careful of overflow.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
H20
naskya