204352026-01-06 18:25:28algoproBlokk eliminációcpp17Wrong answer 14/5032ms892 KiB
// UUID: 97873e4e-0a49-42d1-89a1-6c215a976103
#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 = -n*2 , r = n*3+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/01ms316 KiB
2Accepted0/030ms756 KiB
3Accepted2/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms384 KiB
6Wrong answer0/21ms508 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/22ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/21ms316 KiB
12Wrong answer0/21ms332 KiB
13Accepted2/21ms316 KiB
14Wrong answer0/24ms452 KiB
15Wrong answer0/34ms316 KiB
16Accepted3/34ms316 KiB
17Wrong answer0/332ms772 KiB
18Wrong answer0/328ms824 KiB
19Accepted3/330ms828 KiB
20Wrong answer0/332ms844 KiB
21Wrong answer0/428ms892 KiB
22Accepted4/432ms756 KiB