QingdaoU / Judger

Online judge sandbox based on seccomp | OnlineJudge 安全沙箱

Home Page:https://qduoj.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time limit issues

beingayush opened this issue · comments

I have created a problem where time limit is set to 2000ms.

Screenshot 2020-10-22 at 8 11 17 PM

And now i run a simple cpp code as given below -

Screenshot 2020-10-22 at 8 13 08 PM

Inspite of setting only 2000ms as time limit, the for loop runs 10^16 times.
Expected result should be Time limit Exceeded

But the program is running smoothly in only 1 or 2 ms as shown below

Screenshot 2020-10-22 at 8 14 46 PM

On other external platforms like leetcode/codeforces/codechef, such a cpp code gives time limit exceeded
Can you please help me with this issue?

Thank you!

compiler optimization

g++ -O0

gdb-peda$ pdisass main
Dump of assembler code for function main:
   0x000000000000073a <+0>:	push   rbp
   0x000000000000073b <+1>:	mov    rbp,rsp
   0x000000000000073e <+4>:	mov    QWORD PTR [rbp-0x8],0x0
   0x0000000000000746 <+12>:	movabs rax,0x9184e729fff
   0x0000000000000750 <+22>:	cmp    QWORD PTR [rbp-0x8],rax
   0x0000000000000754 <+26>:	jg     0x75e <main+36>
   0x0000000000000756 <+28>:	nop
   0x0000000000000757 <+29>:	add    QWORD PTR [rbp-0x8],0x1
   0x000000000000075c <+34>:	jmp    0x746 <main+12>
   0x000000000000075e <+36>:	mov    eax,0x0
   0x0000000000000763 <+41>:	pop    rbp
   0x0000000000000764 <+42>:	ret
End of assembler dump.

g++ -O2

Dump of assembler code for function main:
   0x0000000000000630 <+0>:	xor    eax,eax
   0x0000000000000632 <+2>:	ret
End of assembler dump.