memaygay's blog

By memaygay, history, 3 hours ago, In English

I noticed that some of the accepted codes for this problem are incorrect. You can take any accepted code and test with the case: t=1, n=6, a[i]:{8, 1, 3, 4, 6, 8}. When running manually, the result should be 38, but some codes still get accepted even though they are wrong. I’ve tested a few codes, and their results were 46, 246, and so on.

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

»
2 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

hi for notice in constraints of the problem for all $$$1 \leq i \leq n$$$ its guaranteed $$$1 \leq a_i \leq n$$$, in your example $$$a_1 = 8, a_1 > 6$$$ (1 based indexing)