- 博客(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
383
原创 内部排序
/*插入排序*//*直接插入: 稳定 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
354
转载 POJ 3660 Cow Contest
Cow ContestTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6213 Accepted: 3360DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are partici
2013-08-17 11:38:42
475
转载 HDU 4198 Quick out of the Harbour(优先队列)
题意:给出h*w的图 图中'@'表示桥 给出通过桥的时间k求最短离开的时间 代码: #include#include#include#define MAX 502using namespace std;struct node{ int x,y,time; friend bool operator < (node a,node b) //时间
2013-08-16 19:08:19
502
转载 HDU 2579 Dating with girls(2)
题意:给出r*c的图 以及时间k图中'.'代表通路 '#'代表障碍物当时间为k的倍数时 障碍物消失问从起始点到终点的最短时间 代码:#include#include#include#define MAX 102using namespace std;struct node{ int x,y,time;};queue q;c
2013-08-16 18:12:40
464
转载 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
472
转载 POJ 2402 Palindrome Numbers
Palindrome NumbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3568 Accepted: 1333DescriptionA palindrome is a word, number, or phrase that reads the s
2013-08-16 13:46:32
545
转载 POJ 1703 Find them, Catch them
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 25909 Accepted: 7832DescriptionThe police office in Tadu City decides to say ends to
2013-08-16 10:03:22
399
转载 POJ 2230 Watchcow
WatchcowTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 5362 Accepted: 2256 Special JudgeDescriptionBessie's been appointed the new watch-cow for the
2013-08-13 09:19:52
374
转载 POJ 1386 Play on Words
Play on WordsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8494 Accepted: 2964DescriptionSome of the secret doors contain a very interesting word puzzle
2013-08-05 21:41:13
442
转载 HDU 3018 Ant Trip
Ant TripTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uDescriptionAnt Country consist of N towns.There are M roads connecting the towns.
2013-08-05 17:04:38
434
转载 POJ 2594 Treasure Exploration
Treasure ExplorationTime Limit: 6000MS Memory Limit: 65536KTotal Submissions: 6059 Accepted: 2425DescriptionHave you ever read any book about treasure exploration?
2013-08-05 11:25:23
448
转载 POJ 1422 Air Raid
Air RaidTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6018 Accepted: 3600DescriptionConsider a town where all the streets are one-way and each street le
2013-08-05 11:18:29
541
转载 POJ 2446 Chessboard
ChessboardTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 11700 Accepted: 3653DescriptionAlice and Bob often play games on chessboard. One day, Alice draw
2013-08-05 11:10:16
574
转载 POJ 1469 COURSES
COURSESTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15404 Accepted: 6085DescriptionConsider a group of N students and P courses. Each student visits ze
2013-08-05 11:03:54
399
转载 POJ 1325 Machine Schedule
Machine ScheduleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10428 Accepted: 4414DescriptionAs we all know, machine scheduling is a very classical prob
2013-08-05 10:58:36
356
转载 POJ 1659 Frogs' Neighborhood
Frogs' NeighborhoodTime Limit: 5000MS Memory Limit: 10000KTotal Submissions: 6038 Accepted: 2614 Special JudgeDescription未名湖附近共有N个大小湖泊L1, L2, ..., Ln(其中包括未名
2013-08-03 10:49:44
448
转载 HDU 2063 过山车
过山车Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u[Submit] [Go Back] [Status] DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过
2013-08-03 10:37:36
438
转载 POJ 1847 Tram
TramTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8688 Accepted: 3155DescriptionTram network in Zagreb consists of a number of intersections and rails c
2013-08-02 23:21:07
454
转载 HDU 1520 Anniversary party (树状dp)
Anniversary partyTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u[Submit] [Go Back] [Status] DescriptionThere is going to be a party
2013-08-02 23:00:37
452
转载 POJ 1200 Crazy Search
Crazy SearchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20543 Accepted: 5808DescriptionMany people like to solve hard puzzles some of which may lead t
2013-08-01 23:55:28
367
转载 POJ 1002 487-3279
487-3279Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 218505 Accepted: 38089DescriptionBusinesses like to have memorable telephone numbers. One way to m
2013-08-01 11:51:01
353
转载 POJ 1035 Spell checker
Spell checkerTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 16641 Accepted: 6068DescriptionYou, as a member of a development team for a new spell checkin
2013-07-31 23:59:37
415
转载 POJ 2503 Babelfish
BabelfishTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 28103 Accepted: 12128DescriptionYou have just moved from Waterloo to a big city. The people here
2013-07-31 22:36:50
612
转载 POJ 2352 Stars
StarsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26650 Accepted: 11626DescriptionAstronomers often examine star maps where stars are represented by po
2013-07-31 19:23:39
403
转载 HDU 1166 敌兵布阵
敌兵布阵Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uDescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy
2013-07-31 11:20:02
358
转载 POJ 3006 Dirichlet's Theorem on Arithmetic Progressions
Dirichlet's Theorem on Arithmetic ProgressionsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13842 Accepted: 6925DescriptionIf a and d are relatively p
2013-07-30 12:30:30
422
转载 POJ 1503 Integer Inquiry
Integer InquiryTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27255 Accepted: 10541DescriptionOne of the first users of BIT's new supercomputer was Chip
2013-07-30 12:07:38
381
转载 POJ 1083 Moving Tables
Moving TablesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23620 Accepted: 7820DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a
2013-07-30 10:52:21
443
转载 POJ 2653 Pick-up sticks
Pick-up sticksTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 8012 Accepted: 2946DescriptionStan has n sticks of various length. He throws them one at a t
2013-07-30 10:15:03
421
转载 POJ 3278 Catch That Cow
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 37605 Accepted: 11656DescriptionFarmer John has been informed of the location of a fugitiv
2013-07-29 13:46:54
329
转载 HDU 1392 Surround the Trees
题目大意:求散点集凸包外围总长度,结果保留两位小数 代码:#include#include#include#define MAX 102#define eps 1e-6typedef struct point { int x,y;}point;point p[MAX],stack[MAX];bool isZero(double x
2013-07-29 12:30:55
351
转载 POJ 2187 Beauty Contest
Beauty ContestTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 24305 Accepted: 7428DescriptionBessie, Farmer John's prize cow, has just won first place in
2013-07-29 11:14:52
446
转载 POJ 1113 Wall
WallTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 26246 Accepted: 8745DescriptionOnce upon a time there was a greedy King who ordered his chief Architec
2013-07-28 23:01:56
350
转载 POJ 2524 Ubiquitous Religions
Ubiquitous ReligionsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 20230 Accepted: 9930DescriptionThere are so many different religions in the world toda
2013-07-27 15:49:01
333
转载 POJ 1308 Is It A Tree?
Is It A Tree?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18569 Accepted: 6342DescriptionA tree is a well-known data structure that is either empty (nu
2013-07-27 15:06:03
378
转载 POJ 1861 Network
NetworkTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11950 Accepted: 4591 Special JudgeDescriptionAndrew is working as system administrator and is p
2013-07-27 10:45:29
359
转载 POJ 3663 Costume Party
Costume PartyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10155 Accepted: 4032DescriptionIt's Halloween! Farmer John is taking the cows to a costum
2013-07-26 18:00:45
408
转载 POJ 2485 Highways(同POJ 2421 Constructing Roads)
HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 18607 Accepted: 8627DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Fla
2013-07-26 16:37:26
419
转载 POJ 1789 Truck History
Truck HistoryTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14877 Accepted: 5689DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types.
2013-07-26 00:48:50
307
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人