332A - Down the Hatch - CodeForces Solution


implementation *1300

Please click on ads to support us..

C++ Code:

#include <cstdio>
#include <iostream>

int main(){

    int n; scanf("%d\n", &n);
    std::string line(""); int total(0);
    getline(std::cin, line);
    for(int k = n; k < line.size(); k += n){if(line[k - 1] == line[k - 2] && line[k-2] == line[k-3]){++total;}}
    printf("%d\n", total);
    return 0;
}
 		 	 	  	  			   	 	  	    		
  	 		 		        		   		    			


Comments

Submit
0 Comments
More Questions

41B - Martian Dollar
906C - Party
774F - Pens And Days Of Week
598B - Queries on a String
1303B - National Project
1303D - Fill The Bag
1198B - Welfare State
1739B - Array Recovery
1739C - Card Game
1739A - Immobile Knight
1739D - Reset K Edges
817B - Makes And The Product
1452C - Two Brackets
400B - Inna and New Matrix of Candies
870B - Maximum of Maximums of Minimums
1600E - Array Game
1149A - Prefix Sum Primes
277A - Learning Languages
769A - Year of University Entrance
1738A - Glory Addicts
1738C - Even Number Addicts
1064B - Equations of Mathematical Magic
384A - Coder
1738B - Prefix Sum Addicts
1352D - Alice Bob and Candies
1316D - Nash Matrix
1548B - Integers Have Friends
348A - Mafia
315B - Sereja and Array
204A - Little Elephant and Interval