#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; typedef long long ll; ; struct node{ int l,r; int sum; int add; }tr[N*]; void pushdown(int root) { if (tr[root].add) { tr[root<<].…
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 64378 Accepted Submission(s): 27133 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了.A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就…
一开始这条链子全都是1 #include<stdio.h> #include<string.h> #include<algorithm> #include<math.h> #include<map> using namespace std; ///线段树 区间更新 #define MAX 100050 struct node { int left; int right; int mark; int total; }; node tree[MAX*…
题目连接 题意: 一条长为N的铜链子,每个结点的价值为1.有两种修改,l,r,z; z=2:表示把[l,r]区间内链子改为银质,价值为2. z=3:表示把[l,r]区间内链子改为金质,价值为3. 思路: 线段树,区间重设,求和. #include<cstdio> #include<cstring> using namespace std; const int maxn=100000+10; struct node { int l; int r; int v;//标记该区间内的链条的…
In the game of DotA, Pudge's meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. (图片走丢了,真不好意思,要不我补一张?) (对就是这张图)Now Pudge wants to do some opera…
一条钩子由许多小钩子组成 更新一段小钩子 变成铜银金 价值分别变成1 2 3 输出最后的总价值 Sample Input11021 5 25 9 3 Sample OutputCase 1: The total value of the hook is 24. # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <cmat…
Just a Hook Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24474 Accepted Submission(s): 12194 Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing…