My submission (https://codeforces.net/contest/1948/submission/307669384) is giving the correct output (at least for the first 10 elements on test 2) on my laptop, but not on Codeforces. I don't understand why.
I have attached the image of my output too so you all can see!
Auto comment: topic has been updated by Ryuuji_Nakamura (previous revision, new revision, compare).
Auto comment: topic has been updated by Ryuuji_Nakamura (previous revision, new revision, compare).
You have the wrong answer in the second test set if you go to the link below and check your test details
https://codeforces.net/contest/1948/submission/307669384
you should see that in the second test set that Verdict is wrong. If you keep scrolling to the bottom of the page it will tell you that in the 4th test case it expected YES and your output was NO
Codeforces indicates that you have a wrong answer on the 4th subtest (within the 2nd test).
If we analyze it in detail, we can observe that in the first number (87), the digits are not sorted in non-decreasing order. Consequently, the condition in line 41 is not satisfied, and the code proceeds to the condition in line 44. There, you are comparing v[-1] and v[0]. However, in the testing system, v[-1] might contain an arbitrary value that breaks your program. You were fortunate because, on your local machine, it happened to hold a number that did not disrupt the program's correct operation.
UB if
i == 0 && !isAscending(v[i])