优美的Fibonacci数列与矩阵 题目:http://codeforces.com/contest/392/problem/C 题意:给定Fibonacci数列F[],令 ,求 的值。 分析:对于Fibonacci数列的题目来说一般要构造矩阵。那么本题应该怎样解决? 首先我们设 因为 所以得到 那么,我们继续有 然后我们可以构造矩阵了。。。如下 到了这里,本题完美解决!!! 代码:...
http://codeforces.com/contest/365/problem/B 1#include <cstdio>2#include <cstring>3#include <algorithm>4#definemaxn 2000105#defineLL __int646usingnamespacestd;78intn;9LL a[maxn];1011intmain()12{13while(scanf("%d",&n)!=EOF)14{15for(inti=1; i<=n; i++)16{17scanf("%I64d",&a...