博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bzoj2761[JLOI2011]不重复数字
阅读量:7154 次
发布时间:2019-06-29

本文共 601 字,大约阅读时间需要 2 分钟。

题意:

给出N个数,要求把其中重复的去掉,只保留第一次出现的数。n≤50000

题解:

一道令管理员都后悔加入的水题,按大小排序后unique,再按读入顺序排序即可。

代码:

1 #include 
2 #include
3 #include
4 #define inc(i,j,k) for(int i=j;i<=k;i++) 5 using namespace std; 6 7 inline int read(){ 8 char ch=getchar(); int f=1,x=0; 9 while(ch<'0'||ch>'9'){
if(ch=='-')f=-1; ch=getchar();} while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();10 return f*x;11 }12 int t,n,tot;13 struct nd{
int v,id;};14 bool cmp1(nd a,nd b){
if(a.v!=b.v)return a.v

 

20160610

转载于:https://www.cnblogs.com/YuanZiming/p/5778221.html

你可能感兴趣的文章
Pandas学习笔记,如何重命名DataFrame中的一列
查看>>
Visual C++的DLL
查看>>
解决adb shell input text 中文输入,unicode转utf-8
查看>>
linux常用命令,不断学习和更新中...
查看>>
Csharp 基础笔记知识点整理
查看>>
深入学习之mysql(三)单表操作
查看>>
web请求
查看>>
正则基础之——贪婪与非贪婪模式
查看>>
数据结构【基础知识点总结】
查看>>
Android Studio中getter和setter模版配置
查看>>
hdu 4655 Cut Pieces(想法题)
查看>>
傅里叶变化性质
查看>>
Multi Crystal Reports printing - Code
查看>>
简化得最没道理的6个汉字,让人大跌眼镜
查看>>
以太网帧、TCP与UDP段以及IP数据报格式总结
查看>>
Mongodb3安装授权
查看>>
22-angular.module
查看>>
emacs初步学习
查看>>
“Unable to load DLL” problem with SQL Server CE
查看>>
【分层图】分层图学习笔记
查看>>