Tag: Codeforces Round #409

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (A) Vicious Keyboard Solution In C/C++

#include <stdio.h> int ans,l,i; int main() { char ch; scanf(“%s”,ch); for( ; ch; i++) { l++; if(ch==’V’ && ch==’K’) ans++,ch=’#’,ch=’#’,i++; } l++; for(i=0; ch; i++) { if((ch==’V’ && ch==’V’) || (ch==’K’&&ch==’K’)) { ans++; break; } } printf(“%d”,ans); } 📦 Looking...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!