map的使用-Hdu 2648】的更多相关文章

Shopping Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6348    Accepted Submission(s): 2215 Problem Description Every girl likes shopping,so does dandelion.Now she finds the shop is increasin…
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2648 纯暴力的方法T_T... 如下: #include<cstdio> #include<cstdlib> #include<string> #include<iostream> #include<algorithm> typedef ]; char *target = "memory"; ; struct Node{ Stat…
题目链接: https://vjudge.net/problem/40913/origin 大致题意: 这是一道纯模拟题,不多说了. 思路: map模拟,vector辅助 其中用了map的函数: erase: https://www.cnblogs.com/kex1n/archive/2011/12/06/2278505.html 上面这个博客的讲解非常透彻 大致的意思就是: 删除map内的一个节点. 比如我代码里的这句: else if(op == "DELETE") { strin…
#include<iostream> #include<map> #include<string> #include<cstring> #include<cstdio> using namespace std; #define N 10005 map<string,int> elem; int node[N]; int main() { int n,m,i,val,j,rank; string str; while(cin>&g…
A - 圆桌问题: HDU - 4841 #include<iostream> #include<vector> #include<stdio.h> #include<string> using namespace std; int main() { vector<int> table; int n,m; while(scanf("%d%d",&n,&m)!=EOF) { table.clear(); ;i&l…
set: 集合a,b加起来,去重 hdu 1406 #include <iostream> #include<cstdio> #include<set> using namespace std; int main(int argc, char** argv) { set<int> s; set<int>:: iterator cp; int a,b,n; while(scanf("%d%d",&a,&b)!=E…
前言 很多人到现在为止都总是问我算法该怎么学啊,数据结构好难啊怎么的,学习难度被莫名的夸大了,其实不然.对于一个学计算机相关专业的人都知道,数据结构是大学的一门必修课,数据结构与算法是基础,却常常容易被忽视,行业越浮躁,变化越快,开发平台越便捷,高级 API 越多,基本功的重要性就越容易被忽视.即使能意识到基础薄弱,肯下定决心腾出几个月时间恶补基本功不是件容易的事,尤其是参加工作后,琐事繁多,一时热血下定的决心能坚持一周都实属不易.数据结构与算法的学习难度经常被夸大,不少人甚至谈算法色变,尤其无…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4941 解题报告:给你一个n*m的矩阵,矩阵的一些方格中有水果,每个水果有一个能量值,现在有三种操作,第一种是行交换操作,就是把矩阵的两行进行交换,另一种是列交换操作,注意两种操作都要求行或列至少要有一个水果,第三种操作是查找,询问第A行B列的水果的能量值,如果查询的位置没有水果,则输出0. 因为n和m都很大,达到了2*10^9,但水果最多一共只有10^5个,我的做法是直接用结构体存了之后排序,然后m…
http://acm.hdu.edu.cn/showproblem.php?pid=1075 What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 13618    Accepted Submission(s): 4366 Problem Description Ignatius is…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1800 Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10830    Accepted Submission(s): 3472 Problem Description In the year 8888, t…