Matrix multiplicationTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1775Accepted Submission(s):...
分类:
其他好文 时间:
2014-08-06 17:53:01
阅读次数:
206
Problem Description
Given two matrices A and B of size n×n, find the product of them.
bobo hates big integers. So you are only asked to find the result modulo 3.
Input
The input con...
分类:
其他好文 时间:
2014-08-06 14:58:51
阅读次数:
220
题目连接 :http://acm.hdu.edu.cn/showproblem.php?pid=4920题意 :给两个n*n的矩阵A、B,要求算的A*B (答案对3取模)(比赛的时候一直想不到怎么去消复杂度,在最后的时候想到了用三进制压几位状态(就是几位几位算)应该可以过的,可是敲完比赛也结束。(压...
分类:
其他好文 时间:
2014-08-06 14:27:31
阅读次数:
195
The Hungarian algorithm withThe adjacency matrix:计算最大匹配问题int n1, n2, m, ans;int res[MAXN];bool vis[MAXN], map[MAXN][MAXN];void init(){ int t1, t2; ...
分类:
其他好文 时间:
2014-08-06 14:18:31
阅读次数:
208
线段树 1 #include 2 using namespace std; 3 4 const int maxn = 1000005; 5 const int INF = 1000000009; 6 7 struct node { 8 int sum,ma,mi; 9...
分类:
其他好文 时间:
2014-08-06 14:09:11
阅读次数:
374
http://acm.hdu.edu.cn/showproblem.php?pid=4920
被这道题虐了一下午,啥也不说了。继续矩阵吧。
超时就超在每步取余上,要放在最后取余,再者注意三个循环的次序。
#include
#include
#include
#include
#include
#include
#include
#include
#includ...
分类:
其他好文 时间:
2014-08-06 10:30:31
阅读次数:
144
题目链接:4920 Matrix multiplication
题目大意:给定两个n阶矩阵,求矩阵相乘后模3.
解题思路:因为矩阵模掉3后只有0,1,2三种情况。所以对于矩阵A,记录每一行中1,2的位置,借助bitset。矩阵B中每一列1,2的位置。然后对于结果中每个位置,只要考虑1?1,1?2,2?1,2?2的个数即可。
#include
#include
#include
...
分类:
其他好文 时间:
2014-08-06 02:04:40
阅读次数:
322
Problem Description
Bean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different qualities beans. Meantime, there is only one bean in any 1*1 grid. Now you want to ...
分类:
其他好文 时间:
2014-08-06 01:57:00
阅读次数:
248
Problem DescriptionGiven two matrices A and B of size n×n, find the product of them.bobo hates big integers. So you are only asked to find the result ...
分类:
其他好文 时间:
2014-08-06 01:43:40
阅读次数:
334
Matrix multiplicationTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 820Accepted Submission(s): ...
分类:
其他好文 时间:
2014-08-06 01:20:57
阅读次数:
237