竞赛讨论区 > OI赛制测试赛2 F-假的数学游戏 打表程序
头像
AotoriChiaki
发布于 2018-09-07 12:31
+ 关注

OI赛制测试赛2 F-假的数学游戏 打表程序

打表程序
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;

typedef long long ll;
const int INF=0x3f3f3f3f;
const ll mod=1e9+7;

ll a[11],b[11];
int main()
{
    ll n=7;
    for (int e=1;e<=10;e++)
    {
        long double t=1;
        ll p=1,r=n+1;
        for (;p<=n;p++)
        {
            t*=(long double)n/(long double)p;
            while (t>r)
                t/=(long double)(r++);
        }
        b[e]=r;
        printf("%lld\n",b[e]);
        n=n*10+7;
    }
    return 0;
}

全部评论

(1) 回帖
加载中...
话题 回帖

等你来战

查看全部

热门推荐