【JZOJ6360】最大菱形和(rhombus)
description analysis 容易想到把原矩阵翻转 \(45°\) ,然后每个数再用 \(0\) 隔开 然后就变成了求最大子正方形,求完二维前缀和之后就很好做了 code #pragma GCC optimize("O3") #pragma G++ optimize("O3") #include<stdio.h> #include<string.h> #include<algorithm> #define MAXN 6005 #define ha 19260817 #define ll long long #define reg register ll #define fo(i,a,b) for (reg i=a;i<=b;++i) #define fd(i,a,b) for (reg i=a;i>=b;--i) using namespace std; ll a[3005][3005],b[MAXN][MAXN]; ll n,m,h,type,ans=-ha; ll Seed,A,B,C,MOD; inline ll read() { ll x=0,f=1;char ch=getchar(); while (ch<'0' || '9'<ch){if (ch='-')f=-1;ch=getchar();} while ('0'<=ch && ch<='9')x=x*10