数论
文章平均质量分 81
AnICoo1
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #338 (Div. 2) D. Multipliers (求因子积)
D. Multiplierstime limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputAyrat has number n, represented as it’s prime factorization pi of size原创 2016-08-12 12:14:21 · 708 阅读 · 0 评论 -
HDOJ 1205 吃糖果(抽屉原理)
吃糖果Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 32070 Accepted Submission(s): 9118Problem DescriptionHOHO,终于从Speakless手上赢走了所有的原创 2016-03-16 08:49:33 · 388 阅读 · 0 评论 -
POJ 1401 Factorial (求N!的零数)
FactorialTime Limit: 1500MS Memory Limit: 65536KTotal Submissions: 15291 Accepted: 9444DescriptionThe most important part of a GSM network is so called Base Transce原创 2016-01-14 19:44:32 · 295 阅读 · 0 评论 -
POJ 1006 Biorhythms(中国剩余定理)
BiorhythmsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 122939 Accepted: 38784DescriptionSome people believe that there are three cycles in a person's l原创 2015-10-18 17:41:57 · 419 阅读 · 0 评论 -
中国剩余定理
公元前后的《孙子算经》中有“物不知数”问题:“今有物不知其数,三三数之余二 ,五五数之余三 ,七七数之余二,问物几何?”答为“23”。 --------这个就是传说中的“中国剩余定理”。 其实题目的意思就是,x%3=2,x%5=3,x%6=2;问x最小是多少? 解法: 1.首先找到3,5,7,的三个“关键数字”,即[5,6]=35;[3,7]=21;[3,5]=1转载 2015-06-06 17:32:51 · 375 阅读 · 0 评论 -
POJ 2407 Relatives (欧拉函数)
RelativesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12847 Accepted: 6337DescriptionGiven n, a positive integer, how many positive integers less than原创 2016-02-02 16:43:17 · 603 阅读 · 0 评论 -
HDOJ 1796 How many integers can you find (容斥原理)
How many integers can you findTime Limit: 12000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6166 Accepted Submission(s): 1768Problem Description原创 2016-02-01 23:13:05 · 400 阅读 · 0 评论 -
HDOJ 4135 Co-prime (容斥原理)
Co-primeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2751 Accepted Submission(s): 1055Problem DescriptionGiven a number N, you原创 2015-11-11 20:14:45 · 562 阅读 · 0 评论 -
HDOJ 2841 isible Trees (容斥原理)
isible TreesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2207 Accepted Submission(s): 905Problem DescriptionThere are many tre原创 2015-11-28 22:09:12 · 373 阅读 · 0 评论 -
LightOJ 1213 - Fantasy of a Summation (排列组合+快速幂)
1213 - Fantasy of a Summation PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBIf you think codes, eat codes then some原创 2016-02-15 00:50:45 · 1064 阅读 · 0 评论 -
Codeforces Round #326 (Div. 2) B. Duff in Love (分解质因子)
B. Duff in Lovetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is in love with lovely numbers! A positive integ原创 2016-02-13 23:56:04 · 564 阅读 · 0 评论 -
POJ 2115 C Looooops (扩展欧几里得)
C LooooopsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21174 Accepted: 5753DescriptionA Compiler Mystery: We are given a C-language style for loop of t原创 2016-01-31 15:43:01 · 707 阅读 · 0 评论 -
HDOJ 5150 Sum Sum Sum (素数和 水)
Sum Sum SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 982 Accepted Submission(s): 578Problem DescriptionWe call a positive n原创 2016-02-12 23:04:47 · 281 阅读 · 0 评论 -
FZUOJ 1704 Turn off the light (高斯消元+大数高精度)
Problem 1704 Turn off the light Accept: 84 Submit: 263Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionThere are N lights and M switches in Peter’s bedroom. Every s原创 2016-01-30 23:12:23 · 976 阅读 · 0 评论 -
POJ 1222 EXTENDED LIGHTS OUT (高斯消元)
EXTENDED LIGHTS OUTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8364 Accepted: 5406DescriptionIn an extended version of the game Lights Out, is a puzzl原创 2016-01-30 23:08:45 · 428 阅读 · 0 评论 -
LightOJ 1220 - Mysterious Bacteria (质因子分解)
1220 - Mysterious BacteriaTime Limit:500MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1220 DescriptionDr. Mob has just discovered原创 2016-01-13 18:14:19 · 1153 阅读 · 0 评论 -
LightOJ 1214 - Large Division (大数求余)
1214 - Large DivisionTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1214 DescriptionGiven two integers, a and b, yo原创 2016-01-13 17:16:44 · 1127 阅读 · 0 评论 -
FZUOJ 1402 猪的安家 (中国剩余定理 互质)
Problem 1402 猪的安家Accept: 1120 Submit: 6609Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionAndy和Mary养了很多猪。他们想要给猪安家。但是Andy没有足够的猪圈,很多猪只能够在一个猪圈安家。举个例子,假如有16头猪,Andy建了原创 2016-02-02 22:02:08 · 443 阅读 · 0 评论 -
LightOJ 1197 - Help Hanzo (模拟筛素法区间筛素)
1197 - Help Hanzo PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBAmakusa, the evil spiritual leader has captured the原创 2016-03-30 20:45:15 · 962 阅读 · 0 评论 -
Codeforces Round #368 (Div. 2) C. Pythagorean Triples (本原勾股数)
C. Pythagorean Triplestime limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputKatya studies in a fifth grade. Recently her class studied right原创 2016-08-21 15:00:18 · 490 阅读 · 0 评论 -
hdu5726 GCD (线段树+区间gcd)
GCDTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1587 Accepted Submission(s): 515Problem DescriptionGive you a sequence of N(N原创 2016-07-21 09:30:06 · 2790 阅读 · 1 评论 -
Codeforces Round #360 (Div. 2) D. Remainders Game
D. Remainders Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday Pari and Arya are playing a game called Remai原创 2016-07-02 14:38:08 · 635 阅读 · 0 评论 -
POJ 2480 Longge's problem (欧拉函数)
Longge’s problem Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8107 Accepted: 2680Description Longge is good at mathematics and he likes to think about hard mathematical proble原创 2016-07-22 21:48:45 · 510 阅读 · 0 评论 -
BZOJ 1607 Patting Heads 轻拍牛头 (素数筛应用)
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1607思路:和素数筛一样的原理,记录每个数出现的次数,然后筛一遍就好了ac代码:#include<stdio.h>#include<math.h>#include<string.h>#include<stack>#include<set>#include<queue>#includ原创 2016-05-21 11:58:36 · 492 阅读 · 0 评论 -
LightOJ 1340 - Story of Tomisu Ghost (求n!在b进制下末尾0)
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1340题意:给你一个n,一个t,n!在b进制下末尾0的个数要大于等于t,求最大的d思路:筛n之内的素数,然后依次看在素数p进制下0的个数,如果大于,快速幂优化ac代码:/*LightOJ 1340*/#include<stdio.h>#include<math.h>#incl原创 2016-05-16 17:39:14 · 700 阅读 · 0 评论 -
LightOJ 1282 - Leading and Trailing (求n^k的前三位和后三位)
1282 - Leading and Trailing PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBYou are given two integers: n and k, your原创 2016-04-04 18:45:20 · 1603 阅读 · 5 评论 -
LightOJ 1054 - Efficient Pseudo Code (求n^m的因子和)
1054 - Efficient Pseudo Code PDF (English)StatisticsForumTime Limit: 1 second(s)Memory Limit: 32 MBSometimes it's quite useful to write pse原创 2016-02-25 21:51:15 · 775 阅读 · 0 评论 -
LightOJ 1138 - Trailing Zeroes (III) (求末尾0为x的最小N---二分)
1138 - Trailing Zeroes (III) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBYou task is to find minimal natural numb原创 2016-04-03 16:41:25 · 371 阅读 · 0 评论 -
LightOJ 1245 - Harmonic Number (II) (求n/1+n/2+n/2+....+n/n)
1245 - Harmonic Number (II) PDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 32 MBI was trying to solve problem '1234 - Har原创 2016-03-09 21:50:48 · 636 阅读 · 0 评论 -
LightOJ 1278 - Sum of Consecutive Integers (求一个数能被分解为等差数列的方案数)
1278 - Sum of Consecutive Integers PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven an integer N, you have to fi原创 2016-03-09 21:13:11 · 681 阅读 · 0 评论 -
LightOJ 1259 - Goldbach`s Conjecture (分解偶数为两个素数之和)
1259 - Goldbach`s Conjecture PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGoldbach's conjecture is one of the olde原创 2016-03-08 17:43:06 · 1371 阅读 · 0 评论 -
Codeforces Round #260 (Div. 2) B. Fedya and Maths (数学规律)
B. Fedya and Mathstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFedya studies in a gymnasium. Fedya's maths hometas原创 2016-03-08 16:53:00 · 464 阅读 · 0 评论 -
HDOJ 3037 Saving Beans (Lucas定理)
Saving BeansTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3533 Accepted Submission(s): 1350Problem DescriptionAlthough winter i原创 2016-02-23 00:02:18 · 703 阅读 · 0 评论 -
LightOJ 1067 - Combinations (Lucas定理)
1067 - Combinations PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven n different objects, you want to take kof t原创 2016-02-23 00:07:30 · 618 阅读 · 0 评论 -
LightOJ 1090 - Trailing Zeroes (II) (求式子结果0的个数)
1090 - Trailing Zeroes (II) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBFind the number of trailing zeroes for th原创 2016-03-30 21:45:05 · 606 阅读 · 0 评论 -
LightOJ 1234 - Harmonic Number (打表)
1234 - Harmonic NumberTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1234 DescriptionIn mathematics, the nth harmon原创 2016-01-13 15:43:11 · 696 阅读 · 0 评论 -
POJ 2262 Goldbach's Conjecture(素数表分解质数)
Goldbach's ConjectureTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 41314 Accepted: 15827DescriptionIn 1742, Christian Goldbach, a German amateur mathema原创 2015-10-18 17:53:01 · 432 阅读 · 0 评论 -
HDOJ 1576 A/B (扩展欧几里得)
A/BTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3327 Accepted Submission(s): 2521Problem Description要求(A/B)%9973,但由于A很大,我们只给出n原创 2015-10-18 18:40:32 · 349 阅读 · 0 评论 -
LightOJ 1077 - How Many Points? (线段整数点个数)
1077 - How Many Points? PDF (English)StatisticsForumTime Limit: 0.5 second(s)Memory Limit: 32 MBGiven two points A and B on the X-Yplane, o原创 2016-02-08 17:29:50 · 925 阅读 · 0 评论 -
LightOJ 1045 - Digits of Factorial (k进制下N!的位数)
1045 - Digits of Factorial PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBFactorial of an integer isdefined by the f原创 2016-02-08 17:17:08 · 826 阅读 · 1 评论