15分求助

B4005 [GESP202406 四级] 黑白方块

XY_guiling_ @ 2024-11-18 21:18:07

#include<bits/stdc++.h>
using namespace std;
long long a[1000][1000],n,m,maxx=-123155;
int main(){
    cin>>n>>m;
    for(long long i=1;i<=n;i++){
        for(long long j=1;j<=n;j++)cin>>a[i][j];
    }for(long long i=1;i<=n*m/*编号*/;i++){//开始
        for(long long j=1;j<=n*m;j++){//结束
            //便利
            //i%n,i/n;
            //j%n,j/n;
            long long hei=0,bai=0;
            for(long long ii=i%n;ii<=j%n;ii++){
                for(long long jj=i/n;jj<=j/n;jj++){
                    if(a[ii][jj])hei++;
                    else bai++;
                }
            }if(hei==bai)maxx=max(maxx,(j%n-i%n)*(j/n-i/n));
        }
    }cout<<maxx;
}

3个AC17个WA


by zhaoyikuan @ 2024-11-25 19:15:44

有没有种可能就是你后面的m打成了n,并且把%打成了/


|