10852022-02-28 13:01:41peti1234Blokk eliminációcpp14Wrong answer 0/5025ms9832 KiB
#include <bits/stdc++.h>

using namespace std;
int w, n;
int main()
{
    cin >> w;
    srand(time(0));
    while (w--) {
        string s;
        vector<int> sz;
        cin >> s;
        cout << (w==0 ? "NEM" : "IGEN") << "\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/02ms1740 KiB
2Wrong answer0/023ms3596 KiB
3Wrong answer0/21ms2836 KiB
4Wrong answer0/21ms2840 KiB
5Wrong answer0/21ms2848 KiB
6Wrong answer0/21ms2844 KiB
7Wrong answer0/21ms2852 KiB
8Wrong answer0/21ms2860 KiB
9Wrong answer0/21ms2856 KiB
10Wrong answer0/21ms2864 KiB
11Wrong answer0/21ms2876 KiB
12Wrong answer0/21ms2884 KiB
13Wrong answer0/22ms2900 KiB
14Wrong answer0/23ms3092 KiB
15Wrong answer0/33ms3184 KiB
16Wrong answer0/33ms3284 KiB
17Wrong answer0/325ms4928 KiB
18Wrong answer0/325ms5916 KiB
19Wrong answer0/324ms6896 KiB
20Wrong answer0/324ms7936 KiB
21Wrong answer0/423ms8916 KiB
22Wrong answer0/423ms9832 KiB