The Billion Pi Challenge

探讨如何在π的十亿位小数中高效查找特定数字序列的方法,采用空间换时间的策略建立滑动窗口索引来优化搜索速度。

Check out The Billion Pi Challenge on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

https://nullprogram.com/blog/2014/09/18/The Billion Pi Challenge:如何高效的在 pi 的十亿位小数中查找特定的数字序列?文中的假设:不要求完全精确(例如某个序列出现了一万次,可以只返回其中的一千次)文中的解法:- 空间换时间,用固定长度的滑动窗口建立索引(长度为n的序列 -> 出现位置的列表)- 为了优化速度,整个索引存储在内存中,且可以用不同的滑窗长度多次建立索引(3,6,8...);- 如果用户输入的序列长度和已有的索引长度不匹配,过短的填充(12345 -> 123450~123459),过长的先截取符合最长滑窗长度的前n位,缩小可能出现的位置数量,再回到原始的小数文件中逐个确认

Latest Weekly Picks

make.ink favicon
Weekly Pick

Your AI tattoo generator for pro-grade concepts

Leo Wade
sellfy.com favicon
Weekly Pick

A code-free online store builder to turn views into revenue. Sell digital products, subscriptions, and merch, without fees or hassle.

Maris
www.videotoblog.ai favicon
Weekly Pick

Convert videos into awesome blog posts.

Video To Blog
www.sellerpic.ai favicon
Weekly Pick

SellerPic is the all-in-one AI design platform for e-commerce

SellerPic
fastimage.ai favicon
Weekly Pick

Fast Image AI instantly transforms your photos into stunning styles like Ghibli, Sketch, and Pixar. Effortlessly control image elements and create amazing effects with just one click.

Fast AI Team
linkedinpro.daisy.so favicon
Weekly Pick

AI-powered tool that transforms casual photos into professional LinkedIn headshots instantly. No photographer needed—just upload and download.

Gabriel
crevas.ai favicon
Weekly Pick

Crevas unifies Veo 3, Sora 2, Nano Banana and more into one intuitive canvas — so filmmakers can script, prompt, and generate cinematic stories without switching tools or losing consistency.

Spark Alpha
fotominiatur.com favicon
Weekly Pick

AI Foto Edit - Text to Image & Image Edit

foto miniatur