51nod 1070 Bash游戏 V4

这种博弈题  都是打表找规律 可我连怎么打表都不会 

这个是凑任务的吧....以后等脑子好些了 再琢磨吧

就是斐波那契数列中的数 是必败态

#include<bits/stdc++.h>
using namespace std;
map<long long ,int> mp;

void init()
{
    mp.clear();
    long long a=1,b=1;
    while (a < 1e9+1000)
    {
        mp[a]++;
        a = a+b;
        b = a-b;
    }
}
int main()
{
    init();
    int t;
    scanf("%d",&t);
    while (t--)
    {
        int n;
        scanf("%d",&n);
        if(mp[n])
            puts("B");
        else
            puts("A");
    }
}
原文地址:https://www.cnblogs.com/Draymonder/p/7417719.html