题目链接
https://codeforces.com/problemset/problem/375/B
题意
给出01矩阵,可以交换行,问可求得纯1子矩阵最大面积
思路
对于每个1,预处理出向右最大能到达的1的位置r。双端队列可以实现。
左到右枚举每一列,将这一列每一行的r插入数组,排序,之后遍历更新答案即可。
代码
#include<cstdio>
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<string>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<chrono>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
#define int long long
//#define double long double
using namespace std;
typedef long long ll;
const int maxn=5505;
const int inf=