結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー moharan627moharan627
提出日時 2021-11-05 22:15:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 987 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 55,688 KB
最終ジャッジ日時 2024-04-24 06:03:16
合計ジャッジ時間 2,017 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,144 KB
testcase_01 AC 46 ms
54,224 KB
testcase_02 AC 43 ms
54,716 KB
testcase_03 AC 44 ms
54,244 KB
testcase_04 AC 43 ms
55,168 KB
testcase_05 AC 44 ms
54,776 KB
testcase_06 AC 43 ms
54,384 KB
testcase_07 WA -
testcase_08 AC 43 ms
54,492 KB
testcase_09 AC 43 ms
55,016 KB
testcase_10 AC 44 ms
54,652 KB
testcase_11 AC 43 ms
54,648 KB
testcase_12 AC 43 ms
54,176 KB
testcase_13 AC 44 ms
55,232 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 44 ms
55,236 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 43 ms
55,672 KB
testcase_22 AC 43 ms
54,376 KB
testcase_23 AC 42 ms
54,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(10 ** 6)
INF = float('inf')
#10**20,2**63に変えるのもあり
MOD = 10**9 + 7
MOD2 = 998244353
from collections import defaultdict
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(input())
    def IC(): return [int(c) for c in input()]
    def MI(): return map(int, sys.stdin.readline().split())
    Num = {"A": 10, "B": 11, "C": 12, "D": 13, "E": 14, "F": 15}
    N = LC()
    DecN = sum(Num[n] * 16 ** i for i, n in enumerate(N))
    #print(DecN)
    OctN = []
    # 10進から8進へ
    if (DecN == 0):
        OctN.append(0)
    while DecN:
        DecN, R = divmod(DecN, 8)
        OctN.append(R)
    #print(OctN)
    num = defaultdict(lambda:0)
    for o in OctN:
        num[o]+=1
    MAX = max(list(num.values()))
    Ans = []
    for n in range(8):
        if num[n] == MAX:
            Ans.append(n)
    print(*Ans)
    return
solve()
0