代码改变世界

随笔分类 -  ACM_hash和二分

poj 2318 TOYS —–叉积+二分

2012-08-16 00:26 by java环境变量, 293 阅读, 收藏,
摘要: 转自Scar的个人网站 heroscar.comTOYSTime Limit:2000MSMemory Limit:65536KTotal Submissions:7587Accepted:3598DescriptionCalculate the number of toys that land in each bin of a partitioned toy box.Mom and dad have a problem – their child John never puts his toys away when he is finished playing with them. They 阅读全文

poj 2002 Squares ----二分

2012-03-22 12:33 by java环境变量, 232 阅读, 收藏,
摘要: SquaresTime Limit:3500MSMemory Limit:65536KTotal Submissions:11185Accepted:4068DescriptionA square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the same polygon. It is not the 阅读全文

poj 2503 Babelfish ----二分

2012-03-21 20:37 by java环境变量, 298 阅读, 收藏,
摘要: BabelfishTime Limit:3000MSMemory Limit:65536KTotal Submissions:22730Accepted:9756DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of 阅读全文

poj 3273 Monthly Expense ----二分

2012-03-19 21:15 by java环境变量, 236 阅读, 收藏,
摘要: Monthly ExpenseTime Limit:2000MSMemory Limit:65536KTotal Submissions:7872Accepted:3241DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that he wil 阅读全文

poj 1905 Expanding Rods---二分

2012-03-15 20:59 by java环境变量, 273 阅读, 收藏,
摘要: Expanding RodsTime Limit:1000MSMemory Limit:30000KTotal Submissions:7775Accepted:1876DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid walls and then heated, it 阅读全文

poj 3349 Snowflake Snow Snowflakes -----hash (vector)

2012-03-15 14:58 by java环境变量, 264 阅读, 收藏,
摘要: Snowflake Snow SnowflakesTime Limit:4000MSMemory Limit:65536KTotal Submissions:20853Accepted:5449DescriptionYou may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a collection of snowflak 阅读全文

poj 3122 Pie--- 二分

2012-03-13 17:21 by java环境变量, 210 阅读, 收藏,
摘要: PieTime Limit:1000MSMemory Limit:65536KTotal Submissions:6264Accepted:2353Special JudgeDescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each o 阅读全文

poj 1840 Eqs hash表 (vector)

2012-03-13 14:57 by java环境变量, 232 阅读, 收藏,
摘要: EqsTime Limit:5000MSMemory Limit:65536KTotal Submissions:7593Accepted:3711DescriptionConsider equations having the following form:a1x13+ a2x23+ a3x33+ a4x43+ a5x53=0The coefficients are given integers from the interval [-50,50].It is consider a solution a system (x1, x2, x3, x4, x5) that verifies th 阅读全文

hdu 1425 sort ---- hash入门

2012-03-11 17:56 by java环境变量, 221 阅读, 收藏,
摘要: sortTime Limit: 6000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14896Accepted Submission(s): 4274Problem Description给你n个整数,请按从大到小的顺序输出其中前m大的数。Input每组测试数据有两行,第一行有两个数n,m(0<n,m<1000000),第二行包含n个各不相同,且都处于区间[-500000,500000]的整数。Output对每组测试数据按从大到小的顺序输出前m大的数。Samp 阅读全文