Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- int main() {
- unsigned int N;
- cin >> N;
- vector<bool> answer(N, true);
- for (int i = 0; i < N; ++i) {
- string in;
- cin >> in;
- for (int j = 0; j < in.size(); ++j) {
- int count = 0;
- int lastChar = in[j];
- int times = 0;
- while (count < in.size()) {
- if (in[j + count] == lastChar) {
- times++;
- if (times % 3 == 0) {
- for (int k = j + count; k >= in.size() || k < j + count + times / 3; ++k) {
- if (in[k] != lastChar) {
- answer[j] = false;
- goto stop;
- }
- }
- }
- }
- count++;
- }
- stop:
- continue;
- }
- }
- for (int l = 0; l < answer.size(); ++l) {
- cout << answer[l] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement