Logo
(追記) (追記ここまで)

16406번 - Exam 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB46032829975.696%

문제

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

예제 출력 1

2

예제 입력 2

6
TTFTFFTFTF
TTTTFFTTTT

예제 출력 2

9

힌트

출처

ICPC > Regionals > North America > Mid-Central Regional > 2018 Mid-Central Regional Programming Contest B번

ICPC > Regionals > North America > Southeast USA Regional > 2018 Southeast USA Regional Programming Contest > Division 1 C번

ICPC > Regionals > North America > Southeast USA Regional > 2018 Southeast USA Regional Programming Contest > Division 2 A번

ICPC > Regionals > North America > Pacific Northwest Regional > 2018 Pacific Northwest Region Programming Contest > Division 1 A번

ICPC > Regionals > North America > Pacific Northwest Regional > 2018 Pacific Northwest Region Programming Contest > Division 2 N번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /