結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー dn6049949dn6049949
提出日時 2021-11-05 21:55:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 768 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 55,924 KB
最終ジャッジ日時 2024-11-06 12:42:45
合計ジャッジ時間 2,197 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = int(input(),16)
    cnt = defaultdict(lambda: 0)
    x = list(map(int,oct(n)[2:]))
    for i in x:
        cnt[i] += 1
    cnt = list(cnt.items())
    cnt.sort(key=lambda x:(-x[1],x[0]))
    m = cnt[0][1]
    ans = [x for x,y in cnt if y == m]
    print(*ans)
    return


if __name__ == "__main__":
    solve()
0