码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
Euler_problem_14 for python
Euler 14的不同解法 ----所涉及的知识 1. yield 2.BF 3. decorator 4.cache 5.等等 def euler_problem_14():     """         最直接粗暴的解法:就是直接如下所示了     """     max_count = 1     max_value = 1     for i in xrange(10010...
分类:编程语言   时间:2014-06-05 04:46:16    阅读次数:266
hdu 1863 畅通工程
题目:         链接:点击打开链接 题意:         中文题 算法: 思路:         赤裸裸的最小生成树。。 代码: #include #include using namespace std; struct node{ int u,v,w; } e[110]; int p[110]; int n,m,sum,ans; int cmp(node...
分类:其他好文   时间:2014-06-05 03:50:23    阅读次数:232
解析PE文件的附加数据
解析程序自己的附加数据,将附加数据写入文件中。 主要是解析PE文件头,定位到overlay的地方,写入文件。常应用的场景是在crackme中,crackme自身有一段加密过的附加数据,在crackme运行的过程中解析自己的附加数据,然后解密这段数据。。。。 代码留存: //解析自己的PE文件 TCHAR szModuleFile[MAX_PATH] = {0}; ::GetMod...
分类:其他好文   时间:2014-06-05 03:01:16    阅读次数:438
LeetCode: Plus One [067]
【题目】 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 【题意】 给定一个非负整数,这个表示为一个数字数组。计算这个整数加1后的值。 【思路】 从低位到高位依次相加,注意处理进...
分类:其他好文   时间:2014-06-05 01:24:44    阅读次数:250
LeetCode:4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: ...
分类:其他好文   时间:2014-06-05 00:34:06    阅读次数:240
BZOJ 刷题记录 PART 1
【前言】好久没写题解了,我还是写一下做题表格吧,如果有值得写的题目还是写一下。 【BZOJ1270】递推显然很简单。直接从高处和上面转移过来。 for (h=H;h;h--) { Max=0; for (i=1;i<=n;i++) Max=max(f[i][h+D],Max); for (i=1;i<=n;i++) f[i][h]=max...
分类:其他好文   时间:2014-06-05 00:30:21    阅读次数:284
c++ primer plus(第6版)中文版 第十三章编程练习答案
第十三章编程练习答案 13.1根据Cd基类,完成派生出一个Classic类,并测试 //13.1根据Cd基类,完成派生出一个Classic类,并测试 #include #include using namespace std; // base class class Cd { char performers[50]; char label[20]; int selections; ...
分类:编程语言   时间:2014-06-04 23:45:54    阅读次数:490
POJ 3268 Silver Cow Party dijkstra单源最短路
裸dijkstra 思路:以x为源点,求到其他点的最短路,之后把邻接矩阵转置,再求一次x源 点的最短路,这样就一次是来的,一次是走的,相加迭代最大值即可 代码: /* poj 3268 8108K 47MS */ #include #include #define MAXN 1005 #define MAX_INT 2147483647 using namespace s...
分类:其他好文   时间:2014-06-04 23:32:57    阅读次数:303
hdu-4578-Transformation-线段树
当一道题目,使用__int64超时,使用int就能A的时候,我想,这个题,不是一个好题。。。。。 add[i]:记录加的lazy标记 mul[i]:记录乘的lazy标记 num[i]:记录数的lazy标记 sum[i][j]:第i段,j次方的和。 除去lazy标记的下放,这完全就是一道水的线段树的题目。。。 lazy标记如何下放呢? 1,首先查看num标记,如果存在,果断下放。 2...
分类:其他好文   时间:2014-06-04 21:41:27    阅读次数:343
leetcode:String to Integer (atoi)
问题 输入:一个表示数字的字符串,需要考虑不同的输入形式。 输出:对应的整数 特殊输入形式: 1.输入开始几个字符为空格 2.考虑正负号 3.数字字符不属于[0,9]时,输出当前结果 4.字符串代表的数字大于INT_MAX或者小于INT_MIN时输出INT_MAX或者INT_MIN。 class Solution { // out of range...
分类:其他好文   时间:2014-06-03 06:30:14    阅读次数:314
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!