#include #include using std::cin, std::cout, std::iostream, std::max, std::for_each_n; constexpr size_t MAX_N {(size_t)5e5+5}; int arr[MAX_N], len[MAX_N], ans1, ans2{1}, n, last_max; int main(){ iostream::sync_with_stdio(false), cin.tie(0), cout.tie(0); while(cin>>arr[n++]); for(int i=0;i=0;j--){ //j=arr[i] && len[i]