Question about problem 1178C (C.Tiles) editorial

Revision en1, by zyydoosh, 2019-07-22 02:08:46

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.

Tags constexper

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English zyydoosh 2019-07-22 02:08:46 765 Initial revision (published)