Блог пользователя zyydoosh

Автор zyydoosh, история, 5 лет назад, По-английски

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 !!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор zyydoosh, история, 5 лет назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится