#include using namespace std; long getMax(int len){ int count=0; int max=0; if(len==1){ return 1; } for(int i=1;i a) { // Return the length of the longest possible sequence of moves. long moves=0; for(int i=0;i> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = longestSequence(a); cout << result << endl; return 0; }