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. Java基础加强学习笔记(二)

    一.反射的基础Class类 1.如何得到各个字节码对应的实例对象 (1)类名.class,例如 System.class (2)对象.getClass(),例如 new Data().getClass ...

  2. HDU 5496 - BestCoder Round #58 - Beauty of Sequence

      题目链接 : http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=637&pid=1002 思路 : 考 ...

  3. 关于本学期西南交通大学ACM-ICPC校集训队 训练计划(Beta 1.0)

    在第十周新秀杯之后,从第十一周起的训练计划如下: 1.十一周的周一至周五进行ACM校集训队申请.申请方式从2014年11月17日0:00开始,发送申请者的姓名.学号.专业.电话.QQ以及大学(针对大一 ...

  4. 消除JavaScript闭包的一般方法

    JavaScript 的闭包是一个其主动发展的特性, 也是一个被动发展的特性. 也就是说, 一方面, JS 有了闭包能更好解决一些问题. 另一方面, JS 为了解决某些问题, 而不得不使用闭包勉强来解 ...

  5. markdown转dokuwiki

    markdown markdown格式变得越来越通用,很多博客,云笔记,github等等都支持markdown编写,markdown也能很方便的转化为pdf,html等格式.公司的文档用的dokuwi ...

  6. Nyoj 43 24 Point game 【DFS】

    24 Point game 时间限制:3000 ms  |  内存限制:65535 KB 难度:5 描写叙述 There is a game which is called 24 Point game ...

  7. IE6下的怪异解析知识点补充

    转载请注明出处:HTMl5自由者      

  8. [Angular 2] @Input Custom public property naming

    TodoList.ts: @Component({ selector: 'todo-list', directives: [TodoItemRenderer], template: ` <ul& ...

  9. Qt学习博客推荐

    附录C Qt资源 C.1 Qt 官方资源 全 球各大公司以及独立开发人员每天都在加入 Qt 的开发社区.他们已经认识到了Qt 的架构本身便可加快应用程序开发进度.这些开发人员,无论是想开发单平台软件. ...

  10. 初探R语言——R语言笔记

    R语言使用 <-  赋值 # 作为注释符号 c()函数用于作为向量赋值,例如age<-c(1,2,3,4,5) mean()用于求向量的平均值 sd()求向量的标准差 cor(a,b)求a ...