当前位置:网站首页>Nefu119 combinatorial prime [basic theorem of arithmetic]
Nefu119 combinatorial prime [basic theorem of arithmetic]
2022-07-27 14:56:00 【51CTO】
Topic link :
http://acm.nefu.edu.cn/JudgeOnline/problemshow.php?problem_id=119
The main idea of the topic :
Here are two integers N and P, Find out C(2*N,N) Prime number p The number of integers .
Ideas :
By the nature of the fundamental theorem of arithmetic (5) available N! Prime number P The number of divisions .
Look at this question ,C(2*N,N) = (2*N)! / (N! * N!). The end result is from (2*N)! Can be primed P Divisible
Subtract N! The number of times that can be divided by prime numbers *2. The final result is :
[2*N/P] + [2*N/P^2] + … + [2*N/P^t] - 2*([N/P] + [N/P^2] + … + [N/P^t]).
The number of times t = logP(2*N), namely log10(2*N) / log10(P).
AC Code :
边栏推荐
- @Repository详解
- 数据库使用psql及jdbc进行远程连接,不定时自动断开的解决办法
- Chinese character style transfer --- antagonistic discriminative domain adaptation (L1)
- 正则表达式:邮箱匹配
- OBS advanced DXGI acquisition screen process, and how to modify it to its own cursor
- FPGA时序约束分享04_output delay 约束
- SkyWalking分布式系统应用程序性能监控工具-中
- 【云享读书会第13期】视频文件的封装格式
- < C> C language hash table usage
- 如果我们是那晚负责修复 B 站崩了的开发人员
猜你喜欢

@What happens when bean and @component are used on the same class?

Toward Fast, Flexible, and Robust Low-Light Image Enhancement(实现快速、灵活和稳健的弱光图像增强)CVPR2022

巨形象的图解 SQL

JS 疫情宅在家,学习不能停,七千字长文助你彻底弄懂原型与原型链

Summary of basic knowledge of C language

一文搞懂 Redis 架构演化之路

Navicate reports an error access violation at address 00000000

@Bean 与 @Component 用在同一个类上,会发生什么?

图解 SQL,这也太形象了吧

Simple encapsulation steps of request data request of uniapp
随机推荐
JS epidemic at home, learning can't stop, 7000 word long text to help you thoroughly understand the prototype and prototype chain
一文搞懂 Redis 架构演化之路
Architecture - the sublimation of MVC
MySQL save data prompt: out of range value for column error
DXGI 方式采集流程
codeforces 1708E - DFS Trees
Summary of basic knowledge of C language
通过VN1630/VN7640的I/O功能来确认电源设置电压的时间精确度
炒黄金开户平台有没有正规,安全的
Web页面table表格,实现快速筛选
CPU、GPU、NPU的区别
【STM32】EXTI
Confirm the time accuracy of the power supply setting voltage through the i/o function of vn1630/vn7640
【云享读书会第13期】视频文件的封装格式
Graphical SQL is too vivid
Lesson 3: SPFA seeking the shortest path
Lecture 4: Longest ascending substring
2022 Niuke multi School II_ E I
Unity3d learning note 10 - texture array
Why is there no unified quotation for third-party testing fees of software products?