hdu1698】的更多相关文章

HDU1698 #include <bits/stdc++.h> using namespace std; #define Maxn 1001000*4 struct Node{ int lt,rt,val; }A[Maxn]; int j = 1; void Build(int i,int lt,int rt){ A[i].lt = lt; A[i].rt = rt; A[i].val = 1; if( lt == rt ){ return ; } int mid = (lt+rt) >…
Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 25126    Accepted Submission(s): 12545 Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing…
hdu1698 Just a Hook 题意:O(-1) 思路:O(-1) 线段树功能:update:成段替换 (由于只query一次总区间,所以可以直接输出1结点的信息) 题意:给一组棍子染色,不同的颜色有不同的值,执行一系列的区间染色后,问这组棍子的总值是多少. #include <cstdio> #include <algorithm> using namespace std; #define lson l , m , rt << 1 #define rson m…
题目链接:https://vjudge.net/problem/HDU-1698 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…
Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description 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 cons…
最近刚学线段树,做了些经典题目来练手 Just a Hook Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 24370 Accepted Submission(s): 12156 Problem Description In the game of DotA, Pudge's meat hook is actually the most h…
Description 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 operations on the hook.…
Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17124    Accepted Submission(s): 8547 Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing f…
Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23644    Accepted Submission(s): 11839 Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing…
题意 Q个操作,将l,r 的值改为w 问最后1,n的sum 为多少 成段更新(通常这对初学者来说是一道坎),需要用到延迟标记(或者说懒惰标记),简单来说就是每次更新的时候不要更新到底,用延迟标记使得更新延迟到下次需要更新or询问到的时候 题意:O(-1) 思路:O(-1) 线段树功能:update:成段替换 (由于只query一次总区间,所以可以直接输出1结点的信息) 线段:1-N(题目天然给出) 区间和性质:求sum 重点在于如何设计一个lazy操作 #include <cstdio> #i…