10812022-02-28 12:58:42peti1234Blokk eliminációcpp14Wrong answer 2/5037ms9848 KiB
#include <bits/stdc++.h>

using namespace std;
int w, n;
int main()
{
    cin >> w;
    while (w--) {
        string s;
        vector<int> sz;
        cin >> s;
        cout << "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
base2/50
1Wrong answer0/02ms1740 KiB
2Wrong answer0/026ms3628 KiB
3Wrong answer0/21ms2824 KiB
4Wrong answer0/21ms2832 KiB
5Wrong answer0/21ms2832 KiB
6Wrong answer0/21ms2840 KiB
7Wrong answer0/21ms2844 KiB
8Wrong answer0/21ms2844 KiB
9Wrong answer0/21ms2848 KiB
10Accepted2/21ms2852 KiB
11Wrong answer0/21ms2868 KiB
12Wrong answer0/21ms2876 KiB
13Wrong answer0/21ms2892 KiB
14Wrong answer0/24ms3080 KiB
15Wrong answer0/34ms3184 KiB
16Wrong answer0/33ms3276 KiB
17Wrong answer0/325ms4996 KiB
18Wrong answer0/325ms5972 KiB
19Wrong answer0/324ms6896 KiB
20Wrong answer0/337ms7876 KiB
21Wrong answer0/428ms8912 KiB
22Wrong answer0/432ms9848 KiB