Rating changes for the last round are temporarily rolled back. They will be returned soon. ×

Tobby_And_Friends's blog

By Tobby_And_Friends, history, 13 days ago, In English,

Can anyone please help me figure out what is wrong with my solution?

Problem: https://www.spoj.com/problems/CONSEC/ My solution: https://ideone.com/zXToOA Verdict: WA

I used DSU and processed the queries in reversed order. So, basically I started with the string after the characters of the string were replaced by the '#' character. For query of type 1 i, I stored the current maximum for that character to be printed later on and for query of type 2 i, I tried to incorporate this character with the remaining set and updated the maximum for this character.

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