当前位置:网站首页>Tortoise speed by "template"
Tortoise speed by "template"
2022-07-31 13:48:00 【Qin Xiaoba】
The turtle speed multiplication is used for the multiplication of large numbers, because the multiplication of large numbers will easily explode the range, so the turtle speed multiplication of "safe addition for multiplication, time for space" is adopted.Of course, you can also do not need to ride fast, you can force the conversion of __int128 bits in the place where it is easy to explode.
The code is as follows, the rule is, one multiplier is used as the base, the other is used as the exponent, and the multiplication becomes the addition
# include#include#includeusing namespace std;typedef long long int ll;#define mod 10007ll quick(ll a,ll b){ll sum=0,pow=b;while(pow){if(pow&1)sum=(sum+a)%mod;a=(a+a)%mod;pow>>=1;}return sum%mod;}int main(){int a,b;cin>>a>>b;cout< 边栏推荐
- IDEA can't find the Database solution
- 3.爬虫之Scrapy框架1安装与使用
- C#获得网卡信息 NetworkInterface IPInterfaceProperties
- Miller_Rabin Miller Rabin probability sieve [template]
- 战略进攻能力的重要性,要远远高于战略防守能力
- [Blue Bridge Cup Trial Question 46] Scratch Magnet Game Children's Programming Scratch Blue Bridge Cup Trial Question Explanation
- leetcode:2032. Values that appear in at least two arrays
- 图像大面积缺失,也能逼真修复,新模型CM-GAN兼顾全局结构和纹理细节
- go使用makefile脚本编译应用
- For enterprises in the digital age, data governance is difficult, but it should be done
猜你喜欢

C# using NumericUpDown control

技能大赛训练题:登录安全加固

图像大面积缺失,也能逼真修复,新模型CM-GAN兼顾全局结构和纹理细节

All-round visual monitoring of the Istio microservice governance grid (microservice architecture display, resource monitoring, traffic monitoring, link monitoring)

The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars

uniapp微信小程序引用标准版交易组件

C# control StatusStrip use

C#获得网卡信息 NetworkInterface IPInterfaceProperties

Linux bash: redis-server: 未找到命令

Node version switching management using NVM
随机推荐
Selenium IDE for Selenium Automation Testing
The operator,
使用CompletableFuture进行异步处理业务
3.爬虫之Scrapy框架1安装与使用
AWS implements scheduled tasks - Lambda+EventBridge
龟速乘【模板】
Spark学习:为Spark Sql添加自定义优化规则
新款现代帕里斯帝预售开启,安全、舒适一个不落
An article makes it clear!What is the difference and connection between database and data warehouse?
C# using ComboBox control
C#高级--委托
网络层重点协议——IP协议
Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"
232层3D闪存芯片来了:单片容量2TB,传输速度提高50%
Network layer key protocol - IP protocol
Golang - gin - pprof - use and safety
golang-gin - graceful restart
Miller_Rabin Miller Rabin probability sieve [template]
Controller层代码这么写,简洁又优雅!
页面整屏滚动效果