随笔分类 - 排序
摘要:#include<bits/stdc++.h>using namespace std;struct node{ int xi,s,w;}a[1000001],x[1000001],y[1000001];int n,r,q;bool cmp(node x,node y){ if(x.s!=y.s) r
阅读全文
摘要:1.按照笔试成绩从高到低输出,2.如果成绩相同,按报名号由小到大的顺序输出。如果最后到达分数线的大于预订人数,我们就要扩展人数。 #include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace s
阅读全文
摘要:先排序(sort),在计算每个数字出现的次数,用for,一边遍历,一边输出。 #include<bits/stdc++.h>using namespace std;int aa[1000000],a[1000000],n,i,j,ll,rr,bj;void fz(int l,int r){//归并排
阅读全文
摘要:题目要求去重+排序,而且每个数最大不超过1000,所以我们就可以直接使用桶排。由于要先输出个数,再输出每个数 #include<bits/stdc++.h>using namespace std;int m,n,a[2000];//定义一个桶 int main(){ cin>>n; int x; f
阅读全文
摘要:1.总分高的在前面,2.总分相同,语文成绩高的在前面,3.总分,语文成绩相同,学号小的在前面 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; struct node//定义结构体 { int n
阅读全文

浙公网安备 33010602011771号