Codeforces Round #243 (Div. 2) B. Sereja and Mirroring

时间:2021-04-05 14:27:17
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; int main(){
int n,m;
cin >> n >> m;
vector<vector<int> > a(n,vector<int>(m,));
for(int i = ; i < n; ++ i){
for(int j = ; j < m ; ++ j){
cin >> a[i][j];
}
}
if(n%) cout<<n<<endl;
else{
int left= ,right =n-, preRight = n-;
while(left < right){
if(a[left] != a[right]) break;
else left++,right--;
if(left- == right) left = ,preRight = right;
}
cout<<preRight+<<endl;
}
}