/*input201 2 1 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 2 2*/#include<iostream>using namespace std;int main(){int n; cin>>n;int a[n];for (int i = 0; i < n; ++i)cin>>a[i];int depthCounter=0, maxDepthPos=0, maxDepth=0, startPos=0, endPos=0, length=0, maxLengthPos=0, maxLength=0;for (int i = 0; i < n; ++i){if(a[i]==1){if(depthCounter==0){startPos=i;}depthCounter++;
Read more…