2011年7月28日

关于qsort的完整版

摘要: 六种qsort排序方法<本文中排序都是采用的从小到大排序>一、对int类型数组排序int num[100];Sample:int cmp ( const void *a , const void *b ){ return *(int *)a - *(int *)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类型)char word[100];Sample:int cmp( const void *a , const void *b ){ return *(char *)a - *(char *)b;}qsort(wor 阅读全文

posted @ 2011-07-28 21:10 kuangbin 阅读(384) 评论(0) 推荐(0)

ACM HDU 1040 As Easy As A+B

摘要: As Easy As A+BTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15920Accepted Submission(s): 6448Problem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of cou 阅读全文

posted @ 2011-07-28 20:37 kuangbin 阅读(1485) 评论(0) 推荐(0)

ACM HDU 1016 Prime Ring Problem

摘要: Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8651Accepted Submission(s): 3877Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of num 阅读全文

posted @ 2011-07-28 20:20 kuangbin 阅读(692) 评论(0) 推荐(0)

ACM HDU 1017 A Mathematical Curiosity

摘要: A Mathematical CuriosityTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10942Accepted Submission(s): 3371Problem DescriptionGiven two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(a 阅读全文

posted @ 2011-07-28 18:08 kuangbin 阅读(493) 评论(0) 推荐(0)

ACM HDU 3668Volume

摘要: VolumeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 531Accepted Submission(s): 159Problem DescriptionThis time your job is to calculate the volume of a special object. The object consists of two orthogonal cylinders. The two cylinders intersect e 阅读全文

posted @ 2011-07-28 17:43 kuangbin 阅读(359) 评论(0) 推荐(0)

ACM HDU 3665Seaside

摘要: SeasideTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 396Accepted Submission(s): 272Problem DescriptionXiaoY is living in a big city, there are N towns in it and some towns near the sea. All these towns are numbered from 0 to N-1 and XiaoY lives i 阅读全文

posted @ 2011-07-28 16:35 kuangbin 阅读(356) 评论(0) 推荐(0)

ACM HDU 3664 Permutation Counting

摘要: Permutation CountingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 493Accepted Submission(s): 258Problem DescriptionGiven a permutation a1, a2, … aN of {1, 2, …, N}, we define its E-value as the amount of elements where ai > i. For example, the 阅读全文

posted @ 2011-07-28 16:09 kuangbin 阅读(1095) 评论(0) 推荐(0)

ACM HDU 3661 Assignments

摘要: AssignmentsTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 645Accepted Submission(s): 300Problem DescriptionIn a factory, there are N workers to finish two types of tasks (A and B). Each type has N tasks. Each task of type A needs xi time to finish 阅读全文

posted @ 2011-07-28 13:22 kuangbin 阅读(723) 评论(0) 推荐(0)

导航

JAVASCRIPT: