已有的数据结构装不下数据,或者不能处理现有的数据,那就必须要思考其他的辅助手段,辅助结构;

 #include <cstdio>
#include <map>
#include <vector>
using namespace std; vector<int> order;
map<int, int> freq; int main()
{
int n;
freq.clear();
while(scanf("%d", &n) != EOF)
{
if(freq.count(n)) freq[n] ++;
else freq[n] = , order.push_back(n);
}
for(auto it = order.begin(); it != order.end(); ++ it)
printf("%d %d\n", *it, freq[*it]); /*for(int i = 0; i < (int)order.size(); i++)
printf("%d %d\n", order[i], freq[order[i]]);*/
return ;
}

uva 484 - The Department of Redundancy Department的更多相关文章

  1. 3ds Max File Format (Part 3: The department of redundancy department; Config)

    Now we'll have a look at the Config stream. It begins like follows, and goes on forever with various ...

  2. The Department of Redundancy Department

    Write a program that will remove all duplicates from a sequence of integers and print the list of un ...

  3. TSQL Beginners Challenge 1 - Find the second highest salary for each department

    很久以前准备写的系列文章,后来因为懒一直耽搁着,今天突然决定继续下去,于是有了这篇文章,很基础,但很常用.题目描述依然拷贝.简单来说就是找出个个部门薪水排名第二的人,排名相同的要一起列出来. Intr ...

  4. [SQL]LeetCode184. 部门工资最高的员工 | Department Highest Salary

    The Employee table holds all employees. Every employee has an Id, a salary, and there is also a colu ...

  5. [SQL]LeetCode185. 部门工资前三高的员工 | Department Top Three Salaries

    SQL 架构 Create table If Not Exists Employee (Id ), Salary int, DepartmentId int) Create table If Not ...

  6. LeetCode——Department Top Three Salaries(巧妙使用子查询)

    The Employee table holds all employees. Every employee has an Id, and there is also a column for the ...

  7. LeetCode——Department Highest Salary(花式使用IN以及GROUP BY)

    The Employee table holds all employees. Every employee has an Id, a salary, and there is also a colu ...

  8. MySQL测试题——开发公司人事管理系统,包括 Employee表 和 Department表

    一.需求分析 我们的开发团队,计划开发一款公司人事管理软件,用于帮助中小型企业进行更加高效的人事管理.现在需要对数据库部分进行设计和开发,根据对需求和立项的分析,我们确定该数据库中最核心的两个表为员工 ...

  9. Mysql 设计超市经营管理系统,包括员工信息表(employee)和 员工部门表(department)

    互联网技术学院周测机试题(二) 一.需求分析 为进一步完善连锁超市经营管理,提高管理效率,减少管理成本,决定开发一套商品管理系统,用于日常的管理.本系统分为商品管理.员工管理.店铺管理,库存管理等功能 ...

随机推荐

  1. SpringMVC入门1

    SpringMVC核心类与接口 •DispatcherServlet 前端控制器(也称总控制器),把请求给转发到具体的控制类 •HandlerMapping 映射处理器,负责映射中央处理器转发给con ...

  2. 「30天自制操作系统」 Stop & 「OS67 」 Start

    废话 整个十月都没有再写一点什么, 其实没什么好写的, 把书里的东西码出来贴在博客里实在没什么意思, 况且书里已经写得够详细了. 这本书给我最深刻的感觉是, 作者通过简化一些细节, 一步一步地模拟整个 ...

  3. 转:Zend Framework 2.0 分析

    文章来自于:http://bbs.phpchina.com/thread-268362-1-1.html ZF2已经发布,与ZF1相比,MVC这一模块内部的实现机制可谓大相径庭,许多用过ZF1的PHP ...

  4. 从Profile中窥探Unity的内存管理

    刨根问底U3D---从Profile中窥探Unity的内存管理 这篇文章包含哪些内容 这篇文章从Unity的Profile组件入手,来探讨一下Unity在开发环境和正式环境中的内存使用发面的一些区别, ...

  5. 移動電源ic的概述

    移動電源ic壹種集供電和充電功能於壹體的便攜式充電器,可以給手機等數碼設備隨時隨地充電或待機供電.壹般由鋰電芯或者幹電池作為儲電單元.區別於產品內部配置的電池,也叫外掛電池.壹般配備多種電源轉接頭, ...

  6. MyEclipse10 中增加svn插件

    http://www.cnblogs.com/bluesky4485/archive/2012/04/23/2467177.html 确实这种方法可行!向牛人学习!

  7. Intellij IDEA 14隐藏被排除的文件夹

    被排除的文件和文件夹以红色显示了. 看着这东西,人一下子就不好了. 还好设置可以改回来. Project tab右上角齿轮,关闭“Show Excluded Files”即可.

  8. java读XML文件

    XML文件设计为传输和存储数据,其焦点为数据内容. HTML设计为用来显示数据, 其焦点为数据外观. XML仅仅是文本文件,任何文本编辑器一般情况下都能对其进行编辑. XML没有预定义的标签,并且设定 ...

  9. C# asp.net页面通过URL参数传值中文乱码问题解决办法

    1.编码string state=Server.UrlEncode(stateName.Text.Trim());Response.Redirect("aaa.aspx?state=&quo ...

  10. 终于有人把O2O、C2C、B2B、B2C的区别讲透了

    一.O2O.C2C.B2B.B2C的区别在哪里? o2o 是 online to offline 分为四种运营模式 1.online to offline 是线上交易到线下消费体验 2.offline ...