![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
文章平均质量分 86
qiqijianglu
这个作者很懒,什么都没留下…
展开
-
hdu4418 Time travel 期望+高斯
Time travelTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 560 Accepted Submission(s): 86Problem DescriptionAgent K is one原创 2012-10-15 18:23:21 · 2853 阅读 · 1 评论 -
hdu3221 Brute-force Algorithm矩阵快速幂&&a^b%p=a^(b%phi(p)+phi(p))%p b>=phi(p)
Brute-force AlgorithmTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1530 Accepted Submission(s): 379Problem DescriptionProfessor原创 2012-10-01 19:12:56 · 3043 阅读 · 0 评论 -
hdu2262 Where is the canteen高斯+期望
Where is the canteenTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 590 Accepted Submission(s): 148Problem DescriptionAfter a lo原创 2012-10-03 20:50:14 · 2017 阅读 · 0 评论 -
poj2096 Collecting Bugs----期望复习
Collecting BugsTime Limit: 10000MS Memory Limit: 64000KTotal Submissions: 1245 Accepted: 524Case Time Limit: 2000MS Special JudgeDescriptionIvan is fond o原创 2012-10-03 18:40:24 · 2164 阅读 · 0 评论 -
hdu4344 Mark the Rope-------多校联合五
这题比赛的时候思路基本上对了,除了当n就为一个素数的一次幂时候按我们的思路是S就是这个素数,事实上标程是1,但是按照题意He will choose a lengthL (N>L>1) and he defines the mark’s value equals L,不应该输出1。贴一下标程,作为以后大数分解素因子的模板。#include #include #include #inc原创 2012-08-07 20:40:18 · 1148 阅读 · 4 评论 -
hdu4345 Permutation-----多校联合五
这题首先是道数学题,用到了置换群的概念,其实是求相加和为N的最小公倍数的种类数,把数学思想抽象出来就成一道dp题了。 #include#include#include#define ll __int64using namespace std;const int N=1000;int prime[N]={0},num=1;int isprime[N]={1,1};ll dp[原创 2012-08-08 08:43:36 · 1264 阅读 · 4 评论 -
sgu275 To xor or not to xor ----高斯消元复习
275. To xor or not to xor time limit per test: 0.5 sec.memory limit per test: 65536 KBinput: standardoutput: standardThe sequence of non-negative integers A1, A2, ..., AN is given. Y原创 2012-10-03 16:42:49 · 2345 阅读 · 0 评论 -
hdu4365 Palindrome graph-------多校联合七
Palindrome graphTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 96 Accepted Submission(s): 38Problem DescriptionIn addition fon原创 2012-08-14 18:53:15 · 1262 阅读 · 0 评论 -
hdu4279 Number-------天津网络赛 打表找规律
NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 492 Accepted Submission(s): 159Problem Description Here are two numbers A原创 2012-09-10 10:43:38 · 2403 阅读 · 0 评论 -
hdu4291 A Short problem 矩阵快速幂 求循环节----成都网络赛
A Short problemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 300 Accepted Submission(s): 110Problem Description According to原创 2012-09-17 11:12:29 · 2750 阅读 · 0 评论 -
hdu2837 Calculation a^b%p=a^(b%phi(p)+phi(p))%p
CalculationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 873 Accepted Submission(s): 192Problem DescriptionAssume that f(0) =原创 2012-08-07 09:55:46 · 3021 阅读 · 0 评论 -
poj2689 Prime Distance 素数筛选应用 复习
Prime DistanceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8409 Accepted: 2273DescriptionThe branch of mathematics called number theory is about proper原创 2012-10-01 13:05:00 · 2519 阅读 · 5 评论 -
zoj3647 Gao the Grid----方格中的三点共线
Gao the GridTime Limit: 2 Seconds Memory Limit: 65536 KB A n * m grid as follow: Count the number of triangles, three of whose vertice must be grid-points.Note that the th原创 2012-10-01 11:08:48 · 1893 阅读 · 0 评论 -
2012浙大九月月赛 zoj3645 BiliBili-----高斯 浮点型
BiliBiliTime Limit: 2 Seconds Memory Limit: 65536 KB Shirai Kuroko is a Senior One student. Almost everyone in Academy City have super powers, andKuroko is good at using it. Her abili原创 2012-09-30 11:53:11 · 2487 阅读 · 2 评论 -
hdu3980 Paint Chain------sg 环--链 一排石子分成若干堆
Paint ChainTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 696 Accepted Submission(s): 252Problem DescriptionAekdycoin and abcdxy原创 2012-09-11 09:36:26 · 1390 阅读 · 0 评论 -
hdu1849 Rabbit and Grass 距离转为NIM 水题
#include#include#includeusing namespace std;int main(){ int n,num; while(scanf("%d",&n)&&n) { int ans=0; for(int i=0;i<n;i++) { scanf("%d",&num);原创 2012-09-06 19:57:08 · 1313 阅读 · 0 评论 -
hdu1760 A New Tetris Game-----找sg 字符串
A New Tetris GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 789 Accepted Submission(s): 343Problem Description曾经,Lele和他姐姐最原创 2012-09-06 19:31:43 · 1979 阅读 · 0 评论 -
hdu4282 A very hard mathematic problem-----天津网络赛
A very hard mathematic problemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 913 Accepted Submission(s): 268Problem Description原创 2012-09-10 16:08:47 · 2360 阅读 · 0 评论 -
hdu4355 Party All the Time----------多校联合六 三分
因为是凸性的,可以在位置这个区间进行三分,比赛的时候用三分写这道题的时候我竟然在位置所对应的标号之间进行三分,脑残了。#include#include#include#include#includeusing namespace std;const double eps = 1e-12;struct Node{ double x; double w;}node原创 2012-08-09 18:58:21 · 1808 阅读 · 0 评论 -
hdu3714 Error Curves---三分复习
Error CurvesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1151 Accepted Submission(s): 440Problem DescriptionJosephina is a cle原创 2012-09-21 15:37:37 · 1174 阅读 · 0 评论 -
zoj3203 Light Bulb-----三分复习
Light BulbTime Limit: 1 Second Memory Limit: 32768 KB Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb i原创 2012-09-21 11:19:59 · 894 阅读 · 0 评论 -
hdu1729 Stone Game sg
Stone GameTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1877 Accepted Submission(s): 495Problem DescriptionThis game is a two-pla原创 2012-09-05 19:50:20 · 2554 阅读 · 6 评论 -
hdu3595 GG and MM----every_sg
GG and MMTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 273 Accepted Submission(s): 108Problem DescriptionGG and MM like playing原创 2012-09-09 10:28:49 · 1536 阅读 · 0 评论 -
容斥原理 专题
http://acm.hdu.edu.cn/showproblem.php?pid=4336Card CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1410 Accepted Submission(s)原创 2012-10-07 11:47:00 · 1480 阅读 · 0 评论 -
矩阵链乘+斐波那契+快速幂 专题
http://acm.hdu.edu.cn/showproblem.php?pid=3117Fibonacci NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1093 Accepted Submission原创 2012-10-05 14:24:55 · 2748 阅读 · 5 评论 -
扩展欧几里得&&中国剩余定理 解线性同余方程组 专题
poj1061 扩展欧几里得解方程#include#include#includeusing namespace std;__int64 exGcd(__int64 a,__int64 b, __int64 &xx, __int64 &yy);int main(){ __int64 x,y,m,n,L,xx,yy; scanf("%I64d%I64d%原创 2012-10-04 11:18:57 · 4184 阅读 · 0 评论 -
高斯消元专题
由于老师的讲课,我又重拾高斯消元,做了一天的高斯,感觉老师讲得很好,模板也不错,我懒得自己写,就把同僚的模板拿过来用了,反正基本原理都懂了。http://poj.org/problem?id=1222高斯消元模板题,只有唯一解。#include #include #include #include using namespace std;const int maxn=30;原创 2012-09-05 10:37:51 · 3619 阅读 · 0 评论 -
hdu4335 What is N?------多校联合4
不知道亚洲赛的风格是不是这样,我感觉这题无法形容~~~为了真正理解这题,所以我决定好好写个解题报告。我是看了后来发的解题报告写的,按他所说,我们分两种情况考虑。第一种:当n比较大的时候,就是达到n!%phi(p)=0的时候,其实就是求n^phi(p)%p,显而易见的。 那么比n 小的那部分就直接暴力。第二种:当n比较小的时候,我们也是暴力了。这两种原创 2012-08-04 14:52:09 · 1494 阅读 · 0 评论 -
hdu4350 Card-----多校联合六
水题。#include#include#includeusing namespace std;int num[53];int n,l,r;int mm;int ff[53];int tt[53];void count(){ while(1) { int cc=1; for(int i=l;i<=r;i++) tt[cc++]=ff[i];原创 2012-08-09 19:58:49 · 1437 阅读 · 0 评论 -
hdu4405 Aeroplane chess---金华网络赛 期望
Aeroplane chessTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24 Accepted Submission(s): 20Problem DescriptionHzz loves aeroplan原创 2012-09-22 18:16:39 · 3756 阅读 · 2 评论 -
hdu4342 History repeat itself-------多校联合五
水题就不多说什么了。#include#include#include#define ll __int64using namespace std;int main(){ int t; ll n; scanf("%d",&t); while(t--) { scanf("%I64d",&n); if(n==1)原创 2012-08-07 19:51:42 · 931 阅读 · 0 评论 -
hdu4349 Xiao Ming's Hope-----多校联合五
水题。#include#include#include#define ll __int64using namespace std;ll power(int a,int b){ ll res=1; while(b) { if(b&1) res*=a; a=a*a; b>>=1; } return原创 2012-08-07 20:13:02 · 1286 阅读 · 0 评论 -
hdu3404 Switch lights-----NIM积
Switch lightsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 215 Accepted Submission(s): 115Problem Descriptionlxhgww is playin原创 2012-09-03 21:05:40 · 1626 阅读 · 0 评论 -
hdu1538 A Puzzle for Pirates---海盗分金---博弈
A Puzzle for PiratesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 141 Accepted Submission(s): 32Problem DescriptionA bunch of p原创 2012-09-03 19:48:37 · 2422 阅读 · 1 评论 -
hdu1787欧拉函数(计算单个欧拉函数值模板)
GCD AgainTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 954 Accepted Submiss原创 2011-09-08 11:35:59 · 1187 阅读 · 0 评论 -
求第K大的数 亚洲网络赛
Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the k转载 2011-09-03 20:30:33 · 3122 阅读 · 0 评论 -
hdu4259 Double Dealing----置换群
Double DealingTime Limit: 50000/20000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 290 Accepted Submission(s): 132Problem DescriptionTake a deck of原创 2012-08-25 20:52:24 · 1418 阅读 · 0 评论 -
poj2680 Computer Transformation----简单的递推
Computer TransformationTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4120 Accepted: 1592DescriptionA sequence consisting of one digit, the number 1 is i原创 2012-09-02 09:40:06 · 1488 阅读 · 0 评论 -
poj1721 CARDS----置换
CARDSTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1030 Accepted: 542DescriptionAlice and Bob have a set of N cards labelled with numbers 1 ... N (so th原创 2012-09-01 09:01:03 · 1389 阅读 · 2 评论 -
hdu1796 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): 2286 Accepted Submission(s): 629Problem Description原创 2012-09-01 13:29:18 · 1060 阅读 · 0 评论