1

反蝴蝶效应

http://www.nowcoder.com/questionTerminal/026e05f10d734e4ca9ffd10ff1330996

include<bits/stdc++.h>

using namespace std;
int a[10000000];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for(int i = 1; i <= n; i++)
{
cin >> a[i];
}
int maxx = 0;
for(int i = n; i >= 1; i--)
{
maxx++;
if(a[i] > maxx)
{
maxx = a[i];
}
}
cout << maxx << "\n";
return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务