基础题
Viko_ReCode
这个作者很懒,什么都没留下…
展开
-
HDU 4302
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4302 通过本题初步了解STL模板优先队列的运用 priority_queue less让优先队列以从大到小的顺序排列,先出队的是最大元素 greater让优先队列以从小到大的顺序排列,先出队的是最小的元素 #include #include #include using原创 2013-08-02 19:44:28 · 432 阅读 · 0 评论 -
CodeForces 328B (反向BFS)
题目链接:http://codeforces.com/problemset/problem/329/B #include const int inf = (int)1e9; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {1, 0, -1, 0}; char s[1111][1111]; int x[1111111], y[1111原创 2013-07-28 03:42:14 · 434 阅读 · 0 评论 -
POJ 3070 Fibonacci (矩阵快速幂基础题)
题目链接:http://poj.org/problem?id=3070 创建如下矩阵求解递推式Fn项的值: 代码如下: #include #include const int mod = 10000; const int matSize = 2; struct Mat { int val[matSize][matSize]; void init原创 2013-09-11 22:50:43 · 571 阅读 · 0 评论 -
HDU 1496 Equations
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1496 #include #include int hash[2001000], p[101]; int main( ) { int a, b, c, d; for(int i=1; i<101; i++) p[i] = i*i; while(~scanf(原创 2013-10-09 23:49:13 · 347 阅读 · 0 评论 -
HDU 4686 Arc of Dream (矩阵快速幂)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4686 根据题意可得: 递推矩阵如下: 代码如下: #include #include const int mod = 1000000007; const int matSize = 5; long long n, a0, ax, ay, b0,原创 2013-09-13 10:22:38 · 411 阅读 · 0 评论