uva 484 - The Department of Redundancy Department
已有的数据结构装不下数据,或者不能处理现有的数据,那就必须要思考其他的辅助手段,辅助结构;
#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的更多相关文章
- 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 ...
- The Department of Redundancy Department
Write a program that will remove all duplicates from a sequence of integers and print the list of un ...
- TSQL Beginners Challenge 1 - Find the second highest salary for each department
很久以前准备写的系列文章,后来因为懒一直耽搁着,今天突然决定继续下去,于是有了这篇文章,很基础,但很常用.题目描述依然拷贝.简单来说就是找出个个部门薪水排名第二的人,排名相同的要一起列出来. Intr ...
- [SQL]LeetCode184. 部门工资最高的员工 | Department Highest Salary
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a colu ...
- [SQL]LeetCode185. 部门工资前三高的员工 | Department Top Three Salaries
SQL 架构 Create table If Not Exists Employee (Id ), Salary int, DepartmentId int) Create table If Not ...
- LeetCode——Department Top Three Salaries(巧妙使用子查询)
The Employee table holds all employees. Every employee has an Id, and there is also a column for the ...
- 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 ...
- MySQL测试题——开发公司人事管理系统,包括 Employee表 和 Department表
一.需求分析 我们的开发团队,计划开发一款公司人事管理软件,用于帮助中小型企业进行更加高效的人事管理.现在需要对数据库部分进行设计和开发,根据对需求和立项的分析,我们确定该数据库中最核心的两个表为员工 ...
- Mysql 设计超市经营管理系统,包括员工信息表(employee)和 员工部门表(department)
互联网技术学院周测机试题(二) 一.需求分析 为进一步完善连锁超市经营管理,提高管理效率,减少管理成本,决定开发一套商品管理系统,用于日常的管理.本系统分为商品管理.员工管理.店铺管理,库存管理等功能 ...
随机推荐
- 转:windows xp下如何安装SQL server2000企业版
SQL2000企业版本 适用于WIN 2000 Server系统和Windows 2003系统,Windows XP一般装不了需要选用个人版或开发板.但是企业版也可以安装在xp系统下.这里介绍一个XP ...
- 霍布森选择效应(Hobson choice Effect)
1631年,英国剑桥商人霍布森从事马匹生意,他说,你们买我的马.租我的马,随你的便,价格都便宜.霍布森的马圈大大的.马匹多多的,然而马圈只有一个小门,高头大马出不去,能出来的都是瘦马.赖马.小马,来买 ...
- activitie5 流程入门例子
流程这个东西在ERP项目用得比较多.在网上找到一个例子,与大家分享一下.http://yiyiboy2010.iteye.com/blog/1530924 感谢原博主提供 http://blog.ch ...
- 【转】 android 4.4 Step Counter Sensor计步器的使用
原文网址:http://blog.csdn.net/aikongmeng/article/details/40457233 版权声明:本文为博主原创文章,未经博主允许不得转载. Android 官方参 ...
- HDOJ 2114 Calculate S(n)(找周期)
Problem Description Calculate S(n). S(n)=1^3+2^3 +3^3 +--+n^3 . Input Each line will contain one int ...
- HDU2050(分平面问题)
分平面问题: 一.n条直线最多分平面问题. n条直线最多可以把平面分成多少个区域? 此类问题主要采用递归的思想.当有n-1条直线时,平面最多被分成了f(n-1)块区域.如果要使第n条直线分的区域最多, ...
- openStack Use Orchestration module(heat) create and manage cloud resources
- HBase技术介绍
HBase简介 HBase - Hadoop Database,是一个高可靠性.高性能.面向列.可伸缩的分布式存储系统,利用HBase技术可在廉价PC Server上搭建起大规模结构化存储集群. HB ...
- M - Jamie's Contact Groups - poj 2289(二分图多重匹配)
题意:某个人通讯录有很多人,现在他想把这个人分组,给的数据是可以把这个人分在那些组里面,现在他想知道分组后,人最多的那个组至少有多少人. 分析:因为没有给组限制有多少人,可以使用二分求出来最小的那个, ...
- AngularJS clone directive 指令复制
需求背景: directive模块化某表单信息,但表单信息可加入多条.此时就涉及到clone directive. 解决方式: 能够通过使用angularjs中$com ...