当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3747:Download

题目描述
Computer networks, the widespread sharing of information among groups of computers and their users, are a central part of the information age. In this age, every local personal computer(PC) can download applications and documents from the distance database, which makes it convenient to our entertainment by using the internet.

CC is a such fanatical lover of TV plays. Each TV play is consisted by a lot number of sections. When he open his download software and select one of his favourite TV plays, a "section selected window" jumped out. "Please mark the sections you want to download~".

Each section has its CheckBox to be marked stands for choosing this section or not.
There are two special buttons as follow:
1, All-clicked: you can mark all of section with '√' by click this button.
2, Inverse-clicked: you can change each section to its inverse state by click this button.

At first, the state of each section is in disorder, and there is no need to CC to download all of the sections in this TV play. When he are about to begin his crazy clicking, he come up with a good idea that finding the minimum times of click by programming. Now he tell you the information of the original download window, can you tell him how many click times at least to choose the sections he wants to download.
输入解释
Input contains multiple test cases. Each test case contains three lines:
The first line contains only one number N (5 <= N <= 50) indicating the total number of sections.
The second line is a string S only consisted by '0' and '1', the ith charactor is stand for the ith section of TV play, '1' is stand for the '√' state and '0' is not.
The third line is a string T, just like S, it shows the sections CC wants to download.
You can assume the length of S and T are equal to N.
输出解释
For each case, you are required to output the minimum count of clicks to choose the expected section(s).
输入样例
5
00010
10111
5
10101
01010
输出样例
2
1
来自杭电HDUOJ的附加信息
Author possessor WC
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3747

最后修改于 2020-10-25T23:06:37+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)