這題是結論題

好玄學,不懂

代碼:

#include<bits/stdc++.h>
using namespace std;
struct no{
	int v,p;
	bool operator <(const no &rhs)const{
		return v<rhs.v||v==rhs.v&&p<rhs.p;
	}
}c[100010];
int n,a[100010];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		c[i].v=a[i];
		c[i].p=i;
	}
	sort(c+1,c+n+1);
	int x=c[1].p;
	for(int i=1;i<=n;i++){
		printf("%d ",a[x]);
		x=c[x].p;
	}
}

jzoj100031的更多相关文章

随机推荐

  1. 转载 springboot 配置读取

    前言:了解过spring-Boot这个技术的,应该知道Spring-Boot的核心配置文件application.properties,当然也可以通过注解自定义配置文件**.properties的信息 ...

  2. 建表Table

    Sstudent表   学  号    Sno  姓  名   Sname   性  别    Ssex     年  龄      Sage   所 在 系    Sdept   200215121 ...

  3. FSCapture截图软件注册码

    企业版序列号: name:bluman serial/序列号/注册码:VPISCJULXUFGDDXYAUYF

  4. 删除pdf文件所有超链接

    最近在读deep learning 书Bengio那本,在Github上面下载的,下载回来全都是超链接, 超级烦,比如点一下梯度下降法,就直接跳转到数后尾的index. 我看书还喜欢老点,所以要把他们 ...

  5. An integration of deep learning and neuroscience

    Recently, I have read a paper about the integration of deep learing and neuroscience, which elaborat ...

  6. Devexpress VCL Build v2013 vol 14.1.3 发布

    我修,我修,修修修. New Major Features in 14.1 What's New in VCL Products 14.1 Breaking Changes To learn abou ...

  7. 2018.08.29 NOIP模拟 table(拓扑排序+建图优化)

    [描述] 给出一个表格,N 行 M 列,每个格子有一个整数,有些格子是空的.现在需要你 来做出一些调整,使得每行都是非降序的.这个调整只能是整列的移动. [输入] 第一行两个正整数 N 和 M. 接下 ...

  8. 18 Customers' Role in Good Customer Service 客户在高质量客服中的作用

    Customers' Role in Good Customer Service 客户在高质量客服中的作用 ⑴High-quality customer service is preached by ...

  9. 动词的时态(Les temps du verbe )

    在开始讲解直陈式现在时的主要用法之前,我们有必要先搞清楚两个基本概念:▶语式(mode):语式是动词表达动作的方式.一个动作,可以作为实在的事表达出来,也可以作为希望或单纯设想的事表达出来,法语动词共 ...

  10. 有趣的NaN类型

    在学习Java集合的时候遇到了Float.isNaN(float)函数,点进去一看就不理解了,函数实现如下: public static boolean isNaN(float v) { return ...