online judge time/space variations even when submitting same code

Once I submitted exactly same code using same language… (only with a few comments added to the code),
actually I couldn’t get the problem so I copied someone else’s code for better understanding and as it was a very simple code… so it didn’t bother re-typing it so added a few comments for my understanding so as if I review my submission i may understand. after submission my time of execution was more then expected. Is it because maybe I used another version of c++ of something else as usually with same code people have 1900, 2000 and 2100 memory use though I find their code requesting same memory.(Codeforces)

There can be upto 0.1sec time variation along with minor memory variation (if its shown in KB) for same code.

Time variation is due to stuff like queue, judge being busy at times etc. But these variations are trivial as far as correct verdict of code is concerned.