Exam
시간 제한: 2000ms메모리 제한: 512MB출처: ICPC Mid-Central Regional 2018BOJ 16406
문제
Your friend and you took the same true/false exam. You know your answers, your friend’s answers, and the number of your friend’s answers that were correct.
Compute the maximum possible score you could have gotten
입력
The first line contains a single integer k, the number of correct answers on your friend’s exam.
The second line contains a string of characters, the answers you wrote down. Each letter is either a ‘T’ or an ‘F’. The length of the string is the number n of exam questions.
The third line also contains a string of n characters, the answers your friend wrote down. Each letter is either a ‘T’ or an ‘F’.
Bounds are 0 ≤ k ≤ n ≤ 1 000; 1 ≤ n.
출력
The output is one line containing the maximum number of questions you could have gotten correct.
예제
예제 1
입력
3 FTFFF TFTTT
출력
2
예제 2
입력
6 TTFTFFTFTF TTTTFFTTTT
출력
9
코드를 제출하려면 로그인하세요.