why do i get time limit exceeded though it takes 0sec to compile?

check it takes 0sec

“Time limit exceeded” error occurs when code takes longer time to run than expected by judge. Compile time is not RUN TIME. It is the time taken by compiler to convert your high level language code to machine language. I suggest you to read basics first.