Thank you for your question.
No, police do not necessarily need to witness the crime -there would have to just be sufficient probable cause
for them to make an arrest, and then of course, sufficient probable cause for a prosecutor to prove guilt beyond a reasonable doubt.
For example, a person drives drunk and gets into a car accident. No one saw him drive drunk, but when the police arrive, he is falling all over himself, there is an open container
in the car, and he smells of alcohol. There is sufficient probable cause to arrest even though the driving and accident wasn't witnessed.
With something like drunk in public, there would have to be witnesses, and preferably something like a video recording, since witness testimony isn't necessarily reliable and it can come down to one person's word versus another. Prostitution solicitation would generally have to be witnessed by a police officer or be part of a sting operation, because outside of that, neither the "john" nor the person selling themselves for sex is going to go to the police and report that -so while I won't say it's IMPOSSIBLE not to be arrested for your examples weeks later, I will says it is highly improbable.