結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー miya145592miya145592
提出日時 2023-05-06 04:03:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 71,708 KB
最終ジャッジ日時 2023-08-15 09:21:32
合計ジャッジ時間 3,070 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,172 KB
testcase_01 AC 71 ms
71,396 KB
testcase_02 AC 70 ms
71,468 KB
testcase_03 AC 70 ms
71,452 KB
testcase_04 AC 70 ms
71,396 KB
testcase_05 AC 69 ms
71,172 KB
testcase_06 AC 69 ms
71,708 KB
testcase_07 AC 70 ms
71,216 KB
testcase_08 AC 71 ms
71,320 KB
testcase_09 AC 71 ms
71,404 KB
testcase_10 AC 71 ms
71,436 KB
testcase_11 AC 70 ms
71,412 KB
testcase_12 AC 71 ms
71,436 KB
testcase_13 AC 70 ms
71,376 KB
testcase_14 AC 72 ms
71,336 KB
testcase_15 AC 70 ms
71,208 KB
testcase_16 AC 71 ms
71,704 KB
testcase_17 AC 71 ms
71,316 KB
testcase_18 AC 71 ms
71,508 KB
testcase_19 AC 70 ms
71,488 KB
testcase_20 AC 72 ms
71,484 KB
testcase_21 AC 70 ms
71,492 KB
testcase_22 AC 70 ms
71,372 KB
testcase_23 AC 71 ms
71,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
B = []
for n in N:
    B.append(bin(int(n, 16))[2:])
B = "".join(B)
cnt = [0 for _ in range(8)]
for i in range(len(B)-1, -1, -3):
    if i-2<0:
        o = int(B[0:i-2+3], 2)
    else:
        o = int(B[i-2:i-2+3], 2)
    cnt[o] += 1
ans = []
maxcnt = -1
for i in range(8):
    if maxcnt<cnt[i]:
        ans = [i]
        maxcnt = cnt[i]
    elif maxcnt==cnt[i]:
        ans.append(i)
print(*ans)
0