C++
一起来玩玩呗
just to fun...
展开
-
北大 1008 Maya Calendar——做到这里的一点心得
Maya CalendarTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 60309 Accepted: 18596DescriptionDuring his last sabbatical, professor M. A. Ya made a surpris原创 2013-08-22 17:59:25 · 1883 阅读 · 0 评论 -
Help Jimmy(POJ No.1661) 动态规划
Help JimmyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8228 Accepted: 2630Description"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台原创 2013-12-21 20:55:25 · 1211 阅读 · 0 评论 -
Oil Deposits (POJ No.1562) DFS
Oil DepositsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11423 Accepted: 6208DescriptionThe GeoSurvComp geologic survey company is responsible for de原创 2013-12-22 11:03:44 · 1417 阅读 · 0 评论 -
Lake Counting (POJ No.2386) DFS
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17082 Accepted: 8654DescriptionDue to recent rains, water has pooled in various places in F原创 2013-12-22 10:36:32 · 1571 阅读 · 0 评论 -
poj 3009 Curling 2.0 DFS
Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9485 Accepted: 4003DescriptionOn Planet MM-21, after their Olympic games this year, curling i原创 2013-12-23 17:40:39 · 1282 阅读 · 0 评论 -
poj 3669 Meteor Shower
Meteor ShowerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6806 Accepted: 1985DescriptionBessie hears that an extraordinary meteor shower is coming; r原创 2013-12-24 14:46:13 · 1613 阅读 · 0 评论 -
poj 3187 Backward Digit Sums STL排列
Backward Digit SumsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3579 Accepted: 2054DescriptionFJ and his cows enjoy playing a mental game. They write原创 2013-12-28 12:28:04 · 2202 阅读 · 0 评论 -
poj 3616 Milking Time DP
Milking TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4129 Accepted: 1720DescriptionBessie is such a hard-working cow. In fact, she is so focuse原创 2014-02-21 19:32:13 · 1460 阅读 · 0 评论 -
poj 3280 Cheapest Palindrome DP
Cheapest PalindromeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5173 Accepted: 2512DescriptionKeeping track of all the cows can be a tricky task so F原创 2014-02-22 21:02:48 · 975 阅读 · 0 评论 -
UVa 11729 Commando War 贪心
GCommando WarInput: Standard InputOutput: Standard Output “Waiting for orders we held in the wood, word from thefront never cameBy evening the sound of the gunfire was mil原创 2014-02-23 10:13:00 · 1017 阅读 · 0 评论 -
UVa 11300 Spreading the Wealth
注意:给定数轴上的n 个点,在数轴上的所有点中,中位数离所有顶点的距离之和最小。 F. Spreading the Wealth ProblemA Communist regime is trying to redistribute wealth in a village. They have have decided tosit eve原创 2014-02-23 13:58:16 · 1076 阅读 · 0 评论 -
LA 3708- Graveyard
Programming contests became so popular in the year 2397 that the governor of New Earck -- the largest human-inhabited planet of the galaxy -- opened a special Alley of Contestant Memories (ACM) at the原创 2014-02-23 18:39:17 · 1034 阅读 · 0 评论 -
poj 2393
Source CodeProblem: 2393 User: zoujinyongMemory: 252K Time: 94MSLanguage: C++ Result: AcceptedSource Code#include #include using namespace std;int main(){ int N, S; cin >> N >> S;原创 2014-02-18 19:25:53 · 1249 阅读 · 0 评论 -
poj 1862 贪心
StripiesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11128 Accepted: 5327DescriptionOur chemical biologists have invented a new very useful form of lif原创 2014-02-19 10:21:36 · 1165 阅读 · 0 评论 -
数据结构与算法一
题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围)#include using namespace std;const int MAX = 1000000;int getResu(int n){ int sum=0; int temp= 1; for(int i=1; i <= n; i++) { temp *= i; temp %= MAX;原创 2014-05-16 08:53:17 · 1060 阅读 · 0 评论 -
STL源码分析一:组态
#include using namespace std;template class testClass{ public: static int _data;};int testClass::_data = 1;int testClass::_data = 2;int main(){ cout ::_data << endl; cout ::_data <<原创 2014-04-29 11:02:26 · 1599 阅读 · 0 评论 -
Ants(POJ No.1852) 脑筋急转弯
AntsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 7418 Accepted: 3426DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a原创 2013-12-21 19:24:17 · 1520 阅读 · 0 评论 -
poj 1191 棋盘分割 动态规划
棋盘分割Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11457 Accepted: 4032Description将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后原创 2013-12-19 20:41:47 · 1243 阅读 · 0 评论 -
poj 1321 棋盘问题 递归运算
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19935 Accepted: 9933Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解原创 2013-12-19 22:27:02 · 1294 阅读 · 0 评论 -
北大 ACM 1007 DNA Sorting
DNA SortingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 75079 Accepted: 30074DescriptionOne measure of ``unsortedness'' in a sequence is the number of原创 2013-08-23 10:13:31 · 1520 阅读 · 0 评论 -
北大 ACM 1002 487-3279
487-3279Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 220050 Accepted: 38357DescriptionBusinesses like to have memorable telephone numbers. One way to m原创 2013-08-23 10:35:03 · 1567 阅读 · 0 评论 -
ACM 1001 Exponentiation 高精度幂浮点型的运算
好久没上帖了,现在把昨天一个晚上和今天一上午的努力写出来,大家互相交流下。题目的描述我就直接COPY了:ExponentiationTime Limit: 500MS Memory Limit: 10000KTotal Submissions: 121122 Accepted: 29574Description原创 2013-08-17 11:30:08 · 1545 阅读 · 0 评论 -
北大ACM 1003 Hangover
HangoverTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 91219 Accepted: 44197DescriptionHow far can you make a stack of cards overhang a table? If you h原创 2013-08-18 10:12:50 · 2330 阅读 · 0 评论 -
北大ACM 1006 Biorhythms
BiorhythmsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 103717 Accepted: 32096DescriptionSome people believe that there are three cycles in a person's l原创 2013-08-18 22:56:59 · 1049 阅读 · 0 评论 -
北大ACM 1004 Financial Management
Financial ManagementTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 107802 Accepted: 51472DescriptionLarry graduated this year and finally has a job. He's原创 2013-08-18 09:37:12 · 1714 阅读 · 0 评论 -
北大ACM 1005 I Think I Need a Houseboat
I Think I Need a HouseboatTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 79136 Accepted: 34102DescriptionFred Mapper is considering purchasing some land原创 2013-08-18 09:28:35 · 1329 阅读 · 0 评论 -
acm 1011 Sticks
SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 113105 Accepted: 25961DescriptionGeorge took sticks of the same length and cut them randomly until原创 2013-11-21 22:35:06 · 2195 阅读 · 0 评论 -
算法之旅——快速排序
快速排序算法是基于分治策略的另一个排序算法。其基本思想是,对于输入的子数组,按以下三步进行排序。一:分解二:递归求解三:合并#include #define N 8typedef int Type;using namespace std;void QuickSort(Type a[], int left, int right){ if(left < right)原创 2013-10-13 22:16:39 · 1427 阅读 · 0 评论 -
非比较排序——计数排序
对于包括n 个元素的输入序列来说,任何比较排序在最坏情况下都要经过nlg(n) 次比较,因此归并和堆排序是渐进最优的,并且任何已知的比较排序最多就是在常数因子上优于它们。而对于非比较排序来说,下界nlg(n) 对它们是没用的,在某些情况下排序的复杂度可以达到 n .下面介绍其中的一种非比较排序:计数排序计数排序有一个非常重要的地方就是:假定数据的范围是在某个区间内,如果数据的大小相差非常大原创 2013-11-22 23:26:38 · 1838 阅读 · 0 评论 -
非比较排序——桶排序
相对于计数排序,桶排序和计数排序的差别就在于处理相同数据的差别上。计数排序假设输入数据都属于一个小区间内的整数,而桶排序则是假设输入是由一个随时过程产生的,该过程将元素均匀分布在[0, 1)区间上。在桶排序的过程中有一个非常重要的地方就是,投射的位置 = current_data * number_array / maximum_array_scope , 如果出现多个数投射在相同的原创 2013-11-23 12:55:34 · 1384 阅读 · 0 评论 -
ACM 1014 Dividing 背包问题
DividingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54590 Accepted: 13973DescriptionMarsha and Bill own a collection of marbles. They want to split原创 2013-12-07 15:08:40 · 1577 阅读 · 0 评论 -
poj 1018 Communication System 枚举 VS 贪心
Communication SystemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21631 Accepted: 7689DescriptionWe have received an order from Pizoor Communications原创 2013-12-10 22:20:29 · 1145 阅读 · 0 评论 -
poj 1088 滑雪 动态规划
滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 70183 Accepted: 25897DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等原创 2013-12-15 16:49:07 · 1691 阅读 · 0 评论 -
poj 1125 Stockbroker Grapevine——Floyd-Warshall算法
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24476 Accepted: 13468DescriptionStockbrokers are known to overreact to rumours. You原创 2013-12-15 17:41:06 · 1360 阅读 · 0 评论 -
poj 3050 Hopscotch DFS
HopscotchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1605 Accepted: 1141DescriptionThe cows play the child's game of hopscotch in a non-traditional原创 2013-12-28 19:19:53 · 2178 阅读 · 2 评论 -
projecteuler---->problem=18----Maximum path sum I
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.37 42 4 68 5 9 3That is, 3 + 7 + 4 + 9 = 23.Find th原创 2014-06-04 22:48:16 · 1206 阅读 · 0 评论