May I go to the bathroom?
When nature calls, you have to answer. That is why a teacher should never forbid you to go to the bathroom, not even during a test. And with the bathroom as your cheating sheet, you have many options to find the answer you are looking for.
You can write the answers you don’t have memorized on post-its and paste them into the bathroom for your future self. But make sure to remember everything as you will most probably not be allowed to go back for a second time unless you are really good at thinking of excuses.