tjut 4920
来源:互联网 发布:java工程师年龄要求 编辑:程序博客网 时间:2024/06/14 19:55
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int a[805][805],b[805][805],c[805][805]; int main() { int n,i,j,k; while(~scanf("%d",&n)) { for(i = 0; i<n; i++) for(j = 0; j<n; j++) { scanf("%d",&a[i][j]); a[i][j]%=3; c[i][j] = 0; } for(i = 0; i<n; i++) for(j = 0; j<n; j++) { scanf("%d",&b[i][j]); b[i][j]%=3; } for(i = 0; i<n; i++) for(j = 0; j<n; j++) { if(!a[i][j]) continue; for(k = 0; k<n; k++) c[i][k] = c[i][k]+a[i][j]*b[j][k]; } for(i = 0; i<n; i++) { for(j = 0; j<n; j++) if(j==n-1) printf("%d\n",c[i][j]%3); else printf("%d ",c[i][j]%3); } } return 0; }
0 0
- tjut 4920
- tjut 5289
- tjut 5288
- tjut 5294
- tjut 2586
- tjut 5296
- tjut 5297
- tjut 5299
- tjut 5384
- tjut 5387
- tjut 5386
- tjut 5381
- tjut 5400
- tjut 5399
- tjut 5396
- tjut 5398
- tjut 5412
- tjut 5410
- POJ 3450 Corporate Identity(kmp求多个字符串的最长公共子串)
- [HDU 2222] Keywords Search [AC自动机]
- 剑指offer 37题 【时间空间效率的平衡】两个链表的第一个公共结点
- 二、词法结构
- ISO12233分辨率测试卡的使用方法
- tjut 4920
- ubuntu14.04搭建hadoop集群
- SVM入门学习总结
- dedecms织梦TAG标签显示每个标签共有多少篇文章的方法
- hdoj5363Key Set(快速幂+同余定理)
- PHP file_put_contents&file_get_contents的使用
- js使用立即调用的函数表达式创建局部作用域问题
- dedecms织梦TAG标签显示每个标签共有多少篇文章的方法
- Mac显示或不显示隐藏文件操作命令