結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー ibukitiibukiti
提出日時 2021-11-05 22:01:47
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 8,456 KB
最終ジャッジ日時 2023-08-06 09:52:34
合計ジャッジ時間 1,596 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,300 KB
testcase_01 AC 18 ms
8,204 KB
testcase_02 AC 18 ms
8,456 KB
testcase_03 AC 19 ms
8,300 KB
testcase_04 AC 19 ms
8,280 KB
testcase_05 AC 19 ms
8,208 KB
testcase_06 AC 18 ms
8,324 KB
testcase_07 AC 19 ms
8,380 KB
testcase_08 AC 19 ms
8,324 KB
testcase_09 AC 19 ms
8,312 KB
testcase_10 AC 20 ms
8,448 KB
testcase_11 AC 19 ms
8,208 KB
testcase_12 AC 18 ms
8,364 KB
testcase_13 AC 19 ms
8,284 KB
testcase_14 AC 19 ms
8,328 KB
testcase_15 AC 18 ms
8,384 KB
testcase_16 AC 19 ms
8,448 KB
testcase_17 AC 18 ms
8,324 KB
testcase_18 AC 19 ms
8,300 KB
testcase_19 AC 18 ms
8,324 KB
testcase_20 AC 18 ms
8,408 KB
testcase_21 AC 18 ms
8,332 KB
testcase_22 AC 18 ms
8,328 KB
testcase_23 AC 19 ms
8,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n=input()
n_16=int(n,16)
n_8=oct(n_16)
numlis=list(str(n_8))[2:]
c=Counter(numlis)
v=c.most_common()
v.append(("A",0))
numlist=[]
if len(v)>1:
    for i in range(1,len(v)):
        x1,y1=v[i-1]
        x2,y2=v[i]
        if y1==y2:
            numlist.append(x1)
        else:
            numlist.append(x1)
            break
else:
    print(v[0][1])
    exit()
numlist.sort()
print(*numlist)
0