MAX11189's blog

By MAX11189, history, 4 months ago, In Russian

требуется вычислить максимальное значение на всех подотрезка от L до R : gcd[tl; tr] * sum[tl; tr] tl, tr это подотрезок отрезка [L; R], Пример:

n, cntQuery ArrayA Query[L, R]

3 2 | 3 3 2 | 1 3 | 2 3

Ответ: 18 т.к [1;2] = sum[1;2] * gcd[1;2] = 6*3 = 18 9 т.к [2;2] = sum[2;2] * gcd[2;2] = 3*3 = 9

  • Vote: I like it
  • +7
  • Vote: I do not like it

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Я уже давно не в школе) Я для себя решаю просто Можешь чекнуть я в 2023 в 11 классе выступал

    • »
      »
      »
      3 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I am posting this to provide the source of the problem and the solution. I didn't mean anything else in any sense.

      • »
        »
        »
        »
        3 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Аа, всё) Спасибо за альтернативное решение)

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Та и все равно такую идею никто не напишет))

    • »
      »
      »
      3 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Удивишься, но найдутся такие =)))