2017年9月19日

hdu 1698

摘要: 一个语句顺序错了,我弄了2个小时才找到(细心才是王道)这个题是线段树区间更新,区间查询#include#include#define maxn 100000*4+10using namespace std;struct node{ int l; int r; int value; ... 阅读全文

posted @ 2017-09-19 23:09 横济沧海 阅读(81) 评论(0) 推荐(0) 编辑

临时2

摘要: B题import java.io.*;import java.util.*;public class Main { static int day1[]={31,29,31,30,31,30,31,31,30,31,30,31}; static int day2[]={31,28,31,30,31,... 阅读全文

posted @ 2017-09-19 23:09 横济沧海 阅读(69) 评论(0) 推荐(0) 编辑

实现带有头结点的链表

摘要: 首次写博客,请大神不要吐槽 要实现带头结点的链表,重要的是先搞清楚头结点是什么。链表里有几个名词,头指针,头结点,首结点,概念要明白,会区别,弄懂了这一步,链表的开始就没问题了。头指针即是头结点的地址,头结点数据域为空(当然你也可以用头结点的数据域来保存链表结点的个数),指针域的指针指向... 阅读全文

posted @ 2017-09-19 23:09 横济沧海 阅读(593) 评论(0) 推荐(0) 编辑

排序代码测试(未完成)

摘要: #include#includeusing namespace std;void swap(int &a,int &b){ int tmp=a; a=b; b=a;}void Selectsort(int a[],int n){ int i,j; for(i=0; ia... 阅读全文

posted @ 2017-09-19 23:09 横济沧海 阅读(117) 评论(0) 推荐(0) 编辑

数据结构之链式线性表

摘要: 带头结点的#include#include#include#include#include#includeusing namespace std;#define OK 1#define ERROR 0typedef int status;typedef struct LNODE{ int da... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(165) 评论(0) 推荐(0) 编辑

HDU 1010 dfs+奇偶剪枝

摘要: dfs+剪枝Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 129536 Accepted Su... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(89) 评论(0) 推荐(0) 编辑

数据结构之顺序线性表

摘要: 九层之台起于垒土,千里之行始于足下!数据结构 顺序线性表这个要注意的地方就是线性表中元素编号是从1开始的,但实际储存时却是用相当于数组的方式储存的,元素从0开始储存故可以边画图边理解,下图标上“(reason)”的地方均是这个原因#include#include#include#include#i... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(77) 评论(0) 推荐(0) 编辑

POJ 1753 dfs+枚举

摘要: Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46805 Accepted: 20034DescriptionFlip game is played on a rectangular 4x4 field with... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(191) 评论(1) 推荐(0) 编辑

HDU 4277 dfs+set去重

摘要: USACO ORZTime Limit: 5000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5547 Accepted Submission(s): 1840P... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(82) 评论(0) 推荐(0) 编辑

平衡二叉树

摘要: 平衡二叉树这里停留了很久,费了很大功夫才弄懂。做个笔记比较好。参考以下两位大佬的博客写的:1: http://www.cnblogs.com/fornever/archive/2011/11/15/2249492.html2: http://blog.csdn.net/followmyinc... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(111) 评论(0) 推荐(0) 编辑

导航