Cod sursa(job #2018038)

Utilizator vladttturcuman vlad vladtt Data 3 septembrie 2017 12:59:18
Problema Bowling Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.91 kb
//
//  A.cpp
//  Bowling - Infoarena
//
//  Created by Vlad Turcuman on 03/09/2017.
//  Copyright © 2017 Vlad Turcuman. All rights reserved.
//

#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <vector>
#include <cmath>
#include <map>

#define pii pair<int,int>
#define fs first
#define sc second
#define NMax 1001

using namespace std;

int main()
{
    int n,k;
    cin>>k;
    
    while(k--)
    {
        cin>>n;
        int s = 0;
        int st = 1;
        int a;
        for(int i=1;i<=n;i++)
        {
            cin>>a;
            if(a == 0)
            {
                if(i-st)
                    s = s ^ (i-st);
                st = i+1;
                
            }
        }
        
        if(n+1-st)
            s = s ^ (n+1-st);
        
        if(s)
            cout<<"Nargy"<<'\n';
        else
            cout<<"Fumeanu"<<'\n';
        
    }
    return 0;
}