文章
21
粉丝
0
获赞
19
访问
4.8k
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<vector<int>> matrix;
// 输入
for(int i = 0; i < n; i++){
int size;
cin >> size;
vector<int> tmp;
// tmp.clear(); //
tmp.resize(size);
for(int j = 0; j < size; j++){
cin >> tmp[j];
}
matrix.push_back(tmp);
}
//-----------------------------
int ans = 0;
for(int i = 0; i < n; i++){
int low, high;
low = matrix[i][0];
high = matrix[i][matrix[i].size() - 1];
for(int j = i + 1; j < n; j++){
ans = max(ans, abs(low - matrix[j][matrix[j].size() - 1]));
ans = max(ans, abs(high - matrix[j][0]));
}
}
cout << ans << endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发