码迷,mamicode.com
首页 >  
搜索关键字:abs problem    ( 43112个结果
HDOJ 1316 How Many Fibs?
JAVA大数.... How Many Fibs? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3906    Accepted Submission(s): 1545 Problem Descri...
分类:其他好文   时间:2014-06-30 09:06:32    阅读次数:160
POJ_2299 Ultra-QuickSort【归并排序】
题目链接:http://poj.org/problem?id=2299 题目大意:求出排序过程中的最小交换次数 利用归并排序的分治算法解决此题。 代码: #include #include #include #define N 500001 using namespace std; int a[N]; int temp[N]; long long ans; void merge(in...
分类:其他好文   时间:2014-06-30 08:18:11    阅读次数:230
hdu 4123 Bob’s Race (树的直径相关+rmq+单调队列思想)
Bob’s Race Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2115    Accepted Submission(s): 658 Problem Description Bob wants to hol...
分类:其他好文   时间:2014-06-30 07:37:16    阅读次数:284
ural 1143. Electric Path(凸包上最短哈密顿路径)
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1143 题意:逆时针给一个凸包的n(n 解法:求最短哈密顿本身是一个NP问题,但是因为是凸包上,可以利用这个做;有一个性质:凸包上的最短哈密顿路径不会出现交叉。所以可以看出来从一点出发,他要么和顺时针相邻点连接,要么和逆时针相邻点相连接;通过这个性质可以通过dp做: ans[i][j...
分类:其他好文   时间:2014-06-30 06:11:07    阅读次数:328
HDOJ 1047 Integer Inquiry
JAVA大数.... Integer Inquiry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12042    Accepted Submission(s): 3037 Problem Descript...
分类:其他好文   时间:2014-06-30 00:18:48    阅读次数:235
C/C++:多个.cpp文件包含同一个.h头文件定义方法
本文解决Description Resource Path Location Type multiple definition of `deal_word(std::string)' Myfunc.h /Vector_Test/src/Headers line 30 C/C++ Problem...
分类:编程语言   时间:2014-06-29 23:51:07    阅读次数:436
Codeforces 15B Laser
题目链接:点击打开链接 #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N 5005 #define ll __int64 inline ll Abs(ll x){return x>...
分类:其他好文   时间:2014-06-29 23:48:09    阅读次数:362
ural1147(Shaping Regions)矩形切割
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1147 题意:一个10000*10000的矩阵,初始颜色都为1,然后最多2500次涂色,每次涂色将一个矩形的面积涂成某个特定颜色,问涂完之后每种颜色最终的面积。 解法: 代码:/*********************************************...
分类:Windows程序   时间:2014-06-29 23:14:16    阅读次数:408
HDU 2824 The Euler function 题解
求区间的euler数值,自然使用筛子法了。 Problem Description The Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprim...
分类:其他好文   时间:2014-06-29 22:49:30    阅读次数:303
POJ 3468 A Simple Problem with Integers 【树状数组】
题目链接:http://poj.org/problem?id=3468 题目大意:给出一组数组v[i],有两种操作,一种给出两个数a,b,要求输出v[a]到v[b]之间的和,另一种给出三个数a,b,c,让v[a]到v[b]之间的数全都加上c。 完全是树状数组能够实现的功能,但是如果就这样单纯的套用模板,做第二种操作是更新每个值,这样的操作就有可能超时。 换一种思路,既然第二种操作是给某区间上...
分类:其他好文   时间:2014-06-29 20:47:30    阅读次数:216
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!