买帽子(去重排序)
来源:互联网 发布:淘宝企业店铺开通 编辑:程序博客网 时间:2024/04/27 17:13
#include<bits/stdc++.h>using namespace std;int main() { set<int>s; int n; set<int>::iterator it; while(cin>>n) { s.clear(); int t; for(int i=0;i<n;i++) { cin>>t; s.insert(t); } if(s.size()<3){ cout<<"-1"<<endl; } else{ it=s.begin(); it++;//可以用advance(it,2)代替 it++; cout<<*it<<endl; } } return 0;}
阅读全文
0 0
- 买帽子(去重排序)
- 买帽子-百度-重复元素排序
- 买帽子
- 买帽子
- 买帽子
- codevs 2980 买帽子(DP)
- 2980 买帽子
- 【codevs2980】买帽子
- code vs 买帽子
- Codevs 2980 买帽子
- codevs2980买帽子
- CDOEVS 2980 买帽子
- 百度笔试- 买帽子
- 牛客网 买帽子
- [编程题] 买帽子
- [编程题] 买帽子
- 【算法题】买帽子
- 校招真题 百度 买帽子
- POJ 1275 Vijos 1108 小胖超市
- PHP之GD2使用
- SpringBoot Maven 打包可执行jar文件
- 函数创建方式及区别,粗略总结函数原理
- 在mac 机上配置jenkins iOS版本编译环境总结
- 买帽子(去重排序)
- hibernate入门二
- FZU1410 (map+sort)之 变位词
- ES6迭代器指南
- 做最单纯的人,走最幸福的路。
- 15个Java多线程面试题及回答
- Linux中vi文件保存退出命令
- 深入理解 Promise (上)
- BZOJ-4403 序列统计 组合数学 + Lucas定理