HDU1263 map二维运用
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <algorithm>
using namespace std; int main()
{
int T, m;
cin >> T;
while(T--)
{
map<string,map<string,int> >mp;
string place, name;
int num;
cin >> m;
for(int i=; i<m; i++)
{
cin >> name >> place >> num;
mp[place][name]+=num;;
}
for(map<string,map<string,int> >::iterator iter1=mp.begin(); iter1!=mp.end(); iter1++)
{
cout << iter1->first <<endl;
for(map<string,int >::iterator iter2=iter1->second.begin(); iter2!=iter1->second.end(); iter2++)
cout << " |----" << iter2->first << "(" << iter2->second << ")" <<endl;
}
if(T) cout << endl;
}
return ;
}
HDU1263 map二维运用的更多相关文章
- java生成带logo的二维码,自定义大小,logo路径取服务器端
package com.qishunet.eaehweb.util; import java.awt.BasicStroke; import java.awt.Graphics; import jav ...
- Java中使用google.zxing快捷生成二维码(附工具类源码)
移动互联网时代,基于手机端的各种活动扫码和收付款码层出不穷:那我们如何在Java中生成自己想要的二维码呢?下面就来讲讲在Java开发中使用 google.zxing 生成二维码. 一般情况下,Java ...
- Java实现二维码生成的方法
1.支持QRcode.ZXing 二维码生成.解析: package com.thinkgem.jeesite.test; import com.google.zxing.BarcodeFormat; ...
- Codeforces 519D A and B and Interesting Substrings(二维map+前缀和)
题目链接:http://codeforces.com/problemset/problem/519/D 题目大意:给你一串字符串s仅由小写字母组成,并且对于'a'~'z'都给了一个值.求子串t满足t的 ...
- 记一次坑爹的golang 二维map判断问题
记一次坑爹的golang 二维map判断问题 2018年10月18日 23:16:21 yinnnnnnn 阅读数:32更多 个人分类: golang 版权声明:本文为博主原创文章,未经博主允许不 ...
- java list map转换成二维数组
/** * *@Title: ListToArray *@Description: list列表转换成二维数组 *@Author: Administrator *@Since: 2018年1月7日下午 ...
- JS中:数组和二维数组、MAP、Set和枚举的使用
1.数组和二维数组: 方法一: var names = ['Michael', 'Bob', 'Tracy']; names[0];// 'Michael' 方法二: var mycars=new ...
- HDU 1263 二维map
题意:给出一份水果的交易表,根据地区统计出水果的交易情况. 思路:二维map使用. #include<cstdio> #include<string> #include ...
- ACM-ICPC2018徐州网络赛 Features Track(二维map+01滚动)
Features Track 31.32% 1000ms 262144K Morgana is learning computer vision, and he likes cats, too. ...
随机推荐
- 带密匙的php加密解密示例分享
<?phpheader("content-type:text/html;charset=utf-8");$id = "http://www.jb51.net&quo ...
- JS简写
本文来源于多年的 JavaScript 编码技术经验,适合所有正在使用 JavaScript 编程的开发人员阅读. 本文的目的在于帮助大家更加熟练的运用 JavaScript 语言来进行开发工作. 文 ...
- 20,Django contenttypes 应用
contenttypes 是Django内置的一个应用,可以追踪项目中所有app和model的对应关系,并记录在ContentType表中. 1.创建一个项目 2.数据库迁移,生成默认表. 3.存着所 ...
- CSS3实现带阴影的弹球
实现div上下跳动时,底部阴影随着变化 <!DOCTYPE html> <html lang="en"> <head> <meta cha ...
- Still unable to dial persistent://blog.csdn.net:80 after 3 attempts
动不动电脑有些网站打不开了,还报错: Still unable to dial persistent://blog.csdn.net:80 after 3 attempts 为什么呢? 是dns坏了? ...
- Android (shape,gradient)使用总结
设置背景色可以通过在res/drawable里定义一个xml,如下: <?xml version="1.0" encoding="utf-8"?> ...
- 写一个quick sort
#include <stdio.h> #include <stdlib.h> //int a[]={1000,10000,9,10,30,20,50,23,90,100,10} ...
- Python列表深浅复制详解
转自:https://www.cnblogs.com/blaomao/p/7239203.html 在文章<Python 数据类型>里边介绍了列表的用法,其中列表有个 copy() 方法, ...
- Python 3基础教程6-for循环语句
本文介绍另外一种循环语句,for循环,直接看例子. 用for实现打印1到9的数字. 方法一:写入一个列表,然后遍历列表 # 这里介绍 for循环# 打印1到9 exampleList = [1,2,3 ...
- python中的字符问题
unicode/unicodebig/utf8 在python上默认情况下都解析不了 window系统中 ASCLL对应的是GBK unicode|unicodebigendian 对应 utf-16 ...