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

Автор hphucvn, 7 месяцев назад, По-английски

Link to original problem: 1004F - Соня и побитовое ИЛИ

In the original statement, the query to update is point update only.

How can I solve this problem, suppose the first query is (1 L R Y) : assign value of a[l] ... a[r] to y

Thanks for the help !

Полный текст и комментарии »

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

Автор hphucvn, история, 12 месяцев назад, По-английски

In original problem 1175F - The Number of Subpermutations, it is required to count the number of subpermutations that consist number from 1 to r — l + 1, each appear exactly once

I managed to solve it using two pointers, expanding from position i whereas a[i] = 1

How do I count number of subpermutations, starting from x to x + r — l, for example : [1, 3, 2] and [2, 4, 3] also counts. Also, it would be great if someone can find the submission link for this problem. Thanks for helping me.

Полный текст и комментарии »

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