1 条题解

  • 0
    @ 2026-8-11 11:09:03
    #include<bits/stdc++.h>
    using namespace std;
    #define int long long
    #define N 1100
    const int P=998244353;
    int a[N][N],b[N][N],c[N][N];
    signed main()
    {
    	ios::sync_with_stdio(0);
    	cin.tie(0);cout.tie(0);
    	int n,m,k;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<=m;i++)
    		for(int j=1;j<=k;j++)cin>>b[i][j];
    	for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)
    		for(int l=1;l<=k;l++)c[i][l]=(c[i][l]+a[i][j]*b[j][l]%P)%P;
    	for(int i=1;i<=n;i++)
    	{
    		for(int j=1;j<=k;j++)cout<<c[i][j]<<' ';
    		cout<<'\n';
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    3310
    时间
    10000ms
    内存
    1024MiB
    难度
    10
    标签
    递交数
    6
    已通过
    4
    上传者