acm
AOAPC I: Volume 1.Sorting/Searching
<<算法竞赛入门经典>> UVaoj第二卷排序检索习题: 340-Master-Minds Hints 每一次首先给出一个模板数列, 然后看接下来输入的数列有中的数有多少是跟模板中的元素位置和值都相同, 有多少是和模板中的数列值相同但是位置不相同, 注意一旦有数字先匹配到了位置相同并且值相同的话就不再参与其他匹配了.
AOAPC I: Volume 1.Big Number
<<算法竞赛入门经典>> UVaoj第二卷大数习题: 424-Integer Inquiry 大数模板加法. 10106-Product 大数模板乘法. 465-Overflow 大数模板加法和乘法. 每次输入两个数字, 如果第一个数字超过了整形变量的表示范围(2^32 -1)就输出first number too long, 第二个数字同理, 然后运算的结果如果也超了就输出result too big.
AOAPC I: Volume 0
<<算法竞赛入门经典>> UVaoj 第一卷习题: 10055-Hashmat the Brave Warrior 注意读懂题意, “or vice versa”(反之亦然), 所以注意加一个fabs(a-b), UVaoj第一题就被卡了几次, 简直羞耻Play.
POJ2085
POJ2085 Inversion Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 4004 Accepted: 1790 Description The inversion number of an integer sequence a1, a2, . . . , an is the number of pairs (ai, aj) that satisfy i < j and ai > aj . Given n and the inversion number m, your task is to find the smallest permutation of the set { 1, 2, . . . , n }, whose inversion number is exactly m.
POJ2084
POJ2084 Game of Connections Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 7901 Accepted: 3973 Description This is a small but ancient game. You are supposed to write down the numbers 1, 2, 3, . . . , 2n – 1, 2n consecutively in clockwise order on the ground to form a circle, and then, to draw some straight line segments to connect them into number pairs. Every number must be connected to exactly one another.
POJ1125
POJ1125 Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31827 Accepted: 17443 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the rumours in the fastest possible way.
POJ1062
POJ1062 昂贵的聘礼 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 41914 Accepted: 12245 Description 年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:”嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。”探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他可以降低价格。探险家于是又跑到其他地方,其他人也提出了类似的要求,或者直接用金币换,或者找到其他东西就可以降低价格。不过探险家没必要用多样东西去换一样东西,因为不会得到更低的价格。探险家现在很需要你的帮忙,让他用最少的金币娶到自己的心上人。另外他要告诉你的是,在这个部落里,等级观念十分森严。地位差距超过一定限制的两个人之间不会进行任何形式的直接接触,包括交易。他是一个外来人,所以可以不受这些限制。但是如果他和某个地位较低的人进行了交易,地位较高的的人不会再和他交易,他们认为这样等于是间接接触,反过来也一样。因此你需要在考虑所有的情况以后给他提供一个最好的方案。
POJ3259
POJ3259 Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 37982 Accepted: 13985 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is BEFORE you entered the wormhole! Each of FJ’s farms comprises N (1 ≤ N ≤ 500) fields conveniently numbered 1..N, M (1 ≤ M ≤ 2500) paths, and W (1 ≤ W ≤ 200) wormholes.
POJ1860
POJ1860 Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 23824 Accepted: 8620 Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. There can be several points specializing in the same pair of currencies. Each point has its own exchange rates, exchange rate of A to B is the quantity of B you get for 1A. Also each exchange point has some commission, the sum you have to pay for your exchange operation. Commission is always collected in source currency.