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

Автор memaygay, история, 6 часов назад, По-английски

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.

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

»
6 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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)