码迷,mamicode.com
首页 >  
搜索关键字:hdu 1394 minimum inv    ( 34217个结果
Fire Net HDU 1045
简单深搜,可以完全暴力,不会超时的。#include#include#includeusing namespace std;#define MAX(a,b) (a>b?a:b) char maze[10][10];int n, maxn;void DFS(int step,int count);in...
分类:Web程序   时间:2014-06-04 20:43:04    阅读次数:270
Edit Distance
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:其他好文   时间:2014-06-04 20:12:15    阅读次数:199
Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA...
分类:Windows程序   时间:2014-06-04 19:07:31    阅读次数:385
HDU 4067 Random Maze 费用流
Random MazeTime Limit: 10000/3000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1114Accepted Submission(s): 387Problem...
分类:其他好文   时间:2014-06-04 18:54:28    阅读次数:284
HDU 1015 dfs回溯
题目真长。。。。。看了好长时间才看懂。。就是给你一个32位数字和一个最多15个字符的字符串,从字符串中选出5个字符,若满足题中给的那个式子,输出字典序最大的那5个字符,若不满足,输出no solution。为了解决字典序问题,在输入字符串后,把字符串按从大到小排一下序,搜索一下若满足条件输出即可。贴...
分类:其他好文   时间:2014-06-03 13:07:48    阅读次数:200
HDU 2069二维母函数
显然母函数,有一个地方需要注意。当输入0时,只有一种方法,所以输出1。代码: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int c1[255][111], c2[255][111]; 7 main...
分类:其他好文   时间:2014-06-03 12:21:39    阅读次数:242
【HDOJ】1394 Minimum Inversion Number
逆序数的性质。1. 暴力解 1 #include 2 3 #define MAXNUM 5005 4 5 int a[MAXNUM]; 6 7 int main() { 8 int n; 9 int i, j, sum, min;10 11 while (scanf(...
分类:其他好文   时间:2014-05-31 07:50:50    阅读次数:170
UVA 10827 Maximum sum on a torus
算法入门经典训练指南88页练习::这道题只要把原矩阵扩大4倍,那么其跟最大子矩阵的题目就很类似,把二维转化成一维,求最大的序列和,不过这个序列的长度不能超过n。长度不能超过n? 那这道题又跟hdu 3415HDU 3415 Max Sum of Max-K-sub-sequence (单调队列) 1...
分类:其他好文   时间:2014-05-30 18:14:46    阅读次数:471
Palindrome Partitioning II
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:其他好文   时间:2014-05-30 15:13:10    阅读次数:262
Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:其他好文   时间:2014-05-30 14:59:37    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!