#include<bits/stdc++.h>
using namespace std;
long long n,m,a[105][105],ans;
int main()
{
cin>>n>>m;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
cin>>a[i][j];
for(int i=1;i<=n-2;i++)
{
for(int j=1;j<=m-2;j++)
{
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i][j+2]+a[i+1][j+1]+a[i+2][j])
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i][j]+a[i+1][j+1]+a[i+2][j+2])
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i][j+2]+a[i+1][j+2]+a[i+2][j+2])
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i+1][j]+a[i+1][j+1]+a[i+1][j+2])
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i+2][j]+a[i+2][j+1]+a[i+2][j+2])
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i][j]+a[i+1][j]+a[i+2][j])
if(a[i][j]+a[i][j+1]+a[i][j+2]==a[i][j+1]+a[i+1][j+1]+a[i+2][j+1])
ans++;
}
}
}
cout<<ans;
return 0;
}
巧阔力
最新推荐文章于 2024-06-19 13:45:26 发布