CodeForces - 438D The Child and Sequence (线段树)

本文介绍了一道编程题目,涉及到线段树数据结构的应用。题目要求在初始数组上进行三种操作:计算区间和、区间取模、单点赋值,并给出若干示例。解题思路包括利用线段树实现区间操作,特别是处理区间取模时的剪枝技巧,即当区间最大值小于模数时可跳过该操作。
摘要由CSDN通过智能技术生成

The Child and Sequence

 

time limit per test:4 seconds

memory limit per test:256 megabytes

input:standard input

output:standard output

At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite sequence of Picks.

Fortunately, Picks remembers how to repair the sequence. Initially he should create an integer array a[1], a[2], ..., a[n]. Then he should perform a sequence of m operations. An operation can be one of the following:

  1. Print operation l, r. Picks should write down the value of .
  2. Modulo operation l, r, x. Picks should perform assignment a[
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值