CF801A Vicious Keyboard
题目描述
题目背景
Tonio 有一个只有“V,K”两个键的键盘。
一天,她打出了一个只有这两个字符的字符串。当这个字符串里含有"VK"这个字符串的时候,honoka 就特别喜欢这个字符串。所以,她想改变至多一个字符(或者不做任何改变)来最大化这个字符串内"VK"出现的次数。给出原来的字符串,请计算她最多能使这个字符串内出现多少次"VK"。(只有当"V"和"K"正好相邻时,我们认为出现了"VK"。)
输入格式
第一行给出一个字符串 s。
输出格式
第一行输出一个整数代表所求答案。
说明/提示
For the first case, we do not change any letters. "VK" appears once, which is the maximum number of times it could appear.
For the second case, we can change the second character from a "V" to a "K". This will give us the string "VK". This has one occurrence of the string "VK" as a substring.
For the fourth case, we can change the fourth character from a "K" to a "V". This will give us the string "VKKVKKKKKKVVVVVVVVVK". This has three occurrences of the string "VK" as a substring. We can check no other moves can give us strictly more occurrences.