結果
問題 |
No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
|
ユーザー |
![]() |
提出日時 | 2021-11-20 16:20:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 82,388 KB |
実行使用メモリ | 53,120 KB |
最終ジャッジ日時 | 2024-06-11 17:49:45 |
合計ジャッジ時間 | 1,774 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
s = input() b = [] for ss in s: b.append(bin(ord(ss)-ord('A')+10)[2:]) c = ''.join(b) if len(c)%3==1: c = '00'+c if len(c)%3==2: c = '0'+c c = [int(i) for i in c] cnt = [0]*8 for i in range(0,len(c),3): cnt[c[i]*4+c[i+1]*2+c[i+2]] += 1 mc = max(cnt) ans = [] for i in range(8): if cnt[i]==mc: ans.append(i) print(*ans)