不说了 经典
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define cl(x) memset(x,0,sizeof(x))
using namespace std;
typedef long long ll;
inline char nc(){
static char buf[100000],*p1=buf,*p2=buf;
if (p1==p2) { p2=(p1=buf)+fread(buf,1,100000,stdin); if (p1==p2) return EOF; }
return *p1++;
}
inline void read(int &x){
char c=nc(),b=1;
for (;!(c>='0' && c<='9');c=nc()) if (c=='-') b=-1;
for (x=0;c>='0' && c<='9';x=x*10+c-'0',c=nc()); x*=b;
}
const int N=505;
int n;
int A[N][N],B[N][N],C[N][N];
int temp[N];
int ans1[N],ans2[N];
inline void mul(int a[N][N],int b[N],int* ans){
int res[N]={0};
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
res[i]+=a[i][j]*b[j];
for (int i=1;i<=n;i++)
ans[i]=res[i];
}
inline bool check(){
for (int i=1;i<=n;i++)
if (ans1[i]!=ans2[i])
return false;
return true;
}
int main(){
freopen("t.in","r",stdin);
freopen("t.out","w",stdout);
int flag=0;
srand(10086);
read(n);
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
read(A[i][j]);
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
read(B[i][j]);
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
read(C[i][j]);
for (int i=1;i<=5;i++) {
for (int j=1;j<=n;j++)
temp[j]=rand()%10+1;
mul(B,temp,ans1);
mul(A,ans1,ans1);
mul(C,temp,ans2);
if (!check())
flag=1;
}
if (flag)
printf("No\n");
else
printf("Yes\n");
return 0;
}