当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6562:Lovers

题目描述
The Fool comes to a cross-road, filled with energy, confidence and purpose, knowing exactly where he wants to go and what he wants to do. But he comes to a dead stop. A flowering tree marks the path he wants to take, the one he’s been planning on taking. But standing before a fruit tree marking the other path is a woman. The Fool has met and had relationships with women before, some far more beautiful and alluring. But she is different. Seeing her, he feels as though he’s just been shot in the heart with cupid’s arrow.

There are $n$ empty strings:
$s_1$, $s_2$, . . . , $s_n$.

You are required to perform two kinds of operations:

  • wrap $l$ $r$ $d$: change $s_i$ to $dsid$ for all l ≤ i ≤ r, where d is a digit character.

  • query $l$ $r$: query $\sum\limits_{i=l}^{r}$ value($s_i$) (mod $10^9$ + 7), where $value(s)$ is the number that string $s$ represents.


  • Note that the value of an empty string is 0.
    输入解释
    The first line contains one integer $T$, which denote the number of cases.
    For each case, the first line contains two integer $n$ and $m$ where $n$ is the number of strings and $m$ is the number of operations.
    Each line of the following m lines contains an operation with format
    $wrap$ $l$ $r$ $d$

    or
    $query$ $l$ $r$
    .
    输出解释
    For each case, you should output "Case $i$:"in a line, where $i$ is the case number starting from 1.
    Then for each query operation in that case, output a line that contains a single integer that representing the answer for that query operation.
    输入样例
    2
    3 2
    wrap 1 3 1
    query 1 2
    4 4
    wrap 1 3 0
    wrap 2 4 3
    query 1 4
    query 2 3
    输出样例
    Case 1:
    22
    Case 2:
    6039
    6006
    
    提示
    1 ≤ T ≤ 5, 1 ≤ n, m ≤ 1e5, 1 ≤ l ≤ r ≤ n.
    
    来自杭电HDUOJ的附加信息
    Recommend chendu

    该题目是Virtual Judge题目,来自 杭电HDUOJ

    源链接: HDU-6562

    最后修改于 2020-10-25T23:32:21+00:00 由爬虫自动更新

    共提交 0

    通过率 --%
    时间上限 内存上限
    25000/15000MS(Java/Others) 262144/262144K(Java/Others)