| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 31156 | 陈路垚 | 最长连号 | C++ | Wrong Answer | 50 | 0 MS | 252 KB | 442 | 2022-01-29 11:02:10 |
#include<bits/stdc++.h>//万能头文件 using namespace std; int n,q,i,j,s=1,maxx;//int main()主函数上定义,默认初始值为0 int main() { cin>>n>>q; for(i=2;i<=n;i++) {cin>>j; if(q<j&&j-q==1)s++;//如果a[i+1]>a[i],s++ else s=1;//否则,s继续等于1 if(s>maxx)maxx=s;//打擂台比大小 q=j;//交换q,j的值 }cout<<maxx;//输出最大值 return 0;//结束 }