Can participation in online academic competitions destroy patent rights?
It very well could. Talk to a patent attorney. If you can get the contest runner to sign a non-disclosure agreement, then you might be able to protect your patent rights. 

That being said, algorithms are not patentable in most jurisdictions, and software is quickly losing its patentability in the US.