More than likely this is a urination problem. Not constipation. Take your cat to the vet. My cat had the exact same behavior and is was cystosis, and required some antibiotic shots and a change in diet. Don't delay, urinary problems can lead to serious health issues and can even be fatal for your cat.