If you are on the north side of Yellowstone, you can check out Livingston or Bozeman Montana. On the East side there is Cody, but it may be a little pricey. But there are lots of motels there and you might find a mom and pop that is reasonable. Jackson is an alternative, but it is going to be pricey as well. But that is the best way to get into the park as the Grand Tetons are awesome!
Also, you might try this website:
https://www.xanterra.com/index.html
They do all the lodging in Yellowstone and they can tell you if there are any vacancies within the Park. Stayed in a little cabin at Lake Lodge and it was around $100 per night. I would suggest you call them, they were good to deal with.
To really see Jellystone, you need two days but can do it in one if you don't stop much.
Steve