zyydoosh's blog

By zyydoosh, history, 5 years ago, In English

I was trying to submit this problem after ensuring the 4 test cases given in the problem, but I found it gives wrong answer in test 4. however, this test case I try it, and I'm sure my program output the correct answer

My submission

in the fourth test case

10 10

10 10

10 10

the answer is -1 and my program actually output -1, but in the submission it said my output is :

8 2

2 0

could anyone explain why !!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By zyydoosh, history, 5 years 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.

Full text and comments »

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