問題一覧 > 通常問題

No.1729 ~Check the Samples Carefully!~ Hexadecimal and Octal (1)

レベル : / AI推定難易度 : 235 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 178
作問者 : H20 / テスター : naskya
お気に入りにしたユーザー ProblemId : 7136 / 自分の提出
問題文最終更新日: 2021-11-03 20:15:33
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 321 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。