{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-size:14px;line-height:normal;font-family:\u0027Times New Roman\u0027;\"\u003e在Dota游戏中,屠夫的钩子对于大多数的英雄来说还真是个可怕的东西。这个钩子是由一些连续的拥有相同长度的\u003c/span\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;font-family:\u0027Times New Roman\u0027;\"\u003e金属节点连接而成。\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003cimg src\u003d\"CDN_BASE_URL/a0dc9f3e57d677d6383712dbe8467833?v\u003d1641718058\" width\u003d\"340\" height\u003d\"270\" alt\u003d\"\"\u003e\u003cbr\u003e \u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e现在屠夫想要对他的钩子进行一些操作。\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e我们现在把这个长长的钩子从一个端点起依次标记为 1 到 N。对于每一次操作,屠夫可以改变一段连续的金属节点的属性。例如从节点X 到节点 Y,它可以把这段区间的所有节点变成铁质的,银质的或者金质的节点。屠夫的钩子的总的威力值为钩子上这N个金属节点对应价值的总和,更精确的来讲,这些金属对应的\u003c/span\u003e\u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e价值依次为:\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e每个铁质节点,价值为 1.\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e每个银质节点,价值为 2.\u003c/span\u003e\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e每个金质节点,价值为 3.\u003c/span\u003e\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e\u003cbr\u003e \u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;\"\u003e屠夫想知道在他对他的钩子进行一些操作之后,他的钩子的威力值为多少。\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e一开始,钩子上的每个节点都是铁质的。\u003c/span\u003e\u003c/span\u003e \u003c/p\u003e \n\u003cdiv\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e\u003cbr\u003e \u003c/span\u003e\u003c/span\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan style\u003d\"white-space:normal;font-size:14px;line-height:normal;font-family:\u0027Times New Roman\u0027;\"\u003e输入包含多组 测试数据。第一行输入一个T表示测试的组数。\u003c/span\u003e\u003cbr style\u003d\"white-space:normal;\"\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e对于每组数据:\u003cbr\u003e 第一行输入一个值 N,1\u0026lt;\u003dN\u0026lt;\u003d100,000,代表屠夫钩子的总节点数\u003c/span\u003e\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e第二行输入一个值 Q,0\u0026lt;\u003dQ\u0026lt;\u003d100,000,表示屠夫进行操作的次数。\u003c/span\u003e\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;\"\u003e\u003cspan style\u003d\"font-size:14px;line-height:normal;\"\u003e接下来的 Q 行,每行包含3个整数 X,Y,Z\u0026nbsp;,\u0026nbsp;\u0026nbsp;(1\u0026lt;\u003dX\u0026lt;\u003dY\u0026lt;\u003dN)\u0026nbsp;(1\u0026lt;\u003dZ\u0026lt;\u003d3)表示进行的操作为:\u003cbr\u003e 把从节点 X 到节点 Y 的部分变成 Z 金属 ,(Z\u003d1表示铁质,Z\u003d2表示银质,Z\u003d3表示金质)。\u003c/span\u003e\u003c/span\u003e \u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cspan style\u003d\"font-family:\u0027Times New Roman\u0027;font-size:14px;line-height:normal;white-space:normal;\"\u003e对于每组测试数据,输出一个整数,表示屠夫进行所有的操作 之后,钩子的威力值,输出格式参照样例,每组输出占一行。\u003c/span\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cspan style\u003d\"font-family:\u0027Courier New\u0027, Courier, monospace;font-size:14px;line-height:normal;white-space:pre;\"\u003e1 10 2 1 5 2 5 9 3\u003c/span\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cspan style\u003d\"font-family:\u0027Courier New\u0027, Courier, monospace;font-size:14px;line-height:normal;white-space:pre;\"\u003eCase 1: The total value of the hook is 24.\u003c/span\u003e"}}]}