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 < ...
随机推荐
- 使用 wx.navigateBack返回页面并携带参数的处理方式
getAddressList (){ let that = this; util.request(api.AddressList).then(function (res) { if (res.errn ...
- Logistic Regression Algorithm解决分类问题
在线性回归算法中,我们看到,在training set中,输入矩阵X与向量y的值都是连续的.所以在二维空间中,我们可以用一条直线去模拟X与y的变化关系,寻找参数向量theta的取值.如根据房屋面积预测 ...
- APT攻防整理-常用CVE
常用CVE CVE-- 受影响版本 Windows /Windows /Windows Server /Windows Server R2/Windows Server /Windows Server ...
- C# 压缩、解压缩
/// <summary> /// 压缩文件 FNameArry 为客户端传回来的文件列表:文件名数组,压缩包的名称strZipName /// </summary> /// ...
- ajax基础--基本概念
1.Ajax的全称: Asynchronous Javascript And XML,就是使用is代码获取服务器数据 局部异步刷新 IP地址:用来标识查找某一台计算机 域名:ip地址太难记了,使用域名 ...
- 安装loadrunner11的时候提示'命令行选项语法错误。键入命令 / ?’ 怎么办
重启电脑后再安装.若还是不行就运行安装程序自带的vcredist_x86.exe,在我电脑的安装包的目录是loadrunner-11\lrunner\Kor\prerequisites\vc2005_ ...
- dataTable获取所有数据
"drawCallback": function(settings,e) { var api = new $.fn.dataTable.Api( settings ); resul ...
- shell脚本从入门到精通(中级)之提高篇
shell 脚本入门到精通(中级) 一.shell 脚本的执行 二.输出格式化 三.数据类型 四.重定向 五.变量 一.shell 脚本的执行 1. 脚本执行的4种方法 $ ls /tmp/test. ...
- smbcontrol - 向smbd或nmbd进程发送消息
总览smbcontrol [ -i ] smbcontrol [ 目标 ] [ 消息类型 ] [ 参数 ] 描述这个工具是是Samba组件的一部分. smbcontrol是个很小的程序,用它可以向系统 ...
- 让docker容器使用主机系统时间(挂入/etc/localtime)
-v挂入这个文件就可以了: -v /etc/localtime:/etc/localtime:ro