Azret's blog

By Azret, history, 9 years ago, translation, In English
  • Vote: I like it
  • +18
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Where I can submit my solutions?

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    IDK really. I tried to find out but couldn't find anything.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you can submit problems in exam :)HAHA

»
8 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can anyone who solved problem A explain their solution?

I was thinking of a hacky solution of creating segtree storing xor, sum, product(mod prime) of a range in node, then query to check if those properties are equal. I do not ex[pect this to be the official solution. Can anyone post the solution/hints?

  • »
    »
    8 years ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    Hint: For each number remember nearest left/right element with same value. It's easy to change this value during update.

    If a[l,r] is a permutation: 1) Minimum is 1

    2) Maximum is r-l+1

    3) All elements are distinct( minimum of left values <= l)

  • »
    »
    8 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Create a segment tree and store sum of where . To check just compare the sum of segment with . Update is easy.