
线段树
文章平均质量分 79
至此曾经
从未坚持?
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 6183 【线段树的巧妙】
Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to ma原创 2017-09-28 20:44:23 · 277 阅读 · 0 评论 -
hdu 5685 Problem A
Problem Description 度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: H(s)=∏i≤len(s)i=1(Si−28) (mod 9973) Si代表 S[i] 字符的 ASCII 码。 请帮助原创 2016-11-22 16:55:43 · 250 阅读 · 0 评论 -
hdu 1394 Minimum Inversion Number
Problem Description The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj. For a given sequence of numbers a1, a2, ..., an, if we move th原创 2016-11-13 20:21:34 · 275 阅读 · 0 评论 -
Nowcoder 第十四届华中科技大学程序设计竞赛决赛同步赛 M
It’s universally acknowledged that there’re innumerable trees in the campus of HUST. In 8102, Alisa took fishing as her business. When she was walking along the bank and forgot the distance gradually,...原创 2018-05-08 12:38:41 · 484 阅读 · 3 评论 -
2018 Multi-University Training Contest 2 Naive Operations
题意: In a galaxy far, far away, there are two integer sequence a and b of length n. b is a static permutation of 1 to n. Initially a is filled with zeroes. There are two kind of operations: 1. add ...原创 2018-07-31 16:57:00 · 182 阅读 · 0 评论 -
2018 Multi-University Training Contest 5 Glad You Came
题目:http://acm.hdu.edu.cn/showproblem.php?pid=6356 用线段树维护一个最小最大值搞一下可以过: #include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> #include<vector> #de...原创 2018-08-06 21:19:47 · 185 阅读 · 0 评论 -
2018 Multi-University Training Contest 10 - Problem E. TeaTree (树上 dsu // 线段树合并)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=6430 题意:一棵树上每个节点权值为v[i],每个节点的heard值是:以它为LCA的两个节点的GCD的最大值,要求输出每个节点的heard值 题解:小于 100000 的数最多只有一百多个约数. 建出所有点的约数线段树, 然后线段树合并, 重复的单点就可以对答案产生贡献. 当然有省内存的做法, DSU...原创 2018-08-24 15:12:50 · 219 阅读 · 0 评论