zoj 1760 Doubles
2012-03-31 12:23
302 查看
#include "iostream" #include "set" using namespace std; int main() { set<int> s; set<int>::iterator it; int temp; while (cin >> temp && temp != -1) { if (temp != 0) s.insert(temp);//放进容器中进行自动排序! else { int count = 0; for (it = s.begin(); it != s.end(); it++) if (s.find((*it) * 2) != s.end())//在容器中查找是否存在! count++; cout << count << endl; s.clear(); } } }
相关文章推荐
- ZOJ Problem Set - 1760 Doubles
- zoj 1760 Doubles
- ZOJ 1760 Doubles
- zoj 1760 Doubles
- zoj 1760 Doubles(set集合容器的应用)
- ZOJ 1760 &&POJ1552 Doubles (模拟)
- zoj 1760.Doubles
- zoj 1760 Doubles
- zoj 1760 Doubles
- ZOJ Problem Set–1760 Doubles
- ZOJ 1760 How Many Shortest Path
- ZOJ 1760 How Many Shortest Path(最短路+网络流之最大流)
- ZOJ 1760 How Many Shortest Path (网络流.水)
- 1760_Doubles
- zoj 1760 floyd构图+Dinic最大流
- ZOJ 1760 多少个两倍数
- zoj 1760 查找
- POJ 1552 & ZOJ 1760 & UVA2787
- ZOJ-1760
- ZOJ 1760