http://codeforces.com/contest/365/problem/B

 #include <cstdio>
#include <cstring>
#include <algorithm>
#define maxn 200010
#define LL __int64
using namespace std; int n;
LL a[maxn]; int main()
{
while(scanf("%d",&n)!=EOF)
{
for(int i=; i<=n; i++)
{
scanf("%I64d",&a[i]);
}
int max1=min(,n);
int len=;
for(int i=; i<=n; i++)
{
if(a[i]==a[i-]+a[i-])
{
len++;
max1=max(max1,len);
}
else len=;
}
printf("%d\n",max1);
}
return ;
}

cf B. The Fibonacci Segment的更多相关文章

  1. CF#213DIV2:B The Fibonacci Segment

    You have array a1, a2, ..., an. Segment [l, r] (1 ≤ l ≤ r ≤ n) is good if ai = ai - 1 + ai - 2, for ...

  2. codeforces B. The Fibonacci Segment 解题报告

    题目链接:http://codeforces.com/problemset/problem/365/B 题目意思:简单来说,就是要找出最长的斐波纳契长度. 解决的方法不难,但是要注意更新左区间和右区间 ...

  3. Codeforces Round #213 (Div. 2) B. The Fibonacci Segment

    #include <iostream> #include <algorithm> #include <vector> using namespace std; in ...

  4. codeforces 213div(2) 365 A.Good Number 365 B.The Fibonacci Segment

    #include <stdio.h> #include <string.h> bool vis[11]; int n, k; bool judge(int x) { memse ...

  5. 【CF 718C】fibonacci

    题意 给你一个长度为 \(n\) 的序列 \(a\),有 \(m\) 次操作,操作分两种 \(\text{1}\space \text{l}\space \text{r}\space \text{x} ...

  6. codeforces365B

    The Fibonacci Segment CodeForces - 365B You have array a1, a2, ..., an. Segment [l, r] (1 ≤ l ≤ r ≤  ...

  7. CF 914 G Sum the Fibonacci —— 子集卷积,FWT

    题目:http://codeforces.com/contest/914/problem/G 其实就是把各种都用子集卷积和FWT卷起来算即可: 注意乘 Fibonacci 数组的位置: 子集卷积时不能 ...

  8. cf 126D - Fibonacci Decomposition

    题目大意 \(t\le 10^5\)组询问 每次询问\(1\le n\le 10^{18}\) 求有多少种\(n\)的\(fibonacci\)分解 分解定义为:每个\(fib\)数最多选一个,且和为 ...

  9. CF 914G Sum the Fibonacci——子集卷积

    题目:http://codeforces.com/contest/914/problem/G 第一个括号可以子集卷积:第三个括号可以用 FWT 异或卷积:这样算出选两个数组成 x 的方案数:三个部分的 ...

随机推荐

  1. SPOJ 0962 Intergalactic Map

    题目大意:在一个无向图中,一个人要从A点赶往B点,之后再赶往C点,且要求中途不能多次经过同一个点.问是否存在这样的路线.(3 <= N <= 30011, 1 <= M <= ...

  2. poj3237 Tree

    Description You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edg ...

  3. HDU_1239——再次调用外星智慧

    Problem Description A message from humans to extraterrestrial intelligence was sent through the Arec ...

  4. openstack debugs

  5. 上传jar包到Apache Archiva本地仓库

    1.登录archiva,点击左侧的upload Artifact 2 jar 包名称 为:java-client-4.1.2.jar 网上的pom配置为: <!-- https://mvnrep ...

  6. (转)实战p12文件转pem文件

    需要实现这个功能的一般都是app开发证书不支持通配符(即com.xxx.xxx.xxx格式),在业务需求上类似消息推送这样的业务. 1.首先生成一个ssl的证书 选择app IDS 后实现下面这个(这 ...

  7. Apache HttpComponents Client 4.0快速入门/升级-2.POST方法访问网页

    Apache HttpComponents Client 4.0已经发布多时,httpclient项目从commons子项目挪到了HttpComponents子项目下,httpclient3.1和 h ...

  8. Android在跳转市场进行评分问题总结

    原本以为应用评分是个很小的功能,但是一实现才发现真不是个小事.网上搜索资料没有找到答案,在很多开发群里面询问了很多人也没有解决问题,最后分析log,反编译看源码才终于有了些眉目,好吧,上代码: 1 t ...

  9. 学习设计模式--观察者模式(C++)

    1. 说说简单的函数回调 首先说说一种简单的函数回调机制(一种通过获取对象的指针来进行函数的调用方法)以下是代码演示--- 这是观察者(被回调)部分: class Observer { public: ...

  10. Keil IDE指南.

    Keil IDE指南(转载) 熟悉Keil C 51的朋友对于Keil MDK上手应该比较容易,毕竟界面是很像的.但ARM内核毕竟不同于51内核,因此无论在设置上还是在编程思想上,都需要下番功夫研究的 ...