If you have WA#3 check whether you have a correct understanding of updating:
(Thanks for Vit Demidenko (
http://acm.timus.ru/author.aspx?id=74435) Format:
UpdateType
Source -> Destination
---
Pirated
Licensed -> Pirated
Pirated -> Pirated
Licensed
Licensed -> Licensed
Cracked ->
Pirated -> Pirated
Licensed -> Licensed
I have WA#3 when I write a wrong interpretation of "Cracked" update.
P.S. About O(m*log(m)) solution:
1. Sort the updates by "yi" parameter ascending.
2. Then use dynamic programming.