結果
| 問題 | No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1) |
| コンテスト | |
| ユーザー |
judgelaw
|
| 提出日時 | 2021-11-05 21:54:18 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 2,000 ms |
| コード長 | 443 bytes |
| 記録 | |
| コンパイル時間 | 587 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-06 16:54:08 |
| 合計ジャッジ時間 | 3,944 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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