摘要: http://poj.org/problem?id=2777题意:有一艘长为L的船,初始颜色为1,将船分为L段,用T种颜色去染。有O种操作,C A B C:表示将区间[A,B]段染成C颜色。 P A B:表示询问[A,B]段中有多少不同的颜色。思路:线段树的区间修改。 1 #include 2 #include 3 #include 4 #define lson l,mid,rt>1; 21 build(lson); 22 build(rson); 23 } 24 void pushdow(int rt)//标记传递 25 { 26 if (Tree[rt... 阅读全文
posted @ 2014-02-19 15:28 N_ll 阅读(450) 评论(0) 推荐(0)