Space, time complexity reference

1e7 int array of 40MB;

int s=1;
 for(int i=1;i<=100000000;++i)s=s*2/2%2+1;
 return 0;

1e8 cycle,

The code is not open O2 ran 0.44s, 0.06s open O2 run

LL is not open to open O2 ran 1.156, O2 is opened or 0.06 ......

1e9LL * /% open O2 0.592s, but only an addition run 0.00,

And even only * / + or + *%, have only 0.00

But the * / + went to 0.592%

O2 may accelerate the built-in arithmetic, multiplication into the adder or the like.

Guess you like

Origin www.cnblogs.com/seamtn/p/11628132.html