Cod sursa(job #3341036)

Utilizator Ilie_MityIlie Dumitru Ilie_Mity Data 17 februarie 2026 17:47:31
Problema Bowling Scor 20
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.7 kb
// Ilie "The-Winner" Dumitru
// Dumnezeu sa o ierte
#include<bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define err(...) fprintf(stderr, __VA_ARGS__)
using ll=long long;
using dbl=long double;
constexpr int NMAX=100'005;
constexpr ll MOD=1'000'000'007;

int main()
{
	FILE* f=fopen("bowling.in", "r"), *g=fopen("bowling.out", "w");
	int _, i, N, xr, cnt, x;

	fscanf(f, "%d", &_);
	do
	{
		fscanf(f, "%d", &N);
		for(i=cnt=xr=0;i<N;++i)
		{
			fscanf(f, "%d", &x);
			if(x)
				++cnt;
			else
			{
				xr^=cnt%3;
				cnt=0;
			}
		}
		xr^=cnt%3;
		cnt=0;

		if(xr)
			fprintf(g, "Nargy\n");
		else
			fprintf(g, "Fumeanu\n");
	}while(--_);

	fclose(f);
	fclose(g);
	return 0;
}