https://www.nowcoder.com/acm/contest/202/A
你以为评测机跑的慢吗
那你就大错特错啦!
代码是转的。。。
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int n,p,m;
int A[5000][70],B[70][5000];
long long ans;
int main() {
scanf("%d%d%d",&n,&p,&m);
for(int i=1; i<=n; i++) for(int j=1; j<=p; j++) scanf("%x",&A[i][j]);
for(int i=1; i<=m; i++) {
for(int j=1; j<=p; j++) {
int t;
scanf("%1d",&t);
B[j][i]=t;
}
}
for(int i=1; i<=n; i++) {
for(int j=1; j<=m; j++) {
long long tans=0;
for(int k=1; k<=p; k++) {
tans+=A[i][k]*B[k][j];
}
ans^=tans;
}
}
cout<<ans;
return 0;
}
本文分享了一段用于评测计算机性能的代码示例,通过矩阵运算测试机器的运行速度。代码使用C++编写,涉及二维数组的定义与操作,适用于对评测机性能有兴趣的读者。
&spm=1001.2101.3001.5002&articleId=82927734&d=1&t=3&u=c9d3d998e5bb41ebb5180e2d1fa8a67e)
538

被折叠的 条评论
为什么被折叠?



