Thanks for your query.
As you had accident and hurt your legs, it is obvious you have damaged your muscles and bones. You can take over the counter analgesics to relieve pain and ice packing may also help you. It takes time to heal a tissue.
You are advised to visit a doctor and perform x-ray and physical examination to rule out any fracture
,muscle or tendon tear.
Hope it helps.
Wishing you speedy recovery.