![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
nucleare
这个作者很懒,什么都没留下…
展开
-
堆排序代码
#include<iostream> #include<cstdio> using namespace std; int h[10010]; int n; void swap(int x,int y)//交换下标为x和y的两个数 { int t; t=h[x]; h[x]=h[y]; h[y]=t; return; } void siftdown(int i)...原创 2018-05-30 20:59:23 · 271 阅读 · 0 评论 -
F - 确定比赛名次 HDU - 1285 (拓扑排序入门)
确定比赛名次 HDU - 1285 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1...原创 2018-12-06 21:07:05 · 111 阅读 · 0 评论