204342026-01-06 18:24:11algoproBlokk eliminációcpp17Wrong answer 14/5032ms848 KiB
// UUID: a984f074-a521-484b-87ef-a932c53fa772
#include <bits/stdc++.h>
using namespace std;

int main() {
	int t; cin >> t;
	while(t--){
		string a; cin >> a;
		vector<bool> b;
		int w = -1 , v = 0;
		for(char x : a){
			if(w != -1 && x-'0'!=w){
				b.push_back(v-1);
				v=0;
			}
			v++;
			w = x-'0';
		}
		b.push_back(v);
		int n  = b.size();
		int l = -1 , r = n+1;
		for(int i = 0; i < n; i++){
			if(!b[i])continue;
			if(i <= n/2)l = max(l , i);
			if(i >= n/2)r = min(r , i);
		}
		cout << (r-l-1 <= n/2?"IGEN\n":"NEM\n");
	}
}
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/01ms508 KiB
2Accepted0/030ms840 KiB
3Accepted2/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/21ms540 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/22ms316 KiB
12Wrong answer0/21ms316 KiB
13Accepted2/21ms316 KiB
14Wrong answer0/24ms316 KiB
15Wrong answer0/34ms468 KiB
16Accepted3/34ms452 KiB
17Wrong answer0/332ms788 KiB
18Wrong answer0/328ms824 KiB
19Accepted3/330ms788 KiB
20Wrong answer0/332ms832 KiB
21Wrong answer0/428ms796 KiB
22Accepted4/432ms848 KiB