
Ohters
ultimater
桃李争辉飒爽英姿斗艳,成功失败总是欢乐伤悲!
展开
-
2.13 -实现Locate(L,x)返回x在链表中的位置
typedef struct node{ int data; struct node*next;}Linklist;typedef struct{ int elem[max]; int length;}Seqlist;int Locate(Linklist &L,int x){ int count=0; Linklist*p=&L; while(p) { if(p原创 2012-05-05 18:36:43 · 1918 阅读 · 0 评论 -
2.26-用链表表示2.25的算法;
typedef struct node{ int data; struct node *next;}Linklist;Linklist* same(Linklist&A,Linklist&B){ Linklist*pa=A.next,*pb=B.next; Linklist*pc=(Linklist*)malloc(sizeof(Linklist));原创 2012-05-06 20:36:14 · 1114 阅读 · 0 评论 -
2012.6辽宁省赛 Problem F
自己模拟了,没有交过,不知道是否正确。#include#include#include#define max 10using namespace std;int main(){ queueplayer1; queueplayer2; stacktable; bool ontable[max]; int n,m,times,i,data,tem原创 2012-06-05 21:42:52 · 1710 阅读 · 0 评论 -
编程进阶
ACM队不是为了一场比赛而存在的,为的是队员的整体提高。大学期间,ACM队队员必须要学好的课程有:l C/C++两种语言l 高等数学l 线性代数l 数据结构l 离散数学l 数据库原理l 操作系统原理l 计算机组成原理l 人工智能l 编译原理l 算法设计与分析除此之外,我希望你们能转载 2012-07-20 12:43:11 · 1760 阅读 · 3 评论 -
程序员技术练级攻略
月光博客6月12日发表了《写给新手程序员的一封信》,翻译自《An open letter to those who want to start programming》,我的朋友(他在本站的id是Mailper)告诉我,他希望在酷壳上看到一篇更具操作性的文章。因为他也是喜欢编程和技术的家伙,于是,我让他把他的一些学习Python和Web编程的一些点滴总结一下。于是他给我发来了一些他的心得和经历转载 2012-07-24 23:18:54 · 1832 阅读 · 3 评论 -
HDU 1166 敌兵布阵
DescriptionLily 特别喜欢养花,但是由于她的花特别多,所以照料这些花就变得不太容易。她把她的花依次排成一行,每盆花都有一个美观值。如果Lily把某盆花照料的好的话,这盆花的美观值就会上升,如果照料的不好的话,这盆花的美观值就会下降。有时,Lily想知道某段连续的花的美观值之和是多少,但是,Lily的算术不是很好,你能快速地告诉她结果吗?Input原创 2012-08-14 16:11:59 · 571 阅读 · 0 评论 -
vijos p1024 卡布列克圆舞曲
描述 Description 卡布列克是一位数学家,他在研究数字时发现:任意一个不是用完全相同数字组成的四位数,如果对它们的每位数字重新排序,组成一个较大的数和一个较小的数,然后用较大数减去较小数,差不够四位数时补零,类推下去,最后将变成一个固定的数:6174,这就是卡布列克常数。 例如:4321-1234=3087 8730-378=8352原创 2012-10-29 20:16:02 · 2349 阅读 · 0 评论 -
POJ 2255 Tree Recovery
DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes. This is an example of o原创 2012-10-31 17:25:46 · 1157 阅读 · 1 评论 -
HDU-1008 Elevator
Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified原创 2013-06-28 10:35:18 · 1258 阅读 · 0 评论 -
2.24-将单增序列A,B按单减合并(有问题)
#include#includetypedef struct node{ int data; struct node *next;}Linklist;Linklist *create(){ int i; Linklist *head=(Linklist*)malloc(sizeof(Linklist)); Linklist原创 2012-05-06 19:25:56 · 1661 阅读 · 0 评论 -
2.25-将顺序表A,B的交集用C存储
#define max 10typedef struct{ int elem[max]; int length;}Seqlist;void Same(Seqlist&A,Seqlist&B,Seqlist&C){ int i,j,k=0,lena=A.length,lenb=B.length; for(i=0;i<lena;i++) {原创 2012-05-06 20:01:52 · 1791 阅读 · 0 评论 -
2.23-将A,B链表合并成C
typedef struct node{ int data; struct node*next;}Linklist;Linklist* Merge(Linklist &A,Linklist &B){ Linklist*pa=A.next,*pb=B.next,*temp; while(pb) { if(pa->next==NU原创 2012-05-06 09:17:55 · 1062 阅读 · 0 评论 -
2.15--连接链表ha和hb,用hc接收;
typedef struct node{ int data; struct node*next;}Linklist;Linklist* connect(Linklist&ha,Linklist&hb){ Linklist*p=&ha; while(p->next)p=p->next; p->next=hb.next; return &ha;}原创 2012-05-05 19:14:33 · 826 阅读 · 0 评论 -
2.14-实现Length(L)返回链表L的长度
typedef struct{ int elem[max]; int length;}Seqlist;int Length(Linklist &L){ int count=0; Linklist*p=L.next; while(p){count++;p=p->next;}; return count;}原创 2012-05-05 18:58:48 · 1861 阅读 · 0 评论 -
2.11-在顺序表va中插入x使仍然有序
typedef struct{ int elem[max]; int length;}Seqlist;void insert(Seqlist &va,int x){ int flag,i,j; if(va.elem[va.length-1]-va.elem[0]>=0)flag=1; else flag=-1; for(i=0;i<va.length;i++) { if(原创 2012-05-05 18:22:59 · 970 阅读 · 0 评论 -
2.16-从la中删除从i开始len个元素后,把删除的元素放到lb中的j位之前
Status DeleteAndInsertSub(LinkedList la,LinkedList lb,int i,int j,int len){ if(i<0||j<0||len<0)return INFEASIBLE; p=la;k=1; while(knext;k++;} q=p; while(knext;k++;} s=lb;k=1; while(knext;k++}原创 2012-05-05 20:00:05 · 1028 阅读 · 0 评论 -
2.17-比较有头节点的单链表与无头节点插入元素的区别;
无头节点的链表插入元素而要判断当前节点是否为头节点。原创 2012-05-05 20:05:27 · 2034 阅读 · 0 评论 -
2.27-在2.27的基础上使C中没有相同元素
typedef struct node{ int data; struct node *next;}Linklist;Linklist* same(Linklist&A,Linklist&B){ int temp; Linklist*pa=A.next,*pb=B.next; Linklist*pc=(Linklist*)malloc(sizeof(L原创 2012-05-06 20:43:55 · 1081 阅读 · 0 评论 -
2.19-删除链表中大于mink且小于maxk的值;
typedef struct node{ int data; struct node*next;}Linklist;void Delete(Linklist &L,int mink,int maxk){ Linklist*p=&L,*q=NULL; while(p->next) { q=p; while(p->next->data原创 2012-05-05 22:52:07 · 4602 阅读 · 1 评论 -
2.22-单链表就地逆转
typedef struct node{ int data; struct node*next;}Linklist;void Reverse(Linklist&L){ Linklist *q=L.next,*p=L.next->next,*temp; q->next=NULL; while(p) { temp=p; p=p原创 2012-05-05 23:45:15 · 895 阅读 · 0 评论 -
2.21-顺序表就地逆转
#define max 100typedef struct{ int elem[max]; int length;}Seqlist;void Reverse(Seqlist &S){ int ave=S.length>>1,temp,i; for(i=0;i<ave;i++) { temp=S.length-1-i; S.elem[i]^=S.e原创 2012-05-06 08:28:31 · 1786 阅读 · 0 评论 -
HDU-4557 非诚勿扰
Problem Description 作为2013年699万应届毕业生中的一员,由于宏观经济的不景气,小明在毕业当天就华丽丽地失业了! 经历了千难万苦的求职过程,小明特别能理解毕业生的就业之难,所以,他现在准备创建一家专门针对IT人才的求职中介公司——非诚勿扰人力资源开发有限公司。 基于工作的需要,小明根据求职学生的简历描述为每人评定了一个综合能力值,能力值是一个小于等于20的原创 2013-06-28 12:32:34 · 2244 阅读 · 0 评论