摘要: 题目地址: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 阅读(379) 评论(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 阅读(411) 评论(0) 推荐(0)
摘要: 题目地址:https://www.nowcoder.com/acm/contest/136/F 树状数组、快速幂、逆元的模板运用; 阅读全文
posted @ 2018-08-24 19:04 liubilan 阅读(156) 评论(0) 推荐(0)
摘要: 题目地址:https://www.nowcoder.com/acm/contest/136/C dfs找出最长路和次长路,将两个结果相加再加上起点即可; 阅读全文
posted @ 2018-08-22 21:48 liubilan 阅读(195) 评论(0) 推荐(0)
摘要: 给出前几项,求出第n项; 阅读全文
posted @ 2018-08-22 20:50 liubilan 阅读(255) 评论(0) 推荐(0)
摘要: 题目地址:https://www.nowcoder.com/acm/contest/136/J 解法一: 推数学公式求前n项和; 当k=1时,即为等差数列,Sn = n+pn(n−1)/2 当k≠1时,an+p/(k−1) = k(an−1+p/(k-1)),等比数列,Sn = (kn+1+(p−1 阅读全文
posted @ 2018-08-22 20:03 liubilan 阅读(190) 评论(0) 推荐(0)
摘要: 题目地址:http://www.51cpc.com/web/problem.php?id=4286 解法 1: 解法 2:机智的解法 解法 3:这个简直超神了。。看到这个瞬间就清醒了,就是求4的多少次,特判下0的情况就行; 阅读全文
posted @ 2018-08-21 11:30 liubilan 阅读(182) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2252 应用结论即可,证明参考:https://www.cnblogs.com/zwfymqz/p/8469863.html#_label0 阅读全文
posted @ 2018-08-18 17:06 liubilan 阅读(77) 评论(0) 推荐(0)
摘要: 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1846 经典基础博弈,首先面对(m+1)的人一定会输,依次往后推即可; 阅读全文
posted @ 2018-08-18 12:08 liubilan 阅读(115) 评论(0) 推荐(0)
摘要: 题目地址:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1057&judgeId=605203 使用压位进行优化,即一位数存多位数,例如当设置MOD=1e8时,一位数可以存8位数; 其次,注意尾数0,因为压位,一位需要输出 阅读全文
posted @ 2018-08-13 22:01 liubilan 阅读(221) 评论(0) 推荐(0)