![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
---- 数论or数学 ----
文章平均质量分 86
叶孤心丶
这个作者很懒,什么都没留下…
展开
-
HDU 2035 人见人爱A^B
B - 人见人爱A^BTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription求A^B的最后三位数表示的整数。 说明:A^B的含义是“A的B次方” Input输入数据包含多个原创 2014-08-07 19:52:07 · 377 阅读 · 0 评论 -
C. Lengthening Sticks(Codeforces Round #317 容斥定理)
C. Lengthening Stickstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given three sticks with positi原创 2015-08-24 20:41:24 · 1045 阅读 · 0 评论 -
快速幂取余
#include#include#include#include#include#includeusing namespace std;long long quickmod(long long a,long long b,long long m){ long long ans = 1; while(b)//用一个循环从右到左便利b的所有二进制位 {原创 2015-06-28 10:08:49 · 422 阅读 · 0 评论 -
HDU 5373 The shortest problem(同余模定理)
The shortest problemTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 135 Accepted Submission(s): 74Problem DescriptionIn this原创 2015-08-11 18:22:38 · 673 阅读 · 0 评论 -
C. Amr and Chemistry(Codeforces Round #312 (Div. 2) 二进制+暴力)
C. Amr and Chemistrytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmr loves Chemistry, and specially doin原创 2015-08-13 08:21:09 · 935 阅读 · 0 评论 -
POJ 3270 Cow Sorting(置换环)
Cow SortingTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6393 Accepted: 2476DescriptionFarmer John's N (1 ≤ N ≤ 10,000) cows are lined up to be milked原创 2015-07-21 09:38:14 · 1897 阅读 · 0 评论 -
51nod 1393 0和1相等串(鸽巢原理)
1393 0和1相等串基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注给定一个0-1串,请找到一个尽可能长的子串,其中包含的0与1的个数相等。Input一个字符串,只包含01,长度不超过1000000。Output一行一个整数,最长的0与1的个数相等的子串的原创 2015-08-30 14:22:12 · 1093 阅读 · 0 评论 -
POJ 1850 Code(组合数学)
CodeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8662 Accepted: 4113DescriptionTransmitting and memorizing information is a task that requires differ原创 2015-07-22 16:40:18 · 1123 阅读 · 0 评论 -
POJ 1942 Paths on a Grid(简单组合数学)
Paths on a GridTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 22836 Accepted: 5622DescriptionImagine you are attending your math lesson at school. Once原创 2015-07-22 16:44:15 · 1546 阅读 · 0 评论 -
51nod 1136 欧拉函数
1136 欧拉函数基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。此函数以其首名研究者欧拉命名,它又称为Euler's totient function、φ函数、欧拉商数等。例如:φ(8) = 4(Phi(8) = 4),因为1,3,5,7原创 2015-08-27 21:28:51 · 981 阅读 · 0 评论 -
POJ 1845 Sumdiv(数论)
SumdivTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 15745 Accepted: 3894DescriptionConsider two natural numbers A and B. Let S be the sum of all natur原创 2015-07-23 10:19:45 · 3017 阅读 · 0 评论 -
POJ 2635 The Embarrassed Cryptographer(高精度取模 + 同余模定理)
The Embarrassed CryptographerTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12905 Accepted: 3472DescriptionThe young and very promising cryptographer O原创 2015-07-24 20:06:59 · 741 阅读 · 0 评论 -
HDU 5363 Key Set(快速幂取余)
Key SetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 362 Accepted Submission(s): 238Problem Descriptionsoda has a set S w原创 2015-08-07 10:42:04 · 644 阅读 · 0 评论 -
HDU 1695 GCD(容斥定理)
GCDTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7529 Accepted Submission(s): 2773Problem DescriptionGiven 5 integers: a, b原创 2015-08-24 20:30:06 · 722 阅读 · 0 评论 -
HDU 4135 Co-prime(容斥定理)
Co-primeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2445 Accepted Submission(s): 918Problem DescriptionGiven a number N,原创 2015-08-24 20:03:38 · 522 阅读 · 0 评论 -
HDU 1061 Rightmost Digit
A - Rightmost DigitTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionGiven a positive integer N, you should output the most right原创 2014-08-07 19:48:33 · 347 阅读 · 0 评论 -
POJ 2115 C Looooops
D - C LooooopsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA Compiler Mystery: We are given a C-language style for loop of原创 2014-08-07 19:48:19 · 374 阅读 · 0 评论 -
POJ 1061 青蛙的约会
C - 青蛙的约会Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止原创 2014-08-07 19:35:18 · 430 阅读 · 0 评论 -
POJ 1006 Biorhythms(中国剩余定理)
E - BiorhythmsTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSome people believe that there are three cycles in a person's li原创 2014-08-07 19:51:05 · 572 阅读 · 0 评论 -
UVA How many zeros and how many digits?
Problem GHow many zeros and how many digits?Input: standard inputOutput: standard outputGiven a decimal integer number you will have to find out how many trailing zeros will be there in its原创 2015-01-18 16:10:19 · 808 阅读 · 0 评论 -
UVA Just the Facts
Just the Facts The expression N!, read as `` N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example,NN!01原创 2015-01-18 16:56:48 · 706 阅读 · 0 评论 -
SDUT 1447 水题(y*y = x*x + n)
水题Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^题目描述给定一个正整数 n,求一个最小的正整数 x,使得可以找到一个正整数y,且满足 y*y = n + x*x。输入输入包含多组测试数据。每组数据只有一行为 1 个整数 n(0 输出对于每组测原创 2015-04-24 20:11:36 · 890 阅读 · 0 评论 -
SDUT 2867 小学奥数(下)(规律)
小学奥数(下)Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^题目描述到了夏天了,ACM协会发福利了,发了很多西瓜,聪明的小明很爱思考,一个西瓜,n刀最多能切成几部分? 你能帮他解决么?输入多组输入,每组一行,直到文件结束。输入一个n(0≤n≤100)。输出原创 2015-04-27 20:39:00 · 678 阅读 · 0 评论 -
因子和的计算方法
因子和的计算方法神马叫因子和:一个数的所以因子的和就叫因子和。。。好吧,举个例子:12的因子和为:1+2+3+4+6+12计算方法是把12分解为质因数的表达形式2^2*3那么他的因子和就是:(1+2+2^2)*(1+3)证明写起来比较麻烦,大体上思路就是牛顿二项式。。。例如:12 = 2 * 2 * 312的因子为1 2 3 4 6 12原创 2015-06-28 10:45:22 · 9455 阅读 · 0 评论 -
欧拉函数代码实现
欧拉函数ph(n)的意思是所有小于n且与n互质的个数。比如说ph(10) = 4{1,,3,7,9与12互质}欧拉公式 : a^ph(m) = 1(mod m);代码实现://筛选法打欧拉函数表#include#include#include#include#includeusing na原创 2015-06-28 10:03:44 · 3629 阅读 · 0 评论 -
POJ 1265 Area(Pick定理)
AreaTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5284 Accepted: 2375DescriptionBeing well known for its highly innovative products, Merck would defin原创 2015-07-25 16:47:34 · 1066 阅读 · 0 评论 -
HDU 2841 Visible Trees(容斥定理)
Visible TreesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1951 Accepted Submission(s): 792Problem DescriptionThere are man原创 2015-08-24 20:22:09 · 566 阅读 · 0 评论 -
POJ 3252 Round Numbers(组合数学)
Round NumbersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 10223 Accepted: 3726DescriptionThe cows, as you know, have no fingers or thumbs and thus ar原创 2015-07-22 16:47:50 · 1356 阅读 · 0 评论