首页 > TAG信息列表 > 915E

CodeForces - 915E 动态开点线段树

  题目 晚上有n个亮着的灯泡,标号从1到n。 现在存在2种操作,如下: 操作1,关掉标号 [l,r] 区间的灯 操作2,打开标号 [l,r] 区间的灯 下面有q次询问,每次询问执行其中一种操作,询问格式,l,r,k,k为执行操作种类。对于每次询问回答当前开着的灯的数量。 Input 单组输入,第一行包含一个整数n,第二

Physical Education Lessons CodeForces - 915E (动态开点线段树)

Physical Education Lessons CodeForces - 915E This year Alex has finished school, and now he is a first-year student of Berland State University. For him it was a total surprise that even though he studies programming, he still has to attend physical educa

codeforces 915E - Physical Education Lessons(线段树动态开点板子题)

题意: 从现在到学期结束还有 n 天(从 1 到 n 编号), 他们一开始都是1。接下来学校的工作人员会依次发出 q 个指令, 每个指令可以用三个参数 l,r,k 描述: 如果 k=1那么从 l 到 r (包含端点)的所有日子都变成0。 如果 k=2那么从 l 到 r (包含端点)的所有日子都变成1。 输出 q 行,第 i 行