2017广西邀请赛重现赛

总题解:http://www.nike0good.com/674.html

1001:

2017ACM/ICPC广西邀请赛-重现赛 1001 A Math Problem

#include <iostream>
#include <cstdio>
#define  ull unsigned long  long
using namespace std;

ull fac[17];

void fuc()
{
    for(int i=1;i<=15;i++)
    {
        ull x=1;
        for(int j=1;j<=i;j++)
            x*=i;
        fac[i]=x;
    }
}

int main()
{
    fuc();
    ull n;
    int ans=-1;
    while(scanf("%llu",&n)!=EOF)
    {
        for(int i=1;i<=15;i++)
        {
            if(fac[i]>n)
            {
                ans=i-1;
                break;
            }
            if(fac[i]==n)
            {
                ans=i;
                break;
            }
        }
        if(ans==-1)
            ans=15;
        printf("%d\n",ans);
    }
    return 0;
}
1001

E:广西2017邀请赛 Problem E CS Course

 

2017广西邀请赛CS Course(&|^位运算模拟)

Build A tree :http://blog.csdn.net/my_sunshine26/article/details/77750130

posted @ 2017-08-31 18:59  Roni_i  阅读(167)  评论(0编辑  收藏  举报