题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1276 题目给出一个数n,表示序列长度是n,且第i位为i,操作是从中删除二的倍数,然后重新组数,再删除三的倍数,然后重新组数,这样循环迭代,直到数的数量小于三。因为只有删除操作,而且每次删除之后的数都要重 ...
分类:
其他好文 时间:
2020-03-31 20:49:08
阅读次数:
47
1 /* 2 这道题用到了鸠巢原理又名容斥原理,我的参考链接:https://blog.csdn.net/guoyangfan_/article/details/102559097 3 4 题意: 5 这道题给你了n个数,让你找这n个数中有没有几个数的和是n的倍数 6 7 题解: 8 你循环遍历一遍 ...
分类:
其他好文 时间:
2020-03-31 14:19:18
阅读次数:
80
"HDU 1241 链接" 连通块个数统计问题 选对一块油田八个方向进行dfs。 dfs的次数就是连通块的个数了,极度水题 ...
分类:
其他好文 时间:
2020-03-31 14:16:20
阅读次数:
50
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but ...
分类:
其他好文 时间:
2020-03-31 01:24:28
阅读次数:
79
题解:使用二分搜索,在输出小数问题上,一般都会指定允许的误差范围或者是输出中小数点后面的位数。因此在使用二分搜索法时,有必要设置合理的结束条件来满足精度的要求。 设定循环次数作为终止条件,1次循环可以把区间的范围缩小一半,100次的循环则可以达到10^(-30)的精度范围,基本上是没有问题的,也可以 ...
分类:
其他好文 时间:
2020-03-30 23:45:24
阅读次数:
118
题面见http://acm.hdu.edu.cn/showproblem.php?pid=3336 给你一个字符串,让你找它的前缀在整个字符串出现的次数。 作为一个不会思考的笨比,直接用kmp去一个个计数,果不其然,t了 找了博客来看,大概就是kmp+dp,要用到kmp中的pret数组(有的人习惯叫 ...
分类:
其他好文 时间:
2020-03-30 23:02:03
阅读次数:
65
Description "HDU 1160" FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection o ...
分类:
其他好文 时间:
2020-03-30 19:29:07
阅读次数:
76
https://vjudge.net/problem/POJ-3017 题目 给一个长度为$N$的序列,你需要把它切成几段,每一段的和不能超过$M$,求一种切法,使每一段的最大值的和最小。 $N\leqslant100000$,$M$不会爆long long,序列中的数在$[0,1000000]$ ...
分类:
其他好文 时间:
2020-03-30 11:21:08
阅读次数:
60
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Be ...
分类:
其他好文 时间:
2020-03-30 00:21:16
阅读次数:
101
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2732 题目给定一个场景,有n*m个方格,每个方格代表一个柱子,一个柱子可以承受不同次数的跳跃,开始时图中给定一些地方有蜥蜴,并且给定蜥蜴最多跳跃的步长,只要跳到方格之外就能安全,而且每只蜥蜴不能在同一个 ...
分类:
其他好文 时间:
2020-03-29 21:17:14
阅读次数:
77