- 博客(15)
- 收藏
- 关注
原创 UVA 118 Mutant Flatworld Explorers
简单的模拟题,但是还是写了很久,写了快一个小时了!不过,一次就AC!还是很值得深夜来写代码的!读题读细了就差不多ok,剩下的工作也就是把代码敲出来了,没有什么难以理解的算法!注意点:如果矩形网格边界某点,有Robot曾经在这个点LOST,之后的Robot如果也在这个点想要LOST,则忽略这个F操作,但是后面的操作还是继续模拟的!题目只是要求不能在同一个位置有两个Robot掉下去!所以可
2014-02-08 00:12:09 545
原创 UVA114 Simulation Wizardry
//题目就不附加了,很累!//努力AC!每天AC!#include#include#include#includeusing namespace std;int x_bound,y_bound;int grid[60][60];int wall_cost;int bumpers_num;int bumpers_value[100][100],bumpers_cost[10
2014-02-04 23:11:48 743
原创 UVA133 The Dole Queue
BackgroundIn a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every day all dole applicants will be plac
2014-02-03 23:55:34 538
原创 UVA120 Stacks of Flapjacks
BackgroundStacks and Queues are often considered the bread and butter of datastructures and find use in architecture, parsing, operating systems, anddiscrete event simulation. Stacks are also impo
2014-02-03 21:54:03 639
原创 [dp专题]一维子序列max sum
题目:Time Limit:1000MS Memory Limit:32768KBDescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7),
2014-02-01 18:33:12 436
原创 积木问题
#include#include#include#includeusing namespace std;struct command{ int number;//command number int op1; int op2;};int blocks[30][30];void move_onto(struct command cmd,int blocksnumber);v
2014-01-25 09:48:45 727
原创 sicily 1027. MJ, Nowhere to Hide
#include#include#includeusing namespace std;struct bbs{ string bbs_id; string id_add; string Majia; int index;};void selectsort(struct bbs test[100],int num);bool issmaller(stri
2014-01-24 11:22:44 662
原创 sicily1007. To and Fro
sicily1007.To and Fro就是将输入的字符串进行解码。译码方式为:原字符串为:toioynnkpheleaigshareconhtomesnlewx译成:toioyhpknneleairahsgeconhsemotnlewx(是竖着看的,x是补上去的!)所以问题就看成了把字符串按照一定的格式转换成二维矩阵!
2014-01-23 20:22:24 832
原创 几个普通的排序算法
1.插入排序:原理援引百度百科:百度百科_插入排序算法代码:void insert_sort(int *data,int length){coutdata(data,length); int sort_index=1; int temp; for(;sort_index<length;sort_index++) { if(data[sort_index]<data[so
2014-01-10 08:58:21 617
原创 sicily 1509. Rails
注意输出格式就好!水题!经典的模拟栈,出栈,入栈!#include #include using namespace std;int main(){ int num; int coach[1000]; while(cin >> num && num != 0) { while(cin >> coach[0] && coach[0] != 0) { stack train
2014-01-01 19:00:50 482
原创 sicily 1093. Air Express
水题,被格式坑了两次!#includeusing namespace std;int main(){ int w1,rate1,w2,rate2,w3,rate3,rate4; int cost; int best2,best3,best4; int i=1; while(cin >> w1) { int w; cin >> rate1;
2014-01-01 18:37:42 541
原创 sicily 1134
#include #include #include using namespace std;struct child{ int hand; int need; bool operator<(const child & one)const { if(need < one.need) return true;
2013-12-29 20:10:05 429
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人