前言
传送门 :
思路我们可以处理出每一行的最大最小 和 每一列的最大最小
然后重复的 即是当前 二维矩阵的最大最小
Mycode// Problem: 理想的正方形
// Contest: AcWing
// URL: https://www.acwing.com/problem/content/1093/
// Memory Limit: 64 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define IOS ios::sync_with_stdio(false);
#define CIT cin.tie(0);
#define COT cout.tie(0);
#define ll long long
#define x first
#define y second
#define pb push_back
#define endl '\n'
#define all(x) (x).begin(),x.end()
#define Fup(i,a,b) for(int i=a;i=b;i--)
typedef priority_queue Pri_m;
typedef pair pii;
typedef vector VI;
map mp;
const int N = 1010 , INF = 0x3f3f3f3f;
int row_min[N][N] , row_max[N][N];
int n,m,k;
int w[N][N];
int q[N];
void get_min(int a[],int b[],int tot){
int hh=0, tt=-1;
for(int i=1;i
关注
打赏