#6,7AC(其他WA) 20分求调
查看原帖
#6,7AC(其他WA) 20分求调
1417265
limaotong楼主2025/6/27 21:15
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,k,a[110][110],b[110][110];
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>a[i][j];
        }
    }
    for(int i=1;i<=k;i++){
        for(int j=1;j<=k;j++){
            cin>>b[i][j];
        }
    }
    for(int i=1;i<=n-k+1;i++){
        for(int j=1;j<=m-k+1;j++){
            long long sum=0;
            for(int h=1;h<=k;h++){
                for(int l=1;l<=k;l++){
                    sum+=a[i+h-1][j+l-1]*b[h][l];
                }
            }
            cout<<sum<<' ';
        }
        cout<<'\n';
    }
	return 0;
}
2025/6/27 21:15
加载中...