BZOJ 2761: [JLOI2011]不重复数字 set
Description
Input
Output
#include<bits/stdc++.h>
#define maxn 100000
using namespace std;
void setIO(string s)
{
string in=s+".in";
freopen(in.c_str(),"r",stdin);
}
set<int>S;
set<int>::iterator it;
int arr[maxn];
inline void solve()
{
int n,i,a;
scanf("%d",&n);
for(i=1;i<=n;++i)
{
scanf("%d",&a);
if(S.find(a)==S.end()) printf("%d ",a), S.insert(a);
}
S.clear();
printf("\n");
}
int main()
{
// setIO("input");
int T;
scanf("%d",&T);
while(T--) solve();
return 0;
}
BZOJ 2761: [JLOI2011]不重复数字 set的更多相关文章
- BZOJ 2761: [JLOI2011]不重复数字 水题
2761: [JLOI2011]不重复数字 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 2100 Solved: 809 题目连接 http:// ...
- bzoj 2761 [JLOI2011]不重复数字(哈希表)
2761: [JLOI2011]不重复数字 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 3210 Solved: 1186[Submit][Sta ...
- bzoj 2761: [JLOI2011]不重复数字 (map||Treap)
链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2761 思路: map标记 实现代码: #include<bits/stdc++.h&g ...
- BZOJ 2761: [JLOI2011]不重复数字 hash哈希
题目就不贴了 点我看题 题意:这题题意很简明,就是给一个序列,把序列里相同的删掉,然后输出,按原数列顺序. 思路:这题之前QZZ和ZN大神犇叫我去做,辣时还不会hash,就留着了.最近某夏令营学会了h ...
- bzoj 2761: [JLOI2011]不重复数字
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #d ...
- bzoj 2761: [JLOI2011]不重复数字【hash】
map会T,双hash会冲突--于是非酋写了个三hash #include<iostream> #include<cstdio> #include<cstring> ...
- 2761: [JLOI2011]不重复数字(平衡树)
2761: [JLOI2011]不重复数字 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 2133 Solved: 825[Submit][Stat ...
- 2761: [JLOI2011]不重复数字(哈希表)
2761: [JLOI2011]不重复数字 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 1770 Solved: 675[Submit][Stat ...
- 【BZOJ】2761: [JLOI2011]不重复数字(set+巨水题+超坑题)
http://www.lydsy.com/JudgeOnline/problem.php?id=2761 太水了,不说了. 但是这格式错误我已经没话说了....行末不能有空格 #include < ...
随机推荐
- loj#2838 「JOISC 2018 Day 3」比太郎的聚会
分析 预处理每个点的前根号小的距离 对于每次询问删除点小于根号则已经处理好 否则直接暴力dp即可 代码 #include<bits/stdc++.h> using namespace st ...
- Visual Studio Code-使用Chrome Debugging for VS Code调试JS
准备工作 安装 Debugger for Chrome 插件 按 F5(或选择菜单栏的 Debug->Start Debuging),然后选择 Chrome,就会自动创建默认的配置文件 &quo ...
- springcloud核心组件Eureka、Ribbon、Feign、Hystrix、Zuul
各个组件角色扮演: Eureka:各个服务启动时,Eureka Client都会将服务注册到Eureka Server,并且Eureka Client还可以反过来从Eureka Server拉取 ...
- PHP 数组下标自动转换为整型的坑
在做项目时,上线后遇到一个 BUG,有一个数组存储了下标从 '01'到'18' 总共18组数据.上线前测试了前几组数据,没问题.上线后,在用户选择'15'时报错,找不到这个数据.查了一下代码,数据是没 ...
- c++虚函数与重载
class base{ public: virtual void f(int n){ cout << "base"<<endl; } }; class De ...
- 关于Visual Studio中书签Bookmark的一些问题
VS自带一个书签功能,但是有个大问题,没有导出功能,因为这个书签是保存在工程.suo文件中,所以在移动,分享,甚至其他情况下很不方便,甚至丢失. 在你分析一个较大的开源,做了30-50个关键代码书签, ...
- jmeter uniq 取值方式设置
- P5030 长脖子鹿放置
题目背景 众周所知,在西洋棋中,我们有城堡.骑士.皇后.主教和长脖子鹿. 题目描述 如图所示,西洋棋的"长脖子鹿",类似于中国象棋的马,但按照"目"字攻击,且没 ...
- 21、numpy—Matplotlib
NumPy Matplotlib Matplotlib 是 Python 的绘图库. 它可与 NumPy 一起使用,提供了一种有效的 MatLab 开源替代方案. 它也可以和图形工具包一起使用,如 P ...
- Codeforces - 1191F - Tokitsukaze and Strange Rectangle - 组合数学 - 扫描线
https://codeforces.com/contest/1191/problem/F 看了一下题解的思路,感觉除了最后一段以外没什么启发. 首先离散化x加快速度,免得搞多一个log.其实y不需要 ...