UVALive 6959 - Judging Troubles
给两组字符串,最多有多少对相同。
map做映射判断一下。
#include <iostream>
#include <cstdio>
#include <map>
#include <string>
using namespace std;
map<string,int> mp;
string s;
int n,ans;
int main()
{
while(~scanf("%d",&n))
{
ans=;
mp.clear();
for(int i=;i<=n;i++)
{
cin>>s;
mp[s]++;
}
for(int i=;i<=n;i++)
{
cin>>s;
if(mp[s])
{
mp[s]--;
ans++;
}
}
printf("%d\n",ans);
}
}
UVALive 6959 - Judging Troubles的更多相关文章
- uva 6959 Judging hash
Judging Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/problem/viewProb ...
- Gym101482 NWERC 2014(队内训练第4场)
-----------------------前面的两场感觉质量不高,就没写题解----------------------------- A .Around the Track pro:给定内多边形 ...
- Gym 101482 题解
B:Biking Duck 题意:现在有一个人要从(x1,y1)点走到(x2,y2)点, 现在走路的速度为v. 还有骑自行车的速度v2,自行车要从某个自行车站到另一个自行车站,现在我们可以视地图的边界 ...
- HDU1329 Hanoi Tower Troubles Again!——S.B.S.
Hanoi Tower Troubles Again! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (J ...
- UVALive - 4108 SKYLINE[线段树]
UVALive - 4108 SKYLINE Time Limit: 3000MS 64bit IO Format: %lld & %llu Submit Status uDebug ...
- UVALive - 3942 Remember the Word[树状数组]
UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...
- UVALive - 3942 Remember the Word[Trie DP]
UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...
- ZOJ-1239 Hanoi Tower Troubles Again!
链接:ZOJ1239 Hanoi Tower Troubles Again! Description People stopped moving discs from peg to peg after ...
- 思维 UVALive 3708 Graveyard
题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...
随机推荐
- [Python][MachineLeaning]Python Scikit-learn学习笔记1-Datasets&Estimators
Scikit-learn官网:http://scikit-learn.org/stable/index.html Datasets 标准的数据集格式为一组多维特征向量组成的集合.数据集的标准形状(sh ...
- 对 Xcode 菜单选项的详细探索(干货)
http://www.cocoachina.com/ios/20151204/14480.html
- 进阶笔记(1)——JavaScript 语言精碎
调用:(调用一个函数将暂停当前函数的执行,传递控制权和参数给新函数) 每个函数接受连个附加参数:this (取决于调用的模式).argument. js的四种调用模式及this指向: 1.方法调用:( ...
- java连接sqL2008 数据库实例
package com.lzw; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSe ...
- tomcat7.0的源码下载
如果想知道servlet的HttpServlet的实现细节,想知道jsp的org.apache.jasper.runtime.HttpJspBase的实现细节,想知道tomcat关于servlet和j ...
- NYOJ 45 棋盘覆盖
棋盘覆盖 水题,题不难,找公式难 import java.math.BigInteger; import java.util.Scanner; public class Main { public s ...
- linux学习方法之一
相信不少想学习linux的新手们正愁不知道看什么linux学习教程好,下面小编给大家收集和整理了几点比较重要的教程,供大家学习,如需想学习更多的话,可到wdlinux学堂寻找更多教程. 1.什么是RP ...
- jquery.ajax和Ajax 获取数据
前几天接触了jquery 看到里面ajax的部分,自己也不是很懂,然后有重复看了即便,然后写了一个小功能,分享下...我刚学的.有错误的请指教. 验证用户名是否存在 在checkname_jqajax ...
- 不到30行JS代码实现的Excel表格
不到30行JS代码实现的Excel表格,jQuery并非不可替代 某国外程序员展示了一个由原生JS写成不依赖第三方库的,Excel表格应用,有以下特性: 由不足30行的原生JavaScript代码实现 ...
- web.xml中配置Spring中applicationContext.xml的方式
2011-11-08 16:29 web.xml中配置Spring中applicationContext.xml的方式 使用web.xml方式加载Spring时,获取Spring applicatio ...