不要问窝 为什么过了> < 窝也不造为什么就过了 说是%3变成稀疏矩阵 可是随便YY个案例都会超时。。。 看来数据是随机的诶 #include <stdio.h> #include <string.h> #include <stdlib.h> #include <limits.h> #include ...
分类:
其他好文 时间:
2017-08-05 09:47:26
阅读次数:
118
Given some matrices, in what order you would multiply them to minimize cost of multiplication. The following problem formulation is extracted from thi ...
分类:
其他好文 时间:
2017-08-04 13:47:58
阅读次数:
161
Given four numbers, can you get twenty-four through the addition, subtraction, multiplication, and division? Each number can be used only once. Input ...
分类:
其他好文 时间:
2017-07-28 20:56:16
阅读次数:
120
Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains numberi?×?j. The ...
分类:
其他好文 时间:
2017-07-26 20:28:10
阅读次数:
142
题目链接:http://poj.org/problem?id=1651 题意:初使ans=0,每次消去一个值,位置在pos(pos!=1 && pos !=n) 同一时候ans+=a[pos-1]*a[pos]*a[pos+1]。一直消元素直到最后剩余2个,求方案最小的ans是多少? 代码: #in ...
分类:
其他好文 时间:
2017-07-24 10:02:16
阅读次数:
102
HDU 4920 Matrix multiplication 题目链接 题意:给定两个矩阵,求这两个矩阵相乘mod 3 思路:没什么好的想法,就把0的位置不考虑。结果就过了。然后看了官方题解,上面是用了bitset这个东西,能够用来存大的二进制数,那么对于行列相乘。事实上就几种情况,遇到0都是0了, ...
分类:
其他好文 时间:
2017-07-08 17:52:14
阅读次数:
165
Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i ...
分类:
其他好文 时间:
2017-06-25 10:01:45
阅读次数:
196
输入n个矩阵的维度和一些矩阵链乘表达式,输出乘法的次数。如果乘法无法进行,则输出error。假定A是m*n矩阵,B是n*p矩阵,那么A*B是m*p矩阵,乘法次数为m*n*p。如果A的列数不等于B的行数,则乘法无法进行。 例如,A是50*10的,B是10*20的,C是20*5的,则(A(BC))的乘法 ...
分类:
其他好文 时间:
2017-06-23 23:04:51
阅读次数:
270
题意:给出n,m,k,问(1.....n)*(1......m)共有n*m个答案,问第k小 思路:很熟悉的样子,和51nod的第K大类似 不过这题不用再套一个二分,上面的跑了900多MS,差点GG 这个280MS ...
分类:
其他好文 时间:
2017-06-21 11:40:08
阅读次数:
137
625. Minimum FactorizationGiven a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is ...
分类:
其他好文 时间:
2017-06-20 01:03:45
阅读次数:
303