题目地址:HDU 4883
唉。。最近得了一种惯性。。刚学了什么就碰到个类似的就想用刚学的算法。。。原来这题如此简单。。当时真是想多了。。。。
只要在需要变化的点上设置一个值,是增多少还是减多少。然后当遍历过来的时候加上或减去这个值就行了。。。
代码如下:
#include
#include
#include
#include
#include
#include
#includ...
分类:
其他好文 时间:
2014-07-29 14:26:48
阅读次数:
195
通过eval()制作简单计算器~~ 1 2 3 4 5 Calculator 6 7 8 9 35 36 37 38 39 40 41 42 ...
分类:
Web程序 时间:
2014-07-29 13:29:38
阅读次数:
266
1 2 3 4 5 Calculator 6 7 8 9 35 36 37 38 39 40 41 42 44 ...
分类:
Web程序 时间:
2014-07-29 11:14:36
阅读次数:
327
一.KMP算法是如何针对传统算法修改的用模式串P去匹配字符串S,在i=6,j=4时发生失配:--------------------------------------------------------------------- i=6S: a b a bc a ...
分类:
其他好文 时间:
2014-07-27 21:27:05
阅读次数:
220
#include
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int ab=a+b-c,bc=b+c-a,ac=a+c-b;
if(ab>=0&&bc>=0&&ac>=0&&ab%2==0&&bc%2==0&&ac%2==0)
printf("%d %d...
分类:
其他好文 时间:
2014-07-27 11:14:02
阅读次数:
194
s = ['a','b','c','d','e']for i in range(len(s)):... if i < len(s)-1:... print s[i]abcdfor i in range(len(s)):... if i < len(s)-1:... print s[i+1]...bc...
分类:
其他好文 时间:
2014-07-25 14:20:51
阅读次数:
198
《以SAP为参照评估OpenERP》摘要:http://www.openstone.cn/blogs/%E3%80%8A%E4%BB%A5sap%E4%B8%BA%E5%8F%82%E7%85%A7%E8%AF%84%E4%BC%B0openerp%E3%80%8B%E6%91%98%E8%A6%8...
分类:
其他好文 时间:
2014-07-23 15:10:06
阅读次数:
164
Description
During the Warring States Period of ancient China(476 BC to 221 BC), there were seven kingdoms in China -- they were Qi, Chu, Yan, Han, Zhao, Wei and Qin. Ying Zheng was the king of the...
分类:
其他好文 时间:
2014-07-21 23:27:49
阅读次数:
437
题意: 给你一个双向连通图,求 获得权值最大 的 哈密顿通路的 权值 和 这个权值对应的数目; 其中权值计算方法是 列如 ABCD 权值是a+b+c+d+ab+bc+cd 如果 A,B,C 和B,C,D 可构成三角形分别加上abc,bcd;这个题 和poj 3311 很相像: 那个需要记录一个最后....
分类:
其他好文 时间:
2014-07-21 09:32:05
阅读次数:
263
Interesting Calculator
Time Limit: 2 Sec Memory Limit: 128 MB
Submit: 163 Solved: 49
Description
There is an interesting calculator. It has 3 rows of buttons.
Row 1: button 0, 1,...
分类:
其他好文 时间:
2014-07-20 22:35:23
阅读次数:
234