Comments
On errorgornI Love CF, 10 months ago
+17

we got a CF poem before GTA6

When you have undefined behaviour in your code, all bets are off. You just got unlucky with bad RNG during the contest. I just submitted the same code and it passed 6 times and failed the 7th time. Btw. when you get a runtime error, it's probably almost always an out of bounds error, so look for that in the future.

What's funny is that you could have just submitted the same code and probably passed the tests and this meme would actually come true hahaha

Your sieve function contains undefined behaviour (your index goes out of bounds). It seems to me that you should change the line vi a(n,0); to vi a(n+1,0);