10822022-02-28 12:59:43peti1234Blokk eliminációcpp14Wrong answer 0/5025ms9812 KiB
#include <bits/stdc++.h>

using namespace std;
int w, n;
int main()
{
    cin >> w;
    while (w--) {
        string s;
        vector<int> sz;
        cin >> s;
        int valasz=rand()%2;
        cout << (valasz ? "IGEN" : "NEM") << "\n";
        continue;
        int cnt=1;
        for (int i=1; i<s.size(); i++) {
            if (s[i]==s[i-1]) cnt++;
            else {
                sz.push_back(cnt>1);
                cnt=1;
            }
        }
        sz.push_back(cnt>1);
        n=sz.size();
        if (n%2) {
            int cnt=0, maxi=0;
            for (auto x:sz) {
                if (!x) {
                    cnt++;
                    maxi=max(maxi, cnt);
                } else cnt=0;
            }
            cout << (sz[(n-1)/2] || 2*maxi+1<n ? "IGEN" : "NEM") << "\n";
        } else {
            vector<int> jo(n, 0);
            bool s=0;
            int cnt=0, maxi=0;
            for (int i=0; i<n; i++) {
                if (!sz[i]) {
                    cnt++;
                    maxi=max(maxi, cnt);
                } else cnt=0;
                if (i%2==0 && (sz[i/2] || 2*maxi<i)) jo[i]=1;
            }
            cnt=0, maxi=0;
            for (int i=n-1; i>=1; i--) {
                if (!sz[i]) {
                    cnt++;
                    maxi=max(maxi, cnt);
                } else cnt=0;
                int db=n-1-i;
                if (jo[i-1] && (sz[i+db/2] || 2*maxi<db)) s=1;
            }
            cout << (s ? "IGEN" : "NEM") << "\n";
        }
    }
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/02ms1736 KiB
2Wrong answer0/024ms3584 KiB
3Wrong answer0/21ms2816 KiB
4Wrong answer0/21ms2824 KiB
5Wrong answer0/21ms2828 KiB
6Wrong answer0/21ms2832 KiB
7Wrong answer0/21ms2832 KiB
8Wrong answer0/21ms2840 KiB
9Wrong answer0/21ms2840 KiB
10Wrong answer0/21ms2844 KiB
11Wrong answer0/22ms2864 KiB
12Wrong answer0/22ms2868 KiB
13Wrong answer0/22ms2880 KiB
14Wrong answer0/24ms3068 KiB
15Wrong answer0/34ms3168 KiB
16Wrong answer0/33ms3268 KiB
17Wrong answer0/324ms4920 KiB
18Wrong answer0/325ms5904 KiB
19Wrong answer0/324ms6876 KiB
20Wrong answer0/325ms7920 KiB
21Wrong answer0/425ms8836 KiB
22Wrong answer0/425ms9812 KiB