当前位置:网站首页>If I make this silly mistake again/ (ㄒoㄒ)/~~
If I make this silly mistake again/ (ㄒoㄒ)/~~
2022-04-22 07:27:00 【S atur】
1. When multiplying modulo , Remember to take the module first and then multiply , Don't take the mold while multiplying , Otherwise, it may explode .
eg: HDU6961 The data range reaches 1e18, And the answer is 2*(n*(n-1))^2, If written 2*n%mod*(n-1)%mod*n%mod*(n-1)%mod It's likely to explode in the middle of a multiplication operation long long .
2. When it comes to the multiplication and division of floating-point numbers, we must pay attention to the problem of accuracy .
eg: Cattle guest 2021 Summer multi school 3 Of F, The process involves 8*(3-8/3)==24? There will be accuracy problems , Take advantage of x-y<=1e6 This method will be more intuitive and effective .
版权声明
本文为[S atur]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220616059340.html
边栏推荐
- C language | pointer
- LeetCode - 6 - (字符串相乘、下一個更大元素<ⅠⅡⅢ>、k個一組翻轉鏈錶)
- 面试官常问的,对象分配的一般过程及特殊情况
- Some mechanisms of synchronized lock optimization (lock upgrade)
- [number theory] congruence (III): univariate linear congruence equation
- Introduction
- (5) Use Navicat to create database data table and set ID auto increment
- 867 · 四键键盘
- 微软实习生面试的2道算法题目——20220119
- [number theory] congruence (I): basic concepts and properties of congruence
猜你喜欢

LeetCode - 5 - (重复的子字符串<kmp>、最长回文子串、转置矩阵、二叉树的(左右)视图)
![P1095 [NOIP2007 普及组] 守望者的逃离](/img/5e/0437bdee83b6b66626e535e382b84b.png)
P1095 [NOIP2007 普及组] 守望者的逃离

Interviewers often ask about the general process and special circumstances of object allocation

顺序表 增删查(找)

Beyond compare solution to "authorization key has been revoked"

L2-001 紧急救援 (最短路Dijkstra的扩展 - 最短路径数&路径最大权值)

内部类使用说明(静态、实例、局部)

synchronized锁优化的一些机制(锁升级)

When latex uses the template, the caption title of the picture cannot be left aligned

LeetCode - 7 - (二叉树的最近公共祖先、轮转数组、二叉树的直接、下一个排列、组合总和)
随机推荐
快排与归并排序
【数论】同余(四):一元线性同余方程组(两两相消、中国剩余定理)
2021学习计划
【数论】欧拉函数(基本性质、递推法、公式法、线性筛法)
This关键字详细概述
[number theory] prime number (V): Mason prime number (lucas_lehmer decision method)
Educational Codeforces Round 125 (Rated for Div. 2)
(1) Download and installation of SQL Server
(4) Character set in SQL Server (collation)
链表难题记录一
Byte Summer Internship - 20220304
小题记录——
What is socket programming?
区间求和的问题——差分
Relationship between A5 transceiver signal VOD and pre emphasis adjustment
Redis advanced
1420 · 最小覆盖子串II
重写与重载的定义与区别
链表习题详解
instanceof的使用说明及实例讲解