How do you deal with memorisation aspects?

So, keep in mind that I am a competitive coder for sport/fun - not for job interview. With that background - for problems like - Finding the distance between two closest points in 2d point. Yes, I understand the logic perfectly well. Question is - do you think it is unfair to copy-paste the function (my own code) in a contest? Its kinda hard to remember all the details - like the need to compare a point with its 5 next points sorted by y-coordinate.

Another example is calculating modulo multiplicative inverse:

I do understand concepts when mod p with p as prime. The O(log p) algo requirement. I do understand that we can calculate MMI for all numbers in range (1 to p-1) in o( P ) time. But I just dont remember the small details. Is it fair for me to self-plagiarise?

To clarify, the question is not about violating codechef’s guidelines. Its about being unethical or taking an approach that will slow me in the long term.

3 Likes

Hey,
As long as you don’t copy others code you are not plagiarising
and i don’t think it violates Codechef’s Guidlines

Please Like :slightly_smiling_face:

2 Likes

Its not about violating codechef’s guidelines. Its about being unethical or taking an approach that will slow me in the long term.

1 Like

While practicing I recommend you write the code but during contests you need to write your code faster than others and that’s why you could copy paste your own code.
You can also save templates in the codechef IDE

3 Likes