
排序
鸭锁骨啦啦啦
你说贪心是无法接近你的
~~~~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
L2-012 关于堆的判断
// 需要多看看,思路不难,主要是堆排及输入 #include<cstdio> #include<vector> #include<cstring> using namespace std; vector<int> v; int n; void upAdjust(int i){ if(i==1) return ; while(i!=1){ ...原创 2020-03-15 19:24:23 · 165 阅读 · 0 评论 -
基排
普通基排,就是以65536为底,用位运算,把一个数拆成两部分,要循环两遍 松式基排,就是以256为底,用位运算把一个数拆成四部分,要循环四遍 为什么松式基排在WC的时候会更快呢,因为这样的话cnt数组刚好能装进L1高速缓存 #include&lt;cstring&gt; #include&lt;cstdio&gt; #include&lt;algorithm&gt; using namespace...原创 2019-02-11 15:01:19 · 1059 阅读 · 0 评论 -
...set
题目是去重后有多少数,并输出。 set,顾名思义,就是数学上的集合——每个元素最多只出现一次,并且set中的元素已经从小到大排好序。 头文件:#include &lt; set &gt; //用bits的童鞋请忽略 常用操作 : begin() 返回set容器的第一个元素的 地址 end() 返回set容器的最后一个元素 地址 clear() 删除set容器中的所有的元素 e...原创 2019-02-11 15:38:20 · 495 阅读 · 0 评论 -
sort函数
#include&lt;bits/stdc++.h&gt; using namespace std; struct node{ int name; int grade; }; struct node a[5001]; bool cmp(struct node a,struct node b) { if(a.grade==b.grade) return a.name&lt;b.name; r...原创 2019-02-11 16:06:39 · 170 阅读 · 0 评论 -
1309 洛
直接用sort函数会超时 从开始到结尾 每局获胜的人 的顺序是排好的 然后就可以用归并(〃‘▽’〃) 初始分数已知,然后降序排列,两两比赛,力量值大的获胜,每个人的力量值都不同。比赛r轮,找出排名q的编号 #include<stdio.h> #include<algorithm> using namespace std; struct s{ int w; int gra...原创 2019-02-11 21:14:21 · 127 阅读 · 0 评论 -
P1088 火星人
题意是求第(m+1)个排列 一共有n个数; #include&lt;bits/stdc++.h&gt; using namespace std; int a[10005],n,m; int main() { scanf("%d %d",&amp;n,&amp;m); for(int i=0;i&lt;n;i++) scanf("%d",&a原创 2019-03-09 09:12:05 · 423 阅读 · 0 评论 -
火柴排队
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; int n,f[100005],t[100005],ans; struct node{ int h,x; }a[100005],b[100005]; bool cmp(node a,node b){ re...转载 2019-07-17 16:03:09 · 129 阅读 · 0 评论