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 < ...
随机推荐
- java.lang.IllegalArgumentException: object is not an instance of declaring class新发现
文章目录 背景 报错 解决 引申 背景 因为要将方法缓存起来提高性能 报错 java.lang.IllegalArgumentException: object is not an instance ...
- 设计模式 - 装饰器模式(Decorator)
简介 场景 通过继承和关联都可以给对象增加行为,区别如下: 继承是静态的(无法在程序运行时动态扩展),且作用于所有子类.硬编码,高耦合. 通过装饰器可以在运行时添加行为和属性到指定对象.关联关系就是在 ...
- Docker 官网文档翻译汇总
官方文档地址 Guide Docker 入门 Docker 入门教程 方向和设置 容器 服务 swarm 集群 stack 部署应用 概述 用 Docker 进行开发 在 Docker 上开发应用 应 ...
- P2634 [国家集训队]聪聪可可(题解)(点分治)
P2634 [国家集训队]聪聪可可(题解)(点分治) 洛谷题目 #include<iostream> #include<cstdlib> #include<cstdio& ...
- go 学习之bufio
bufio模块通过对io模块的封装,提供了数据缓冲功能,能够一定程度减少大块数据读写带来的开销.实际上在bufio各个组件内部都维护了一个缓冲区,数据读写操作都直接通过缓存区进行.当发起一次读写操作时 ...
- python学习第六天运算符总结大全
python学习第六天运算符总结大全,玖乐网络(www.96net.com.cn)列出下面详细 1,算术运算符 + 加 - 减 *乘 / 除 % 求模 ** 乘方 // 取整除 - 返回商的整数部分 ...
- 无法删除VMware旧版本,请与技术小组联系
问题:把文件夹清理了n遍,却无法重装VMware,报错如标题. 原因:相关注册表没删完. 解决办法: - 1.创建一个.txt文本 - 2.将下面的内容复制到.txt文本中: echo off cls ...
- 1.报表TIBCO Jaspersoft Studio工具教程入门--生成jrxml和jasper文件 然后拖拽到项目中 跟ireport一样
转自:https://blog.csdn.net/KingSea168/article/details/42553781 2. 在接下来的教程中,我们将实现一个简单的JasperReports示例,展 ...
- 20180209-os模块
下面将学习关于os模块的相关操作 项目练习的目录结构如下:所有的操作都是基于os_exercise.py模块 1.获取当前的Python脚本的工作目录路径 os.getcwd() # 1.获取当前目录 ...
- 2018-8-10-C#-TextBlock-上标
title author date CreateTime categories C# TextBlock 上标 lindexi 2018-08-10 19:16:52 +0800 2018-2-13 ...