結果
問題 | No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1) |
ユーザー |
![]() |
提出日時 | 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 |
ソースコード
#!usr/bin/env python3from collections import defaultdict, dequefrom heapq import heappush, heappopfrom itertools import permutations, accumulateimport sysimport mathimport bisectdef 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 = 1000000007def solve():n = int(input(),16)cnt = defaultdict(lambda: 0)x = list(map(int,oct(n)[2:]))for i in x:cnt[i] += 1cnt = 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)returnif __name__ == "__main__":solve()