相关文章
#P05804. 伪素数
这道题考的是费马小定理和快速幂。
思路:
首先, 我们要判断输入的数是否为素数。如果是,说明它必定不是基于a的伪素数。(因为它本身就是一个素数啊!)
如果不是,就要用到费马小定理了。因为如果P是一个素数,则对于a&…
建站知识
2025/2/8 11:48:37
zcmu 1009: Patties
Description Petya is well-known with his famous cabbage patties. Petya’s birthday will come very soon, and he wants to invite as many guests as possible. But the boy wants everybody to try his specialty of the house. That’s why he needs to know the numbe…
建站知识
2025/2/8 11:50:32
3008 前m大的数
问题描述:
还记得Gardon给小希布置的那个作业么?(上次比赛的1005)其实小希已经找回了原来的那张数表,现在她想确认一下她的答案是否正确,但是整个的答案是很庞大的表,小希只想让你把答案中最大…
建站知识
2025/3/8 17:44:12
PTA 甲 1009
1009 Product of Polynomials
作者 CHEN, Yue
单位 浙江大学
This time, you are supposed to find AB where A and B are two polynomials.
Input Specification:
Each input file contains one test case. Each case occupies 2 lines, and each line contains the info…
建站知识
2025/2/8 9:00:56