2761: [JLOI2011]不重复数字
来源:互联网 发布:linux 重置网络配置 编辑:程序博客网 时间:2024/05/29 09:23
题目链接
题目大意:去重后输出
题解:可以考虑用排序,hash等巧(正)妙(常)的方法。不过我直接用stl水过了(unordered_set直接CE,233),离散化做法
我的收获:…………
#include <cstdio>#include <iostream>#include <set>using namespace std;int T,n,x;set<int> s;void work(){ for(int i=1;i<=n;i++) { scanf("%d",&x); if(s.count(x)==0){ if(i==1) printf("%d",x); else printf(" %d",x); s.insert(x); } } putchar('\n');}void init(){ s.clear(); scanf("%d", &n);}int main() { cin>>T; while(T--){ init(); work(); } return 0;}
0 0
- 2761: [JLOI2011]不重复数字
- 2761: [JLOI2011]不重复数字
- 【JLOI2011】不重复数字
- bzoj 2761: [JLOI2011]不重复数字
- bzoj 2761: [JLOI2011]不重复数字 排序
- 【BZOJ 2761】[JLOI2011]不重复数字
- BZOJ 2761: [JLOI2011]不重复数字
- BZoj 2761: [JLOI2011]不重复数字 (set
- bzoj 2761 [JLOI2011]不重复数字
- [bzoj-2761][JLOI2011]不重复数字 题解
- BZOJ[2761][JLOI2011]不重复数字 STL
- bzoj 2761: [JLOI2011]不重复数字
- 【bzoj2761】[JLOI2011]不重复数字
- BZOJ [JLOI2011]不重复数字
- bzoj2761 [JLOI2011]不重复数字
- [BZOJ2761][JLOI2011]不重复数字
- 【JLOI2011】【BZOJ2761】不重复数字
- bzoj2761 [JLOI2011]不重复数字
- 1034: [ZJOI2008]泡泡堂BNB
- OSRefTable 用法
- Java:Map与HashMap,Hashtable,HashSet比较
- 1607: [Usaco2008 Dec]Patting Heads 轻拍牛头
- centos 7 下安装tomcat 8.5.11
- 2761: [JLOI2011]不重复数字
- JZOJ-senior-3899. 【NOIP2014模拟】逻辑的连通性
- weex学习笔记-Couldn't find preset "es2015" relative to directory
- [SCOI2005] 互不侵犯
- [NOI2001] 炮兵阵地
- translate动画
- 【eclipse】乱码问题解决,主要是中文
- 2017最新最有价值的Android视频教程(包括传智播客/最新黑马等视频教程)
- #Python 廖雪峰老师#Week 1_2: 一些小tips