結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-11-05 21:34:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 810 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-08-06 09:21:55
合計ジャッジ時間 3,242 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,420 KB
testcase_01 AC 74 ms
71,608 KB
testcase_02 AC 74 ms
71,524 KB
testcase_03 AC 76 ms
71,284 KB
testcase_04 AC 74 ms
71,620 KB
testcase_05 AC 74 ms
71,328 KB
testcase_06 AC 75 ms
71,244 KB
testcase_07 AC 74 ms
71,128 KB
testcase_08 AC 76 ms
71,276 KB
testcase_09 AC 74 ms
71,324 KB
testcase_10 AC 75 ms
71,324 KB
testcase_11 AC 75 ms
71,564 KB
testcase_12 AC 73 ms
71,308 KB
testcase_13 AC 74 ms
71,256 KB
testcase_14 AC 73 ms
71,324 KB
testcase_15 AC 72 ms
71,324 KB
testcase_16 AC 77 ms
71,480 KB
testcase_17 AC 74 ms
71,132 KB
testcase_18 AC 73 ms
71,456 KB
testcase_19 AC 73 ms
71,236 KB
testcase_20 AC 72 ms
71,620 KB
testcase_21 AC 73 ms
71,420 KB
testcase_22 AC 73 ms
71,272 KB
testcase_23 AC 73 ms
71,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""

import sys
from sys import stdin

N = stdin.readline()[:-1]

dic16 = {}

for i in range(16):
    alp = "0123456789ABCDEF"
    c = format(i,'b').zfill(4)
    dic16[ alp[i] ] = c

rdic8 = {}
for i in range(8):
    alp = "01234567"
    c = format(i,'b').zfill(3)
    rdic8[c] = alp[i]

S = []
for i in N:
    S.append(dic16[i])

S = "".join(S)
#print (S)
while len(S) % 3 != 0:
    S = "0" + S

#print (S)

T = []
for i in range(0,len(S),3):

    ns = S[i] + S[i+1] + S[i+2]
    T.append( rdic8[ns] )

#print (T)

"""
while T[0] == 0:
    T = T[1:]
"""

ansdic = {}

for i in T:
    if i not in ansdic:
        ansdic[i] = 0
    ansdic[i] += 1

maxi = 0
for i in ansdic:
    maxi = max(maxi,ansdic[i])

ans = []

for i in ansdic:
    if ansdic[i] == maxi:
        ans.append(i)

ans.sort()
print (*ans)
0