2018年10月16日
摘要: 小Q的父母要出差N天,走之前给小Q留下了M块巧克力。小Q决定每天吃的巧克力数量不少于前一天吃的一半,但是他又不想在父母回来之前的某一天没有巧克力吃,请问他第一天最多能吃多少块巧克力 输入描述: 每个输入包含一个测试用例。 每个测试用例的第一行包含两个正整数,表示父母出差的天数N(N<=50000)和 阅读全文
posted @ 2018-10-16 21:54 Rakint 阅读(220) 评论(1) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;typedef struct TreeNode *SearchTree;typedef struct TreeNode *Position;struct TreeNode{ int Element; SearchTree 阅读全文
posted @ 2018-10-16 10:25 Rakint 阅读(116) 评论(0) 推荐(0) 编辑
  2018年10月15日
摘要: #include<iostream>using namespace std; struct ListNode;typedef struct ListNode *Position;struct Hash_table;typedef Hash_table *Hashtab;typedef Positio 阅读全文
posted @ 2018-10-15 23:26 Rakint 阅读(515) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<vector>#include<algorithm>#include<string>using namespace std;int main(){ string word; while (cin >> word) { int word_lenth 阅读全文
posted @ 2018-10-15 13:46 Rakint 阅读(987) 评论(0) 推荐(0) 编辑
摘要: 明明想在学校中请一些同学一起做一项问卷调查,为了实验的客观性,他先用计算机生成了N个1到1000之间的随机整数(N≤1000),对于其中重复的数字,只保留一个,把其余相同的数去掉,不同的数对应着不同的学生的学号。然后再把这些数从小到大排序,按照排好的顺序去找同学做调查。请你协助明明完成“去重”与“排 阅读全文
posted @ 2018-10-15 11:55 Rakint 阅读(290) 评论(0) 推荐(0) 编辑
  2018年10月12日
摘要: #include <iostream>#include <iomanip>using namespace std;#define NARRAY 8 // array size #define NBUCKET 5 // bucket size #define INTERVAL 10 // bucket 阅读全文
posted @ 2018-10-12 14:53 Rakint 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<vector>#include<algorithm>using namespace std;int rand_select(int Arr[], int p, int q,int i);int partition(int Arr[], int p 阅读全文
posted @ 2018-10-12 13:45 Rakint 阅读(211) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<vector>#include<algorithm>using namespace std;int main(){ int arr[10] = { 0,9,4,7,7,5,6,2,2,1 };//元素值都在arr的arr.size-1内!!本例元 阅读全文
posted @ 2018-10-12 12:11 Rakint 阅读(92) 评论(0) 推荐(0) 编辑
  2018年10月11日
摘要: #include<iostream>#include<vector>#include<algorithm>using namespace std;void quicksort(int Arr[], int p, int q);int partition(int Arr[], int p, int q 阅读全文
posted @ 2018-10-11 22:35 Rakint 阅读(103) 评论(0) 推荐(0) 编辑
  2018年10月9日
摘要: #include<iostream>#include<vector>using namespace std;void mergesort(int Arr[], int l, int r);void merge(int Arr[], int l, int m, int r);int main(){ i 阅读全文
posted @ 2018-10-09 17:21 Rakint 阅读(73) 评论(0) 推荐(0) 编辑