摘要: 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6288 Summarize:1、二分查找答案; 2、自带log函数精度不够,需自己写; 3、注意二分递归的左右区间; 4、计算中可能爆LL,故需尽可能做一步就判断一次; 阅读全文
posted @ 2019-05-27 21:28 liubilan 阅读(290) 评论(0) 推荐(0)
摘要: 哇,我真的amazing, incredible!! 我只是想写一个简单的邮件,结果他一直报554错误!!! 期间,通过百度,我发现了可能导致 此,讨厌至极的错误,有N多原因; 但我的原因 谜之离谱! Can you imagine!! 我仅仅只是换了目前16-18行的代码,之前是放于9行以后的位置 阅读全文
posted @ 2019-03-23 14:45 liubilan 阅读(2728) 评论(0) 推荐(0)
摘要: 参考博客:https://blog.csdn.net/yjier/article/details/6237697 参考博客:https://blog.csdn.net/mozha_666/article/details/79032751 GB2312区位码 GB2312对所收汉字进行了“分区”处理, 阅读全文
posted @ 2018-10-19 15:47 liubilan 阅读(823) 评论(0) 推荐(0)
摘要: 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6438 获得最大的利润,将元素依次入栈,期中只要碰到比队顶元素大的,就吧队顶元素卖出去,答案加上他们期中的差值,并把新加入的元素用map标记为中间变量,若以后再卖出这件物品,可看做直接由之前的最小值卖出, 阅读全文
posted @ 2018-08-28 21:43 liubilan 阅读(223) 评论(0) 推荐(0)
摘要: 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6446 题目给出的数据为一棵树,dfs扫描每条边,假设去掉某条边,则左边 x 个点,右边 n-x 个点,则经过该条边共有 x*(n-x) 种组合,又因为 1~n 全排列有 n! 种,故 a~b,包含 b~ 阅读全文
posted @ 2018-08-28 16:05 liubilan 阅读(191) 评论(0) 推荐(0)
摘要: 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6440 这题主要是理解题意; 题意:定义一个加法和乘法,使得 (m+n)p = mp+np; 其中给定 p 为素数,m,n 为小于p的数; 费马小定理:am-1 ≡ 1(mod p); 故有 am ≡ a 阅读全文
posted @ 2018-08-27 11:11 liubilan 阅读(236) 评论(0) 推荐(0)
摘要: 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6441 Knowledge Point: 1. 费马大定理:当整数n >2时,关于x, y, z的方程 x^n + y^n = z^n 没有正整数解。 2. 0^0次没有意义!! 所以我们知道 n=0, 阅读全文
posted @ 2018-08-26 16:46 liubilan 阅读(397) 评论(0) 推荐(0)
摘要: 题目地址:https://www.nowcoder.com/acm/contest/158/A 参考博客:https://blog.csdn.net/zzcblogs/article/details/78816533 1~n 约数的个数的和实际就是看 1~n 在这些数中出现过多少次,例如 1是1~n 阅读全文
posted @ 2018-08-24 20:39 liubilan 阅读(429) 评论(0) 推荐(0)
摘要: 题目地址:https://www.nowcoder.com/acm/contest/136/F 树状数组、快速幂、逆元的模板运用; 阅读全文
posted @ 2018-08-24 19:04 liubilan 阅读(181) 评论(0) 推荐(0)
摘要: 题目地址:https://www.nowcoder.com/acm/contest/136/C dfs找出最长路和次长路,将两个结果相加再加上起点即可; 阅读全文
posted @ 2018-08-22 21:48 liubilan 阅读(210) 评论(0) 推荐(0)