Codehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are giving T-shirts for the winners.

The valid sizes of T-shirts are either “M” or from 0 to 3 “X” followed by “S” or “L”. For example, sizes “M”, “XXS”, “L”, “XXXL” are valid and “XM”, “Z”, “XXXXL” are not.

There are n winners to the cup for both the previous year and the current year. Ksenia has a list with the T-shirt sizes printed for the last year cup and is yet to send the new list to the printing office.

Organizers want to distribute the prizes as soon as possible, so now Ksenia is required not to write the whole list from the scratch but just make some changes to the list of the previous year. In one second she can choose arbitrary position in any word and replace its character with some uppercase Latin letter. Ksenia can’t remove or add letters in any of the words.

What is the minimal number of seconds Ksenia is required to spend to change the last year list to the current one?

The lists are unordered. That means, two lists are considered equal if and only if the number of occurrences of any string is the same in both lists.

Input
The first line contains one integer n (1≤n≤100) — the number of T-shirts.

The i-th of the next n lines contains ai — the size of the i-th T-shirt of the list for the previous year.

The i-th of the next n lines contains bi — the size of the i-th T-shirt of the list for the current year.

It is guaranteed that all the sizes in the input are valid. It is also guaranteed that Ksenia can produce list b from the list a.

Output
Print the minimal number of seconds Ksenia is required to spend to change the last year list to the current one. If the lists are already equal, print 0.

Examples
Input
3
XS
XS
M
XL
S
XS
Output
2
Input
2
XXXL
XXL
XXL
XXXS
Output
1
Input
2
M
XS
XS
M
Output
0
Note
In the first example Ksenia can replace “M” with “S” and “S” in one of the occurrences of “XS” with “L”.

In the second example Ksenia should replace “L” in “XXXL” with “S”.

In the third example lists are equal.
水题
不过题意有点坑,本质上就是找和去年不同d的,所以就很简单了
思路:开一个string数组,用来储存去年的尺码,然后输入今年的,比较,如果相同,就count++,与此同时,为保证用过的不在重复计入,我们就把用过的换掉,最后输出n-count就是答案。

#include<bits/stdc++.h>
using namespace std;
int main()
{string s1[101],str;int n,flag=0;cin>>n;for(int i=0;i<n;i++)cin>>s1[i];for(int i=0;i<n;i++){cin>>str;for(int i=0;i<n;i++){if(str==s1[i]){flag++;s1[i]='0';break;}} }cout<<n-flag;return 0;
}

CodeForces 1000A Codehorses T-shirts相关推荐

  1. codeforces 1000A,T-sthirt

    用map来做: 首先,stirng类型在<string>头文件里, string类型的只能用cin输入,cout输出,因为string类型是C++特有的类型: 用map,<strin ...

  2. 【Codeforces】 Round #374 (Div. 2)

    Position:http://codeforces.com/contest/721 我的情况 开始还是rank1,秒出C.(11:00机房都走光了,我ma到11:05才走,只打了一个小时) 结果.. ...

  3. CodeForces 375D Tree and Queries

    传送门:https://codeforces.com/problemset/problem/375/D 题意: 给你一颗有根树,树上每个节点都有其对应的颜色,有m次询问,每次问你以点v为父节点的子树内 ...

  4. 「日常训练」Bad Luck Island(Codeforces Round 301 Div.2 D)

    题意与分析(CodeForces 540D) 是一道概率dp题. 不过我没把它当dp做... 我就是凭着概率的直觉写的,还好这题不算难. 这题的重点在于考虑概率:他们喜相逢的概率是多少?考虑超几何分布 ...

  5. 【codeforces 812C】Sagheer and Nubian Market

    [题目链接]:http://codeforces.com/contest/812/problem/C [题意] 给你n个物品; 你可以选购k个物品;则 每个物品有一个基础价值; 然后还有一个附加价值; ...

  6. CodeForces 获得数据

    针对程序的输出可以看见 CodeForces :当输入.输出超过一定字符,会隐藏内容 所以:分若干个程序进行输入数据的获取 1. 1 for (i=1;i<=q;i++) 2 { 3 scanf ...

  7. codeforces水题100道 第二十七题 Codeforces Round #172 (Div. 2) A. Word Capitalization (strings)...

    题目链接:http://www.codeforces.com/problemset/problem/281/A 题意:将一个英文字母的首字母变成大写,然后输出. C++代码: #include < ...

  8. CodeForces 595A

    题目链接: http://codeforces.com/problemset/problem/595/A 题意: 一栋楼,有n层,每层有m户,每户有2个窗户,问这栋楼还有多少户没有睡觉(只要一个窗户灯 ...

  9. codeforces A. Jeff and Digits 解题报告

    题目链接:http://codeforces.com/problemset/problem/352/A 题目意思:给定一个只有0或5组成的序列,你要重新编排这个序列(当然你可以不取尽这些数字),使得这 ...

最新文章

  1. 构建根文件系统之busybox(四)完善
  2. Java 集合系列(2): ArrayList源码深入解析和使用示例
  3. 「 每日一练,快乐水题 」917. 仅仅反转字母
  4. php 日志按天截取,Laravel 日志管理:按日期切割日志
  5. 最让人纠结的等式:0.999...=1
  6. Qt 的udpSocket通信
  7. 杭电4561 连续最大积
  8. scannet数据集和shapenet、modelnet等数据集的名称和标签对应关系
  9. 深度解读SSH免密登录
  10. Storm概念学习系列之并行度与如何提高storm的并行度
  11. elemtnui 表格如何修改某行文字颜色(elemtnui table 修改某行文字颜色)
  12. 文墨绘学【书法双师】
  13. 201771010101 白玛次仁 《2018面向对象程序设计(Java)》第九周学习总结
  14. windows 配置域名
  15. linux虚拟机mtr不出去,如何使用MTR诊断网络问题
  16. [最新]整理目前可用的QQ机器人框架
  17. k8s使用nfs持久化存储
  18. matlab数学函数应用,数学函数论文,关于MATLAB软件在高等数学教学中的应用相关参考文献资料-免费论文范文...
  19. 动态规划典型题之——矩阵链乘法
  20. RocketMQ 原理

热门文章

  1. iOS刻度尺换算之1mm等于多少像素理解
  2. 罗克韦尔AB PLC RSLogix模拟量IO模块基本介绍
  3. 投资的N种认偏差总有款打败你
  4. redis-cluster环境搭建
  5. 在windows上搭建DZ(Discuz)论坛-部署完成
  6. 电脑水冷风扇转速太高怎么调?
  7. 在vue中使用Echarts的3D柱状图
  8. KISSY基础篇乄KISSY之IO前奏
  9. 2022CTF培训(十一)IOT 相关 CVE 漏洞分析
  10. import os总结