Nội dung Bài tập
- Mã:
- OLP19.Cau1.Exam
- Tên:
- OLP19.Cau1.Exam
- Dạng thi:
- oi
- Thang điểm:
- 100 điểm
- Giới hạn thời gian:
- 1 giây
- Giới hạn bộ nhớ:
- 256 MB
- Được tạo bởi:
- thuthq
Your friend and you took a true/false exam of n questions. You know your answers, your friend's
answers, and that your friend got k questions correct.
Compute the maximum number of questions you could have gotten correctly.
Input
The rst line of input contains a single integer k.The second line contains a string of n (1 <= n <= 1000) characters, the answers you wrote down.Each letter is either a `T' or an `F'.The third line contains a string of n characters, the answers your friend wrote down. Each letteris either a `T' or an `F'.The input will satisfy 0 <= k <= n.
Output
Print, on one line, the maximum number of questions you could have gotten correctly.
Sample Input and Output:
Input
Output
3
FTFFF
TFTTT
2
Input
Output
6
TTFTFFTFTF
TTTTFFTTTT
9
Theme :
Mời bạn soạn code
Ai có thể xem bài này :
Thông tin
Phần thảo luận