結果
| 問題 |
No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
|
| コンテスト | |
| ユーザー |
judgelaw
|
| 提出日時 | 2021-11-05 21:54:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 443 bytes |
| コンパイル時間 | 367 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-11-06 12:42:01 |
| 合計ジャッジ時間 | 1,990 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
import sys
input = lambda: sys.stdin.readline().rstrip()
from collections import defaultdict as dd
N=input()
cnt=dd(int)
b=""
for a in N:
b+=str(format(int(a,16),'b'))
n=len(b)
i=0
while i<n:
num=int(b[max(n-i-3,0):n-i],2)
cnt[num]+=1
i+=3
ans=[]
maxval=0
for i in range(1,8):
if maxval==cnt[i]:
ans.append(i)
elif maxval<=cnt[i]:
ans.clear()
ans.append(i)
maxval=cnt[i]
print(*ans)
judgelaw