Ryuuji_Nakamura's blog

By Ryuuji_Nakamura, history, 14 months ago, In English

My submission (https://mirror.codeforces.com/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!

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

| Write comment?
»
14 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
        if (i == 0 && isAscending(v[i])) { 
            v[i] %= 10;  // Keep only the last digit if it's ascending
        } else {
            if (v[i] >= v[i - 1]) { 

UB if i == 0 && !isAscending(v[i])