
******数论******
文章平均质量分 82
Ever_glow
当命运需要你逆风飞翔的时候,就不能随风而去。
展开
-
HDU 1019 Least Common Multiple
题目链接:点击打开链接题目要求求n个数的最小公约数,可以依次求出每个数的最大公倍数,然后两数相乘再除以gcd。开始是数组接受后遍历,莫名其秒WA两次,又放在输入中直接求的,就过了,可能有小细节没处理好。有用到欧几里得算法。下面是大神对欧几里得算法以及扩展欧几里得的解释。点击打开链接代码实现:#include#include#includeusing name原创 2017-05-13 16:42:03 · 337 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛 G Give Candies (欧拉降幂)
There are N children in kindergarten. Miss Li bought them N candies. To make the process more interesting, Miss Li comes up with the rule: All the children line up according to their student number (1...原创 2018-09-15 19:57:35 · 488 阅读 · 0 评论 -
AtCoder Grand Contest 025 B - RGB Coloring(组合数学+逆元)
B - RGB ColoringTime limit : 2sec / Memory limit : 1024MBScore : 700 pointsProblem StatementTakahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, gr原创 2018-06-04 19:37:37 · 577 阅读 · 3 评论 -
“浪潮杯”山东省第6届acm省赛 SDUT 3257 Cube Number (分解质因数)
Cube Number 2000 ms 65536 KiBAccepted/Submissions: 3/38 (7.89%)Submit Status Statistics OriginDescriptionIn mathematics, a cube number is an integer that is the cube原创 2018-05-03 13:23:25 · 248 阅读 · 0 评论 -
HDU 6063 RXD and math (数论+快速幂)
RXD and mathTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1363 Accepted Submission(s): 747Problem DescriptionRXD is a good mathematician.One day he wants to calculate:∑i=1nkμ2(i)×⌊nki−原创 2017-10-05 10:55:19 · 748 阅读 · 0 评论 -
HDU 5514 Frogs (容斥+数论)
FrogsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2810 Accepted Submission(s): 904Problem DescriptionThere are m stones lying on a circle, and n frogs are jumping over them.The stones ar原创 2017-10-02 17:04:04 · 1068 阅读 · 0 评论 -
BZOJ 1072 [SCOI2007]排列perm (状态压缩+dp+同余定理)
1072: [SCOI2007]排列permTime Limit: 10 Sec Memory Limit: 128 MBSubmit: 2537 Solved: 1583[Submit][Status][Discuss]Description 给一个数字串s和正整数d, 统计s有多少种不同的排列能被d整除(可以有前导0)。例如123434有90种排列能被2整除,其中末位为2的有30种,末位为4的有60种。Input 输入第一行是一个整数T,表示测试数据的个数,以下每行一组s原创 2017-10-09 17:35:57 · 669 阅读 · 0 评论 -
BZOJ 1024 生日快乐 (dfs)
传送门:点击打开链接1024: [SCOI2009]生日快乐Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2885 Solved: 2101[Submit][Status][Discuss]Description windy的生日到了,为了庆祝生日,他的朋友们帮他买了一个边长分别为 X 和 Y 的矩形蛋糕。现在原创 2017-09-07 21:37:41 · 825 阅读 · 0 评论 -
Educational Codeforces Round 26 E. Vasya's Function(数论)
E. Vasya's Functiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is studying number theory. He has denoted a function f(a, b) such that:f(a, 0) = 0;f(a, b) = 1 + f(a, b - gcd(a, b)), wher原创 2017-08-06 09:29:52 · 747 阅读 · 0 评论 -
codeforce B. Cutting Carrot
Igor the analyst has adopted n little bunnies. As we all know, bunnies love carrots. Thus, Igor has bought a carrot to be shared between his bunnies. Igor wants to treat a原创 2017-05-14 10:08:44 · 1166 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛 L Poor God Water (BM算法)
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poisonous.Every hour, God Water will eat one kind of fo...原创 2018-09-15 20:05:10 · 782 阅读 · 0 评论