HDU 5051 Fraction 本福特定律

该博客主要探讨了HDU 5051 Fraction题目,涉及本福特定律的应用。博主指出,当数列a[]满足ai = b*q^i,且q不为特定值时,数列符合本福特定律,可以用来计算n作为a[]前缀的概率。文章表达了对出题者使用非常见知识点的调侃。
摘要由CSDN通过智能技术生成

【题目大意】

给定n,b,q。对于无限长数列的a[],ai = b*q^i。问n是ai的前缀的概率。

【思路】

本题需要的知识点只有一个:本福特定律。(p.s. 我真想打死出题人,平时出出物理题就够了,现在出了个从来没有听过的本福特定律。。。)

只要q不为1,10,100,1000,就可以认为a[]数列是“一堆从实际生活得出的数据”。。。

//#pragma comment(linker, "/STACK:102400000,102400000")
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<cmath>
#include<cctype>
#include<string>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<map>
#include<set>
using namespace std;
#define MP(x,y) make_pair((x),(y))
#define PB(x) push_back(x)
typedef __int64 LL;
//typedef unsigned __int64 ULL;
/* ****************** */
const int INF=100011122;
const double INFF=1e100;
const double eps=1e-8;
//const LL mod=1000000007;
const int NN=100010;
const int MM=2000010;
/* **************
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值