码迷,mamicode.com
首页 >  
搜索关键字:hdoj matrix    ( 6780个结果
hdoj 1789 Doing Homework again 【贪心】
贪心策略:先按分数从大到小排序,分数一样,再按时间从小到大排序 分最高的越靠近期限完成,越好 话不多说直接看代码 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1789 代码: #include #include #include using std::sort; typedef struct{ int sco, time; ...
分类:其他好文   时间:2014-07-29 15:18:48    阅读次数:170
[LeetCode]Search a 2D Matrix
[LeetCode]Search a 2D Matrix...
分类:其他好文   时间:2014-07-29 15:14:31    阅读次数:154
HDU 2830 Matrix Swapping II (最大完全子矩阵之可移动列)
HDU 2830 Matrix Swapping II (最大完全子矩阵之可移动列)...
分类:移动开发   时间:2014-07-29 14:36:08    阅读次数:236
[ACM] POJ 3318 Matrix Multiplication (随机化算法)
Matrix Multiplication Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 16118   Accepted: 3485 Description You are given three n × n matrices A, B and C. Doe...
分类:其他好文   时间:2014-07-29 14:29:48    阅读次数:251
hdoj 1060
代码:#include #include int main(){ int t; while(scanf("%d",&t)!=EOF) { while(t--) { __int64 n; scanf("%I64d",&n); double x=n*log10(n*1.0); x-=(__int64)x...
分类:其他好文   时间:2014-07-29 12:34:57    阅读次数:229
矩阵(matrix)
我们定义一个矩阵的权值为这个矩阵四个角上的数值的最小值。现在小M有一个矩阵,他想在这个矩阵中寻找到一个权值最大的子矩阵,请你告诉他这个最大权值。(距形规模最大为2000*2000)比赛 看到第二题那么大的数据 就他妈不想写了。。直接写了个爆搜看第三题,也就是这题。。总感觉可以做的感觉,但就是想不出好...
分类:其他好文   时间:2014-07-29 12:11:46    阅读次数:267
SGU196_Matrix Multiplication
给一个无向图,如果第i个点连接第j条边,那么mat[i][j]=1,否则mat[i][j]=0。求mat的转置乘以本身得到的矩阵每个位置的和是多少?理解矩阵的意义就比较好做了。mat[i][j]表示i点可以连接到j边,转置后相乘的意义是第i边和第j边有公共点。这样,我们只需要统计每个点的度数,这样我...
分类:其他好文   时间:2014-07-29 11:40:46    阅读次数:207
hdoj 2057
代码:#include #includeint main(){__int64 a,b,c;while(scanf("%I64X%I64X",&a,&b)!=EOF){ c=a+b; if(c<0){printf("-"); c=-c;}printf("%I64X\n",c);}return 0;}无...
分类:其他好文   时间:2014-07-29 10:36:06    阅读次数:228
HDOJ 1301 Jungle Roads
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1301//HDOJ1301#include#includeusing namespace std;#define MAX 99999#define LEN 30int dist[LEN];//某点的权值 ...
分类:其他好文   时间:2014-07-28 19:15:04    阅读次数:285
HDOJ--4791--Alice's Print Service
题意:现在你要打印一些东西,比如需要99张纸,打印100张以下时话费10元每张,100张及100张以上时需要5元每张,此时你可以选择打印100张,使得花费更小。现给一个数字n,表示n个区间段,然后有s1,p1,s2,p2......sn,pn,表示打印纸张大于等于s1而小于s2时,每张纸话费p1元,现有m个询问,问每次给你x张纸,所需的最小花费是多少。 思路:可以从后往前做一个O(n)的...
分类:其他好文   时间:2014-07-28 16:33:54    阅读次数:180
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!