10862022-02-28 13:02:09peti1234Blokk eliminációcpp14Wrong answer 0/5032ms9836 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==1 ? "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
1Wrong answer0/02ms1736 KiB
2Wrong answer0/023ms3624 KiB
3Wrong answer0/21ms2816 KiB
4Wrong answer0/21ms2820 KiB
5Wrong answer0/21ms2824 KiB
6Wrong answer0/21ms2824 KiB
7Wrong answer0/21ms2828 KiB
8Wrong answer0/21ms2832 KiB
9Wrong answer0/21ms2840 KiB
10Wrong answer0/21ms2840 KiB
11Wrong answer0/21ms2856 KiB
12Wrong answer0/21ms2872 KiB
13Wrong answer0/21ms2876 KiB
14Wrong answer0/23ms3068 KiB
15Wrong answer0/33ms3168 KiB
16Wrong answer0/34ms3272 KiB
17Wrong answer0/325ms4916 KiB
18Wrong answer0/324ms5964 KiB
19Wrong answer0/325ms6884 KiB
20Wrong answer0/324ms7864 KiB
21Wrong answer0/424ms8852 KiB
22Wrong answer0/432ms9836 KiB