摘要: 蓝桥杯斐波 题目 斐波那契数列大家都非常熟悉。它的定义是: $$ f(x) = 1 .... (x=1,2)\ f(x) = f(x-1) + f(x-2) .... (x>2)$$ 对于给定的整数 n 和 m,我们希望求出: f(1) + f(2) + ... + f(n) 的值。但这个值可能非常 阅读全文
posted @ 2021-01-03 15:00 bernard5 阅读(642) 评论(0) 推荐(1)
摘要: 快速幂运算 HDU2035 求 http://acm.hdu.edu.cn/showproblem.php?pid=2035 题目是很简单的,因为b也不大所以时间复杂度为$O(n)$的算法也能ac #include <iostream> using namespace std; int a, b; 阅读全文
posted @ 2020-12-28 18:41 bernard5 阅读(334) 评论(0) 推荐(0)