1. 将一个数组分成左右两部分,使得右边的某个连续子段和减去左边的某个连续字段和最小[7,8,9,|3,5,-1] sum right - sum left minimal 想到左右分一刀,O(n),然后对左右分别取最大字段和算法,这样是O(n^2).但是其实左右各扫一遍,然后记录下来就行了. int minimaldif(vector<int> &a){ vector<int> max(a.size()); int sum = max[0] = a[0]; for (in…
2016年12月25日 星期日 --出埃及记 Exodus 21:20 "If a man beats his male or female slave with a rod and the slave dies as a direct result, he must be punished,人若用棍子打奴仆或婢女,立时死在他的手下,他必要受刑.…
2016年10月25日 星期二 --出埃及记 Exodus 19:9 The LORD said to Moses, "I am going to come to you in a dense cloud, so that the people will hear me speaking with you and will always put their trust in you." Then Moses told the LORD what the people had said.…
2016年6月25日 星期六 --出埃及记 Exodus 14:22 and the Israelites went through the sea on dry ground, with a wall of water on their right and on their left.以色列人下海中走乾地,水在他们的左右作了墙垣.…