- 博客(68)
- 收藏
- 关注
原创 有序表查找
/*顺序查找*/ int sequence_search(int *a, int num, int x) { int i; for(i = 0; i < num && a[i] != x; i++); if(i < n) return i; else return -1; } /*二分查找*/ int two_point_search(int *a, int nu
2015-10-23 17:09:07 350
原创 内部排序
/*插入排序*/ /*直接插入: 稳定 O(n^2)*/ void insertion_sort(int *a, int num) { int tmp; for(int i = 1; i < num; i++) { tmp = a[i]; int j; for(j = i - 1; j >= 0 && tmp < a[j];
2015-10-23 15:54:36 318
转载 POJ 3660 Cow Contest
Cow Contest Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6213 Accepted: 3360 Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are partici
2013-08-17 11:38:42 452
转载 HDU 4198 Quick out of the Harbour(优先队列)
题意: 给出h*w的图 图中'@'表示桥 给出通过桥的时间k 求最短离开的时间 代码: #include #include #include #define MAX 502 using namespace std; struct node { int x,y,time; friend bool operator < (node a,node b) //时间
2013-08-16 19:08:19 471
转载 HDU 2579 Dating with girls(2)
题意: 给出r*c的图 以及时间k 图中'.'代表通路 '#'代表障碍物 当时间为k的倍数时 障碍物消失 问从起始点到终点的最短时间 代码: #include #include #include #define MAX 102 using namespace std; struct node { int x,y,time; }; queue q; c
2013-08-16 18:12:40 438
转载 HDU 4308 Saving Princess claire_
http://acm.hdu.edu.cn/showproblem.php?pid=4308 题意: 给出一个r*c的图以及走一步所需的花费 'Y'表示起始点 'C'表示重点 '*'表示可以达到的点 '#'表示不能达到的点 'P'表示可瞬间转换的点,及若从一个'P'点进入,可由下一个'P'点开始搜索 求到达'C'点的最小花费 ('P'点间转化不需要花费) 代码: #i
2013-08-16 15:26:56 453
转载 POJ 2402 Palindrome Numbers
Palindrome Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3568 Accepted: 1333 Description A palindrome is a word, number, or phrase that reads the s
2013-08-16 13:46:32 515
转载 POJ 1703 Find them, Catch them
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 25909 Accepted: 7832 Description The police office in Tadu City decides to say ends to
2013-08-16 10:03:22 373
转载 POJ 2230 Watchcow
Watchcow Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 5362 Accepted: 2256 Special Judge Description Bessie's been appointed the new watch-cow for the
2013-08-13 09:19:52 351
转载 POJ 1386 Play on Words
Play on Words Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8494 Accepted: 2964 Description Some of the secret doors contain a very interesting word puzzle
2013-08-05 21:41:13 418
转载 HDU 3018 Ant Trip
Ant Trip Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Description Ant Country consist of N towns.There are M roads connecting the towns.
2013-08-05 17:04:38 416
转载 POJ 2594 Treasure Exploration
Treasure Exploration Time Limit: 6000MS Memory Limit: 65536K Total Submissions: 6059 Accepted: 2425 Description Have you ever read any book about treasure exploration?
2013-08-05 11:25:23 426
转载 POJ 1422 Air Raid
Air Raid Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6018 Accepted: 3600 Description Consider a town where all the streets are one-way and each street le
2013-08-05 11:18:29 516
转载 POJ 2446 Chessboard
Chessboard Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 11700 Accepted: 3653 Description Alice and Bob often play games on chessboard. One day, Alice draw
2013-08-05 11:10:16 546
转载 POJ 1469 COURSES
COURSES Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15404 Accepted: 6085 Description Consider a group of N students and P courses. Each student visits ze
2013-08-05 11:03:54 386
转载 POJ 1325 Machine Schedule
Machine Schedule Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10428 Accepted: 4414 Description As we all know, machine scheduling is a very classical prob
2013-08-05 10:58:36 339
转载 POJ 1659 Frogs' Neighborhood
Frogs' Neighborhood Time Limit: 5000MS Memory Limit: 10000K Total Submissions: 6038 Accepted: 2614 Special Judge Description 未名湖附近共有N个大小湖泊L1, L2, ..., Ln(其中包括未名
2013-08-03 10:49:44 430
转载 HDU 2063 过山车
过山车 Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u [Submit] [Go Back] [Status] Description RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过
2013-08-03 10:37:36 416
转载 POJ 1847 Tram
Tram Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 8688 Accepted: 3155 Description Tram network in Zagreb consists of a number of intersections and rails c
2013-08-02 23:21:07 429
转载 HDU 1520 Anniversary party (树状dp)
Anniversary party Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u [Submit] [Go Back] [Status] Description There is going to be a party
2013-08-02 23:00:37 436
转载 POJ 1200 Crazy Search
Crazy Search Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20543 Accepted: 5808 Description Many people like to solve hard puzzles some of which may lead t
2013-08-01 23:55:28 350
转载 POJ 1002 487-3279
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 218505 Accepted: 38089 Description Businesses like to have memorable telephone numbers. One way to m
2013-08-01 11:51:01 336
转载 POJ 1035 Spell checker
Spell checker Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 16641 Accepted: 6068 Description You, as a member of a development team for a new spell checkin
2013-07-31 23:59:37 398
转载 POJ 2503 Babelfish
Babelfish Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 28103 Accepted: 12128 Description You have just moved from Waterloo to a big city. The people here
2013-07-31 22:36:50 577
转载 POJ 2352 Stars
Stars Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26650 Accepted: 11626 Description Astronomers often examine star maps where stars are represented by po
2013-07-31 19:23:39 391
转载 HDU 1166 敌兵布阵
敌兵布阵 Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy
2013-07-31 11:20:02 344
转载 POJ 3006 Dirichlet's Theorem on Arithmetic Progressions
Dirichlet's Theorem on Arithmetic Progressions Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 13842 Accepted: 6925 Description If a and d are relatively p
2013-07-30 12:30:30 400
转载 POJ 1503 Integer Inquiry
Integer Inquiry Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 27255 Accepted: 10541 Description One of the first users of BIT's new supercomputer was Chip
2013-07-30 12:07:38 369
转载 POJ 1083 Moving Tables
Moving Tables Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23620 Accepted: 7820 Description The famous ACM (Advanced Computer Maker) Company has rented a
2013-07-30 10:52:21 421
转载 POJ 2653 Pick-up sticks
Pick-up sticks Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 8012 Accepted: 2946 Description Stan has n sticks of various length. He throws them one at a t
2013-07-30 10:15:03 409
转载 POJ 3278 Catch That Cow
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 37605 Accepted: 11656 Description Farmer John has been informed of the location of a fugitiv
2013-07-29 13:46:54 306
转载 HDU 1392 Surround the Trees
题目大意: 求散点集凸包外围总长度,结果保留两位小数 代码: #include #include #include #define MAX 102 #define eps 1e-6 typedef struct point { int x,y; }point; point p[MAX],stack[MAX]; bool isZero(double x
2013-07-29 12:30:55 336
转载 POJ 2187 Beauty Contest
Beauty Contest Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 24305 Accepted: 7428 Description Bessie, Farmer John's prize cow, has just won first place in
2013-07-29 11:14:52 428
转载 POJ 1113 Wall
Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 26246 Accepted: 8745 Description Once upon a time there was a greedy King who ordered his chief Architec
2013-07-28 23:01:56 336
转载 POJ 2524 Ubiquitous Religions
Ubiquitous Religions Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 20230 Accepted: 9930 Description There are so many different religions in the world toda
2013-07-27 15:49:01 316
转载 POJ 1308 Is It A Tree?
Is It A Tree? Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18569 Accepted: 6342 Description A tree is a well-known data structure that is either empty (nu
2013-07-27 15:06:03 353
转载 POJ 1861 Network
Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 11950 Accepted: 4591 Special Judge Description Andrew is working as system administrator and is p
2013-07-27 10:45:29 340
转载 POJ 3663 Costume Party
Costume Party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10155 Accepted: 4032 Description It's Halloween! Farmer John is taking the cows to a costum
2013-07-26 18:00:45 394
转载 POJ 2485 Highways(同POJ 2421 Constructing Roads)
Highways Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18607 Accepted: 8627 Description The island nation of Flatopia is perfectly flat. Unfortunately, Fla
2013-07-26 16:37:26 406
转载 POJ 1789 Truck History
Truck History Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14877 Accepted: 5689 Description Advanced Cargo Movement, Ltd. uses trucks of different types.
2013-07-26 00:48:50 291
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人