Hello everyone, hope you are all doing great.
I recently received message from system that my solution 195163597 is coinciding with many others.
I gave this problem more than whole time for other problems. Initially I thought of making all element 2 ( as it was guraanted that there will be no more than 30n operation which gave me hint of making 2. )
Which got MLE, after using array instead got TLE and then lot's of WAs.
After lots of -ive verdicts, I removed whole code and started again. Finally came with logic of making all elements same, which can be acquired by dividing by minimum element to all other elements. I removed the template as I was having fear of getting TLE because of my template which I have got earlier in some problems few months back.
This finally worked. This was my whole process of spending more than 40 mins of B and getting AC.
I saw the message from system checked others code, logic was same as mine. Can you all tell me what can be the way of check all elements same.
You will create another function write for checking that all other elements are same or not, which I did. Similarly there is common way of finding minimum element, common way of pushing back in vector.
Having a common way does not mean that people are copying each other. It means that problem have one common solution which everyone is getting.
The fault is actually which I think is in plag checker of codeforces. CF is great platform to increasing and showcase your CP skills. But I think improvement is required in plag checker.
Having common logic, which is having common way of implementation does not mean that people are copying from each other.
MikeMirzayanov and Codeforces Headquarters, please look into this.