You are viewing a single comment's thread. Return to all comments →
my code code worked for many custom test cases . suggestions if any is appreciated
using namespace std; int main(){ int row,count1=0,max1=0; cin>>row; vector> myvector(row); for(int i=0;i>col; myvector[i]=vector (col); for(int j=0;j>myvector[i][j]; }
} for(int i=0;i<myvector.size();i++){ for(int j=0;j<myvector[i].size()-1;j++){ if(myvector[i][j]>myvector[i][j+1] || myvector[i][j+1]<max1 ){ max1=myvector[i][j]; count1++; } } if(count1>1) cout<<"NO\n"; else cout<<"YES\n"; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Impressing the Boss
You are viewing a single comment's thread. Return to all comments →
my code code worked for many custom test cases . suggestions if any is appreciated
include
include
using namespace std; int main(){ int row,count1=0,max1=0; cin>>row; vector> myvector(row); for(int i=0;i>col; myvector[i]=vector (col); for(int j=0;j>myvector[i][j]; }
}