#include #include using std::cin,std::cout,std::max,std::iostream; constexpr size_t MAX_N {100+5}; int n, arr[MAX_N], go_up[MAX_N], go_down[MAX_N], ans; int main(){ iostream::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>n; for(int i=0;i>arr[i]; go_up[i]=1,go_down[i]=1; } for(int i=0;i=0;j--){ if(arr[j]=0;i--){//i < j for(int j=i+1;j