首页 > 其他 > 详细

51nod 1070 Bash游戏 V4

时间:2017-08-23 14:26:29      阅读:267      评论:0      收藏:0      [点我收藏+]

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

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

 

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

 

#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");
    }
}

 

51nod 1070 Bash游戏 V4

原文:http://www.cnblogs.com/Draymonder/p/7417719.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!