
hdu
文章平均质量分 56
oranges_c
落寞是岁月的痕迹
展开
-
【HDU5584】LCM Walk(数学)
题目链接题目大意: 从一个点(x,y)可以跳到(x+lcm,y)或(x,y+lcm) 给你一个点,问有几个点能够跳到这个点,包括当前点。我们假设当前点为(x,y)(x,y),上一个跳到这个点的点为(x′,y′)(x',y') 首先(x,y)<==>(x/gcd,y/gcd)(x,y) <==> (x/gcd,y/gcd),先让两个数互质 那么他们的lcmlcm原创 2017-03-10 20:26:17 · 344 阅读 · 0 评论 -
【HDU6053】TrickGCD(莫比乌斯容斥)
You are given an array A , and Zhu wants to know there are how many different array B satisfy the following conditions?原创 2017-08-27 17:03:48 · 406 阅读 · 0 评论 -
【HDU6040】Hints of sd0061(nth_element)
sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal with m coming contests. sd0061 has left a set of hints for them.There are n n原创 2017-08-25 13:40:56 · 343 阅读 · 0 评论 -
【HDU6038】Function(循环节+计数)
2017 Multi-University Training Contest - Team 1You are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1.Define that the domain of function f is the set of integers from 0 to n−1, and the原创 2017-08-25 13:16:17 · 295 阅读 · 0 评论 -
【HDU6035】Colorful Tree(dfs,树形dp)
There is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci.The path between each two different nodes is unique, of which we define the value as原创 2017-08-25 12:45:32 · 301 阅读 · 0 评论 -
【HDU6153】A Secret(扩展KMP)
Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things that VS tell: Suffix(S2,i) =原创 2017-08-21 14:42:17 · 270 阅读 · 0 评论 -
【HDU6034】Balala Power!
Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but ea原创 2017-08-20 16:44:17 · 300 阅读 · 0 评论 -
【HDU6058】Kanade's sum(暴力 or 链表)
Give you an array A[1..n]of length n. Let f(l,r,k) be the k-th largest element of A[l..r].Specially , f(l,r,k)=0 if r−l+1<k.Give you k , you need to calculate ∑nl=1∑nr=lf(l,r,k)There are T test cases.原创 2017-08-02 15:03:02 · 360 阅读 · 0 评论 -
【HDU6060】RXD and dividing(dfs)
RXD has a tree T, with the size of n. Each edge has a cost.Define f(S) as the the cost of the minimal Steiner Tree of the set S on tree T. he wants to divide 2,3,4,5,6,…n into k parts S1,S2,S3,…Sk,where原创 2017-08-02 14:44:29 · 438 阅读 · 0 评论 -
hdu_round3-1003.bx回文(manacher+dp)
bx回文Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 501 Accepted Submission(s): 89Problem Description bx有一个长度一个字符串S,bx可以对其进行若干次操作。每次操作可以删原创 2017-07-16 19:11:02 · 233 阅读 · 0 评论 -
hdu_round1-1007 吃巧克力(计算几何)
CYF 喜欢吃巧克力,有一天,CYF收到了一份镶嵌在平面直角坐标系上的巧克力,这个巧克力的形状是一个正多边形。日子一天天过去,CYF吃完了这份巧克力,但是却忘记了自己吃的巧克力有几条边,只记得正多边形巧克力上三个点的坐标。CYF知道送自己巧克力的人非常小气,所以正多边形巧克力的边数不会超过100。现在的CYF非常想知道自己吃的正多边形巧克力到底有多少条边,你能帮他算一下吗?原创 2017-07-03 15:25:39 · 437 阅读 · 0 评论 -
hdu_round1-1012 YYF和女朋友玩游戏
在若干年后,yyf终于找到了女朋友。这天yyf和他的女朋友在玩积木游戏,现在这里有x个1×1的小正方体,由这些小正方体可以组成一些“建筑”,现在他的女朋友有一个问题,告诉你这个建筑的主视图和左视图问你,问你这个建筑最少是由多少个小正方体组成的?原创 2017-07-02 22:45:51 · 428 阅读 · 0 评论 -
hdu_round1-1005 yyf倒水(bfs)
yyf和他女朋友到一家饭店吃饭,饭店里的服务员给yyf和女朋友每人一个杯子并把一个水壶放在了一边。女朋友想喝饮料,从饭店冰箱里拿来了一瓶“小茗同学”。倒满两个杯子后,yyf忍不住喝了一口,十分惬意。女朋友把两个杯子放在一起,认真地看了杯子里的水,向yyf问道,假设第一个杯子的容量是A升,第二个杯子的容量B升,两个杯子一开始都为空,现在有三个操作,1.FILL(i):将i杯子中的饮料倒满。2.EMPTY(i):将i杯子原创 2017-07-02 22:39:28 · 312 阅读 · 0 评论 -
hdu_round1-1002 光头强选举(优先队列)
光头强非常渴望权利。他想赢得即将到来的选举。现在有n个候选人,包括光头强,其中光头强是一号候选人。我们现在已经知道每个候选人获得了多少张选票。其中第i个候选人拥有ai张选票。为了赢得选举,光头强的得票数必须严格大于其他候选人。胜利比一切都重要,所以光头强决定通过作弊来赢得选举。他会通过贿赂将给其竞争者投票的选民将选票改投给自己。那么光头强最少要贿赂几个选民才能获得选举的胜利?原创 2017-07-02 22:10:06 · 625 阅读 · 0 评论 -
hdu_round1-1003 yyf和女朋友玩游戏
yyf找到女朋友之后和女朋友玩起了网游。这天他打了三把武器给自己的女朋友,武器有8个属性,每个属性是一个正整数,最多为99,yyf想选一把最厉害的武器送给自己的女朋友,设第一把武器的属性为$a_1−a_8$,第二把武器的属性为$b_1$−$b_8$,若第一把武器比第二把武器厉害,则$a_1=b_1,a_2=b_2....a_{i−1}=b_{i−1},a_i>b_i, 1≤i≤=8$, 请输出最厉害的武器的编号,第一原创 2017-07-02 22:28:27 · 551 阅读 · 0 评论 -
hdu_round1-1004 离开迷宫(dp)
yyf是一个日理万机的男人,但自从最近他勾搭上了女神之后便随叫随到,以至于荒废了很多事情。这天,yyf正在探索一个充满陷阱的古代迷宫,他的女神来电话了,由于离迷宫出口太远了,可能要花很多时间才能回去,所以yyf不打算原路返回,而是挥动他那强壮有力的右手砸开墙壁直接走向出口。已知yyf在(1,1)的位置,而出口在(N,M)的位置,yyf每次只会向下或向右走。原创 2017-07-02 22:34:38 · 453 阅读 · 0 评论 -
【HDU6029】Graph Theory(贪心+队列)
题目链接题目大意: T组数据,n个点。 对于编号为2~n的每个点,有两种选择: 1.这个点与之前的所有点连条边。 2.什么边都不连 问给你的这个图是否存在完美匹配。用队列维护没有被匹配的点 初始只有编号为1的点。 接下来对于每个点 如果选择第2个操作,说明这个点不能主动去匹配,只能被动由其他点来匹配,所以放入队列。 如果选择第一个操作,说明可以去匹配,就将队原创 2017-05-07 22:16:36 · 434 阅读 · 0 评论 -
【HDU6031】Innumerable Ancestors(二分+LCA)
题目链接题目大意: 给你n个点树,m个查询 每次查询给出两个点集A,B。 求x∈A,y∈Bx\in A,y\in B 使得lca(x,y)的深度最大lca(x,y)的深度最大倍增lca相关知识 用倍增法处理出lca 然后对每个查询二分深度 处理出A集合的点在二分深度的祖先集合 然后判断B集合里是否存在一个点的祖先在上述集合里#include <bits/stdc原创 2017-05-11 21:52:31 · 1080 阅读 · 0 评论 -
【HDU6183】Color it(线段树)
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 maintain fol原创 2017-09-02 13:54:47 · 1521 阅读 · 2 评论