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

 #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. Develop a Packet Sniffer with libpcap

    Develop a Packet Sniffer with libpcap: http://vichargrave.com/develop-a-packet-sniffer-with-libpcap/

  2. poj Fishnet

    http://poj.org/problem?id=1408 #include<cstdio> #include<cstring> #include<cmath> ...

  3. [Android] 混音线程MixerThread

    MixerThread是Android音频输出的核心部分,所有Android的音频都需要经过MixerThread进行混音后再输出到音频设备. MixerThread的继承关系如下: MixerThr ...

  4. 打patch p0 p1区别

    如何使用patch 对于一个patch文件,有两种常用使用方法: 1.代码:cat new-patch | patch -p0 2.代码:patch -p0 < new-patch   patc ...

  5. /etc/fstab自动挂载文件系统

    打开 /etc/fstab 文件 [root@www ~]# vi /etc/fstab 默认情况下,fstab中已经有了当前的分区配置,内容可能类似: # <file system> & ...

  6. 黑马程序员_Java基础常识

    一.基础常识 1,软件开发 1)什么是软件?软件:一系列按照特定顺序组织的计算机数据和指令的集合. 常见的软件 系统软件 如:DOS,windows,Linux等. 应用软件: 如:扫雷,迅雷,QQ等 ...

  7. 聚焦设计交易与商业落地 DANG·DHUB设计师平台上线【图】_品牌资讯_服饰_太平洋时尚网

    聚焦设计交易与商业落地 DANG·DHUB设计师平台上线[图]_品牌资讯_服饰_太平洋时尚网 聚焦设计交易与商业落地 DANG·DHUB设计师平台上线

  8. 状压dp-poj-1170-Shopping Offers

    题目链接: http://poj.org/problem?id=1170 题目意思: 购物车里有b种(0=<b<=5)物品,每种物品告诉物品代号c(1=<c<=999),数量为 ...

  9. POJ3273:Monthly Expense(二分)

    Description Farmer John is an astounding accounting wizard and has realized he might run out of mone ...

  10. JQuery window、document、 body (转)

    转自:http://www.cnblogs.com/luhe/archive/2012/11/08/2760619.html 我电脑屏幕分辨率:1440 * 900   最大化浏览器,刷新浏览器 al ...