10832022-02-28 13:00:06peti1234Blokk eliminációcpp14Wrong answer 0/5026ms9876 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/02ms1752 KiB
2Wrong answer0/023ms3652 KiB
3Wrong answer0/21ms2884 KiB
4Wrong answer0/21ms2888 KiB
5Wrong answer0/21ms2884 KiB
6Wrong answer0/21ms2892 KiB
7Wrong answer0/21ms2896 KiB
8Wrong answer0/21ms2896 KiB
9Wrong answer0/21ms2908 KiB
10Wrong answer0/21ms2908 KiB
11Wrong answer0/21ms2916 KiB
12Wrong answer0/21ms2928 KiB
13Wrong answer0/22ms2940 KiB
14Wrong answer0/23ms3132 KiB
15Wrong answer0/33ms3232 KiB
16Wrong answer0/33ms3328 KiB
17Wrong answer0/323ms4976 KiB
18Wrong answer0/324ms5956 KiB
19Wrong answer0/324ms7004 KiB
20Wrong answer0/324ms7920 KiB
21Wrong answer0/424ms8900 KiB
22Wrong answer0/426ms9876 KiB