hdu1263 水果
来源:互联网 发布:js中math 随机数 取整 编辑:程序博客网 时间:2024/04/28 14:02
题意:中文题
思路:map里就是有序啊
#include <fstream>#include <iostream>#include <string>#include <cstring>#include <complex>#include <math.h>#include <set>#include <vector>#include <map>#include <queue>#include <stdio.h>#include <stack>#include <algorithm>#include <list>#include <ctime>#include <memory.h>#include <ctime>#include <assert.h>#define rep(i,a,n) for (int i=a;i<n;i++)#define per(i,a,n) for (int i=n-1;i>=a;i--)#define pb push_back#define mp make_pair#define all(x) (x).begin(),(x).end()#define fi first#define se second#define eps 1e-8#define M_PI 3.141592653589793typedef long long ll;const ll mod=1000000007;const int inf=0x7fffffff;ll powmod(ll a,ll b) {ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}using namespace std;map<string,map<string,int> >dict;int main(){ ios::sync_with_stdio(false); int T;cin>>T; while(T--){ dict.clear(); int n;cin>>n; for(int i=0;i<n;i++){ string a,b;int v; cin>>a>>b>>v; dict[b][a]+=v; } for(map<string,map<string,int> >::iterator it=dict.begin();it!=dict.end();it++){ cout<<it->first<<endl; for(map<string,int>::iterator iter=it->second.begin();iter!=it->second.end();iter++){ cout<<" |----"<<iter->first<<"("<<iter->second<<")"<<endl; } } if(T) cout<<endl; }}
0 0
- HDU1263:水果
- hdu1263水果
- hdu1263水果
- hdu1263 水果
- HDU1263:水果
- hdu1263 水果
- 水果 hdu1263 水题
- hdu1263(水果 map)
- hdu1263水果 STL map的使用
- hdu1263 水果(结构体排序)
- hdu1263水果(map容器的嵌套)
- hdu1263
- hdu1004 Let the Balloon Rise && hdu1263 水果(map)
- 【HDU1263】【STL-MAP套MAP】(省份,水果,数量)MAP嵌套大开发
- HDU1263-map
- 水果
- 水果
- 水果
- Hibernate的dialect大全
- Codeforces Round #338 (Div. 2) A. Bulbs
- awk的BEGIN和END
- Ruby的基础学习
- 推荐系统笔记三、基于近邻的推荐系统(进阶篇)
- hdu1263 水果
- Drupal 在Views 中自定义筛选 Filter
- 用OpenSSL 做HMAC(C++)
- HDU 1253:胜利大逃亡【BFS】
- 阿里云云翼计划一条龙建站了
- 2016苹果开发者帐号申请流程实名认证图文教程
- Codeforces Round #338 (Div. 2) B. Longtail Hedgehog DP
- Oracle协议适配器错误解决办法
- JS页面埋点