tempestDemise's blog

By tempestDemise, history, 3 years ago, In English

Problem: 1560F1 - Nearest Beautiful Number (easy version)

Hi, in my submissions: 127141856 and 127141658, the code is the same. However I am failing testcases which I am not failing in custom test on the website "https://mirror.codeforces.com/problemset/customtest". For example in the submisson 127141658, I am failing on the testcase where n = 10 and k = 1, where the "supposed output" is 1110, but in the custom test, I would get the correct output "11" , if I wrote an input where t = 1, n = 10, and k = 1.

In the other submission I tried to use C++14 compiler instead of C++17. I still end up failing a similar case which doesn't fail in custom test.

Why is this happening?

Any information would be appreciated.

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think this happens because you forgot to flash your output in the following case.

else if (uniqueCnt > k)