当前位置:网站首页>Hdu1573 x problem [univariate linear congruence equations]
Hdu1573 x problem [univariate linear congruence equations]
2022-07-27 19:40:00 【51CTO】
Topic link :
http://acm.hdu.edu.cn/showproblem.php?pid=1573
The main idea of the topic :
It is less than or equal to N How many of the positive integers of X Satisfy :X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2],
…, X mod a[i] = b[i], … (0 < a[i] <= 10).
Ideas :
Let's find the array first b[] The least common multiple of all numbers in lcm, Then solve the one variable Linear Congruence Equations in lcm The solution in the range is a, Topic
solve x Is less than or equal to N The positive integer , Then inequality can be listed :a + lcm * x <= N. that , If a = 0, The answer is x-1, If
a != 0, The answer is x.
AC Code :
边栏推荐
- Webmagic+selenium+chromedriver+jdbc grabs data vertically.
- opds sql 里面可以用set 定义局部变量吗
- To create a MySQL data source resource group, you must choose to create a new exclusive data integration resource group? Or use a common resource group? thank you
- ReferenceError: __dirname is not defined in ES module scope
- Kettle separate and merge records
- Kettle JVM memory setting - the effect is not obvious
- Make your chat bubbles colorful
- I want to consult. Our maxcompute spark program needs to access redis, development environment and production environment redis
- c语言:11、管道
- C language: 14. Preprocessing
猜你喜欢

Kettle switch / case control to realize classification processing

Original pw4203 step-down 1-3 lithium battery charging chip

C language: 14. Preprocessing

嵌入式C语言结构体

C language: 5. Multidimensional array

Kettle separate and merge records

C语言案例:密码设置及登录> 明解getchar与scanf

c语言:14、预处理

来一遍《剑指Offer》03. 数组中重复的数字

C language: 13. Pointer and memory
随机推荐
rxbinding
成本高、落地难、见效慢,开源安全怎么办?
Can set be used to define local variables in OPDS SQL
细数国产接口协作平台的六把武器!
OPPO发布首款AR眼镜,宣布未来3年投入500亿进行研发
C language preprocessing instruction
开启和禁用hyper-v
c语言:12、gdb工具调试c程序
来一遍《剑指Offer》03. 数组中重复的数字
Programming jump
IEC104 规约详细解读(二)交互流程以及协议解析
c语言:6、指针的简单使用与注意事项
C language: 12. GDB tool debugging C program
【华为云Stack】【大架光临】第13期:管理区解耦架构见过吗?帮政企客户搞定大难题
2022 Ningde Vocational College Teachers' practical teaching ability improvement training - network construction and management
rxbinding
C language: 15. Structure
C language: 14. Preprocessing
c语言:7、c语言多源码文件使用方法
大佬们,ORACLE CDC,本地运行,老是遇到这个An exception occurred in