> All materials displayed or performed on the public Network, including but not limited to text, graphics, logos, tools, photographs, images, illustrations, software or source code, audio and video, and animations (collectively “Network Content”) (other than Network Content posted by individual “Subscriber Content”) are the property of Stack Overflow and/or third parties and are protected by United States and international copyright laws (“Stack Overflow Content”).
https://stackoverflow.com/legal/terms-of-service#licensing
of course, if your answer replicates content from another source that you link to in your answer, that other source still owns the content. so perhaps if you self-publish first and then replicate and link to your original source, you might be able to side-step this and license the original source as you like.
You license the content you create to them:
> any and all content [...] that you provide to the public Network (collectively, “Subscriber Content”) is perpetually and irrevocably licensed to Stack Overflow
You still own the copyright to what you've written.