上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1272 小希的迷宫 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota... 阅读全文
posted @ 2015-08-10 20:26 编程菌 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1239 【题目大意】 输入三个数,m,a,b 让你求出一对素数 p ,q ,且满足 p x q #include using namespace std;const int maxn= 100000 ... 阅读全文
posted @ 2015-08-09 18:40 编程菌 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 队列 简单的实现了push pop empty size; 和堆栈的链式实现一样,因为删除操作后需要执向下一个元素,所以队列的删除操作 pop 要在链表的头部实现 因为队列是 First In First Out,所以插入操作 push 要在链表尾插入。 【测试代码】 #include... 阅读全文
posted @ 2015-08-09 16:57 编程菌 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 堆栈 【链表实现堆栈】 优点:可以无限增添元素,只要内存足够, 缺点:内存中存储位置不连续 typedef int ElementType;//只能向头部插入元素,因为如果在尾部插入,删除时,找不到上一个节点///因为链表是单向的//所以 push pop 操作在头结点进行class Stac... 阅读全文
posted @ 2015-08-08 17:08 编程菌 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 链表的实现(简易版) 首先是结构体 typedef int ElementType; //为了便于修改链表中元素的类型typedef struct Node{ ElementType Date; struct Node* Next;}List;List L,*Ptrl; 求链表长度的... 阅读全文
posted @ 2015-08-08 13:28 编程菌 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 【gcd】 int gcd(int n,int m){ if(n%m==0) return m; else return gcd(m,n%m);} 【快速幂】 typedef long long ll;ll pow_mod(ll x,ll n ,ll mod ){ ll res=... 阅读全文
posted @ 2015-08-08 08:14 编程菌 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.patest.cn/contests/mooc-ds 【打印沙漏】 #include #include #include using namespace std;int num[1000];int main(){ num[1]=1; int sum=0; int... 阅读全文
posted @ 2015-08-07 22:01 编程菌 阅读(451) 评论(0) 推荐(0) 编辑
摘要: typedef int ElemType; C版本 【递归版本】 int binSearch2(ElemType List[] ,int x,int head,int tail){ //递归版本 while(headx){ return binSearch2(List,x,hea... 阅读全文
posted @ 2015-08-07 11:42 编程菌 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1238 Substrings Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)... 阅读全文
posted @ 2015-08-07 10:36 编程菌 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1885 Key Task Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ... 阅读全文
posted @ 2015-08-07 09:26 编程菌 阅读(136) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页