結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー dn6049949dn6049949
提出日時 2021-11-05 21:55:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 768 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 54,784 KB
最終ジャッジ日時 2024-04-24 05:41:21
合計ジャッジ時間 2,170 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
54,528 KB
testcase_01 AC 49 ms
54,656 KB
testcase_02 AC 48 ms
54,144 KB
testcase_03 AC 49 ms
54,528 KB
testcase_04 AC 53 ms
54,528 KB
testcase_05 AC 48 ms
54,528 KB
testcase_06 AC 50 ms
54,528 KB
testcase_07 AC 49 ms
54,784 KB
testcase_08 AC 48 ms
54,656 KB
testcase_09 AC 49 ms
54,528 KB
testcase_10 AC 49 ms
54,144 KB
testcase_11 AC 49 ms
54,784 KB
testcase_12 AC 51 ms
54,528 KB
testcase_13 AC 49 ms
54,656 KB
testcase_14 AC 49 ms
54,528 KB
testcase_15 AC 50 ms
54,272 KB
testcase_16 AC 49 ms
54,656 KB
testcase_17 AC 49 ms
54,784 KB
testcase_18 AC 49 ms
54,656 KB
testcase_19 AC 48 ms
54,400 KB
testcase_20 AC 49 ms
54,528 KB
testcase_21 AC 50 ms
54,400 KB
testcase_22 AC 48 ms
54,656 KB
testcase_23 AC 48 ms
54,272 KB
権限があれば一括ダウンロードができます

ソースコード

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