I experienced this weirdness so many times.
When I run the code in my local machine, it runs in less than a second, so I assume it fits in the time limit. However, for some cases, the judge (system test or custom invocation) needs like 10x~30x time compared to my local machine. To me, it doesn't make any sense: even if I test with 10x test case limit in the local machine, it still comfortably fits in the time limit. My computer is only mediocre, so I really have no clue how this could happen. Does someone has some insight for this?