204372026-01-06 18:28:50algoproBlokk eliminációcpp17Wrong answer 14/5032ms1040 KiB
// UUID: db50061f-c677-4075-8271-4f4ebd35b453
#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-1);
		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/21ms400 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/21ms316 KiB
10Wrong answer0/21ms324 KiB
11Wrong answer0/22ms316 KiB
12Wrong answer0/21ms316 KiB
13Accepted2/21ms316 KiB
14Wrong answer0/24ms508 KiB
15Wrong answer0/34ms316 KiB
16Accepted3/34ms316 KiB
17Wrong answer0/332ms844 KiB
18Wrong answer0/328ms792 KiB
19Accepted3/330ms828 KiB
20Wrong answer0/332ms816 KiB
21Wrong answer0/429ms1040 KiB
22Accepted4/432ms988 KiB