摘要:
题目没啥说的,赤裸裸的树状数组/* * hdu1166/win.cpp * Created on: 2011-9-6 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int MAXN = 50100;int N, M;int array[MAXN];inline int lowbit(int x) { return x & 阅读全文
摘要:
比赛的时候,俊祥一说题目,我就马上意识到是动规,当时我正打着那道悲剧的题目,就让海峰打了,他二十来分钟吧就打完,而且一遍就过了。昨天晚上我再打这题,打了四十分钟,还WA了好几次才过。海峰真是强啊,佩服佩服!/* * hdu4001/linux.cpp * Created on: 2011-9-5 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace 阅读全文
摘要:
这题就是Floyd变形,只要理解了Floyd算法,题目还是不难的。不过我还是WA了一次,原理是在运行Floyd的时候,误加了两个判断,以为当i,j未被标记的时候,i到j的路径不必更新,其实这是错的,去掉以后就过了。/* * hdu3631/win.cpp * Created on: 2011-9-6 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespa 阅读全文