![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
蓝桥杯
柠栀凉
爱疯爱笑爱胡闹
展开
-
蓝桥杯 入门训练 Fibonacci数列
#include <bits/stdc++.h> using namespace std; #define N 10007 #define M 1000000+10 int f[M]; int fab(int n){ f[1]=1; f[2]=1; for(int i=3;i<=n;i++){ f[i]=f[i-1]+f[i-2]; f[i]%=N; } ...原创 2018-11-25 21:28:56 · 243 阅读 · 0 评论 -
蓝桥杯 序列求和
sum=n*(n+1)/2 #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); long long n; while(cin>>n){ cout<<(n*(n+1)/2)<<endl; } return 0...原创 2018-11-27 10:17:36 · 293 阅读 · 0 评论