Qurdestor's blog

By Qurdestor, history, 5 weeks ago, In English,

In this Editorial, problem C code, I saw constexpr for the first time, so I read about it in GeeksforGeeks, and what I understood is it's something for performance improvement of programs by doing computations at compile time rather than run time.

So I expected that submitting using constexpr will make the code faster, but I found the opposite!

This code 57476357 which using constexpr gets accepted in 30ms, and this code 57476398 without constexpr gets accepted in 15 ms

Is there any explanation for that cause I think that I have a misunderstanding here.

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it