上一页 1 2 3 4 5 6 ··· 27 下一页
摘要: 题意:当前在看书的第 x 页,每次可以向前或者向后翻 d 页,这个书一共 n 页,问能否用最小操作翻到第 y 页。题解:三种情况:1、直接翻能到的一定最短。 2、先翻到第一页,然后往后翻,翻到第 y 页。3、先翻到第 n 页,然后往前翻,翻到第 y 页。#includ... 阅读全文
posted @ 2018-12-12 20:02 Mercury_Lc 阅读(83) 评论(0) 推荐(0)
摘要: #include #include #include struct node{ char data[15]; struct node *next; //存放名字};struct node *head[2018]; // 每个课程都有一个相应的开始int... 阅读全文
posted @ 2018-12-12 19:52 Mercury_Lc 阅读(474) 评论(0) 推荐(0)
摘要: 归并排序详解(戳我)。以下是搬了别人的。#include#includelong long sum = 0;int a[100005];int temp[100005];void Merge(int s1, int e1, int s2, int e2) { i... 阅读全文
posted @ 2018-12-12 19:31 Mercury_Lc 阅读(153) 评论(0) 推荐(0)
摘要: 其实,感觉好像增量不同的冒泡,希尔排序概念以后补上。#include using namespace std;int a[10005];int b[10005];void shsort(int dk, int n, int a[]){ for(int i = d... 阅读全文
posted @ 2018-12-12 18:46 Mercury_Lc 阅读(252) 评论(0) 推荐(0)
摘要: #include #include using namespace std;typedef long long ll;//int sum = 0;int a[100004]; //题目是长整型,不过这里 int 也可以。。int b[100005];void qus... 阅读全文
posted @ 2018-12-12 17:23 Mercury_Lc 阅读(265) 评论(0) 推荐(0)
摘要: #include #include int a[110000];void qusort(int l, int r, int a[]){ int i = l, j = r; int x = a[i]; if(i >= j) return ; wh... 阅读全文
posted @ 2018-12-12 11:42 Mercury_Lc 阅读(176) 评论(0) 推荐(0)
摘要: 桶排序: #include #include int a[5555555];int main(){ int n,m; scanf("%d",&n); memset(a,0,sizeof(a)); for(int i = 0; i = 100) ... 阅读全文
posted @ 2018-12-12 11:32 Mercury_Lc 阅读(165) 评论(0) 推荐(0)
摘要: #include #include #include int a[3500];int Hash[3500];int main(){ int n,p,t; while(~scanf("%d%d",&n,&p)) { memset(Hash... 阅读全文
posted @ 2018-12-12 11:19 Mercury_Lc 阅读(273) 评论(0) 推荐(0)
摘要: #include #include #include struct node{ int data; int h; struct node *lc,*rc; //平衡二叉树 需要一个 h 来记录平衡因子};int max(int x ,int y) ... 阅读全文
posted @ 2018-12-12 10:53 Mercury_Lc 阅读(174) 评论(0) 推荐(0)
摘要: (不知道为啥开个数组就 TLE 。QAQ)#include #include #include //const int maxn = 100005;////int a[maxn];int main(){ int n,k,ans,x; while(~sca... 阅读全文
posted @ 2018-12-11 11:30 Mercury_Lc 阅读(149) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 27 下一页