結果
問題 | No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1) |
ユーザー |
|
提出日時 | 2021-11-05 21:26:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 551 bytes |
コンパイル時間 | 350 ms |
コンパイル使用メモリ | 82,852 KB |
実行使用メモリ | 53,732 KB |
最終ジャッジ日時 | 2024-11-06 12:08:33 |
合計ジャッジ時間 | 1,938 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#!/usr/bin/env python3 s = input() while len(s) % 3 != 0: s = '0' + s f = [0] * 8 z = True for i in range(len(s) // 3): x = 0 for j in range(3 * i, 3 * i + 3): x = 16 * x + '0123456789ABCDEF'.index(s[j]) c = 512 for _ in range(4): if x // c != 0 or not z: f[x // c] += 1 if x // c != 0: z = False x %= c c //= 8 ma = 0 for i in range(8): ma = max(ma, f[i]) v = [] for i in range(8): if f[i] == ma: v.append(i) print(' '.join(map(str, v)))