JDOJ-2196: 级数求和

[文章目录]

Description

给定正整数K,求关于N的不等式

1+1/2+1/3+⋯+1/N>K

的最小正整数解。

神一般的打表。(另类思路233)

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define LL long long
int k;
LL a[100]={1,2,4,11,31,83,227,616,1674,4550,12367,33617,91380,248397,
675214,1835421,4989191,13562027,36865412,100210581,272400600,740461601};
int main()
{
	scanf("%d",&k);
	printf("%lld",a[k]);
	return 0;
}

发表评论

邮箱地址不会被公开。 必填项已用*标注