31442023-02-20 11:42:02TuruTamasBlokk eliminációcpp11Wrong answer 0/5048ms64844 KiB
#include <bits/stdc++.h>
using namespace std;
bool good = false;
vector<bool> blokkok;

void checkIfGood(int loc) {
    if (loc == blokkok.size()) good = true;
    for (size_t i = loc; i <= (blokkok.size()-loc)/2; i++)
    {
        if (blokkok[i]) checkIfGood(i + i-loc);
    }
    
}

int main() {
    int T;
    cin >> T;
    string line;
    for (int i = 0; i < T; ++i) {
        blokkok.clear();
        cin >> line;
        for (int i = 0; i < line.size(); ++i) {
            if (line[i] == line[i+1]) {
                blokkok.push_back(true);
                char start = line[i];
                for (; line[i] == start && i < line.size(); i++){}
            }
            else {
                blokkok.push_back(false);
            }
        }
        checkIfGood((0));
        if (good) {
            cout << "IGEN";
        }
        else {
            cout << "NEM";
        }
        good = false;
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1812 KiB
2Runtime error0/039ms64844 KiB
3Wrong answer0/23ms2240 KiB
4Runtime error0/235ms64412 KiB
5Runtime error0/234ms64176 KiB
6Runtime error0/234ms63936 KiB
7Runtime error0/234ms63908 KiB
8Runtime error0/228ms63672 KiB
9Runtime error0/234ms63436 KiB
10Runtime error0/228ms63216 KiB
11Runtime error0/228ms62992 KiB
12Runtime error0/228ms62984 KiB
13Runtime error0/227ms62756 KiB
14Runtime error0/228ms62520 KiB
15Runtime error0/328ms62440 KiB
16Runtime error0/327ms62432 KiB
17Runtime error0/348ms62416 KiB
18Runtime error0/348ms62404 KiB
19Runtime error0/332ms62400 KiB
20Runtime error0/337ms62396 KiB
21Runtime error0/448ms62396 KiB
22Runtime error0/437ms62388 KiB