Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdio>
- #include <vector>
- #include <algorithm>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n;
- string s;
- cin >> n;
- getline(cin, s);
- getline(cin, s);
- int ans = 0;
- for (int i = n; i < s.length(); i += n)
- if (s[i - 1] == s[i - 2] && s[i - 2] == s[i - 3])
- ++ans;
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement