数论
文章平均质量分 72
Neiloz
...
展开
-
HDU1495 非常可乐(bfs/数论(不过数论的我不会))
非常可乐(bfs/数论) 数论链接 http://www.cnblogs.com/ECJTUACM-873284962/p/6750320.html#undefined 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1495 PS(我的思路是照着数论链接里的bfs方法写的,不过这题说白了就是进行6次遍历,以每一个节点为基原创 2017-09-14 12:27:27 · 534 阅读 · 0 评论 -
C - Trailing zeroes(二分+阶乘) LightOJ - 1138
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you knowN! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the原创 2017-10-22 21:34:08 · 232 阅读 · 0 评论 -
A - Fantasy of a Summation(打表找规律) LightOJ - 1213
If you think codes, eat codes then sometimes you may get stressed. In your dreams you may see huge codes, as I have seen once. Here is the code I saw in my dream.#include int cases, caseno;i原创 2017-10-22 21:31:20 · 264 阅读 · 0 评论 -
Help Hanzo(区间求素数) LightOJ - 1197 板子题
Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakururu. After he原创 2017-10-22 21:27:50 · 214 阅读 · 0 评论 -
The equation(exgcd+解不等式方程组)
The equation推荐博客:http://www.cnblogs.com/Rinyo/archive/2012/11/25/2787419.htmlThere is an equation ax + by + c = 0. Given a,b,c,x1,x2,y1,y2 you must determine, how many integer roots of this eq原创 2017-10-22 21:21:48 · 507 阅读 · 0 评论 -
The Super Powers UVA - 11752
通过这道题,学到去重的两种途径: 1.) stl里的set(集合(有序,不重复)(给予红黑树-一种特殊的二叉搜索树,不可删除(貌似是这么回事)))。 2.)stl里有个去重函数unique;具体用法如下:/**Ps:unique(),并不是正真的去重,只是把重复元素移动到序列尾部,真正的去重是ans.earse()下面的代码可能有误,没有验证。**/set<unsigned long l原创 2017-10-10 20:55:08 · 201 阅读 · 0 评论 -
青蛙的约会(扩展欧几里得算法+不定方程求解)
1.折磨了我好久,不过大概是懂了。推荐博客:http://www.cnblogs.com/comeon4mydream/archive/2011/07/18/2109060.html#undefinedhttp://blog.csdn.net/LOI_DQS/article/details/49488851?locationNum=22.题目:两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见原创 2017-09-21 20:27:57 · 284 阅读 · 0 评论 -
So happy!(get 矩阵快速幂)ICPC :E HDU 6198
number number numberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 637 Accepted Submission(s): 407 Problem Description We define a sequenc原创 2017-09-16 09:22:09 · 234 阅读 · 0 评论 -
POJ 3070 斐波那契数列(矩阵快速幂(版题))
链接:http://poj.org/problem?id=3070Fibonacci Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16351 Accepted: 11470DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1,原创 2017-09-16 08:19:11 · 371 阅读 · 0 评论 -
快速幂,快速幂取模,矩阵快速幂
推荐链接:http://www.cnblogs.com/acbingo/p/4504381.html * http://blog.csdn.net/lsldd/article/details/5506933* 题目链接:https://vjudge.net/contest/185352 密码:aa12321#include <bits/stdc++.h>using nam原创 2017-09-15 15:07:13 · 257 阅读 · 0 评论 -
D - **GCD-Exreme(欧拉函数+数学分析,gcd转换) UVA - 11426
Given the value ofN, you will have to nd the value ofG. The de nition ofGis given below:G=i∑i=1jN∑j=i+1GCD(原创 2017-10-22 21:36:58 · 283 阅读 · 0 评论