随笔分类 -  数学

1
摘要:1575: Gingers and Mints Description fcbruce owns a farmland, the farmland has n * m grids. Some of the grids are stones, rich soil is the rest. fcbruc 阅读全文
posted @ 2016-04-18 20:50 JoneZP 阅读(255) 评论(0) 推荐(0)
摘要:青蛙的约会 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 102239 Accepted: 19781 Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上 阅读全文
posted @ 2016-03-07 20:48 JoneZP 阅读(181) 评论(0) 推荐(0)
摘要:The Review Plan ITime Limit: 5 Seconds Memory Limit: 65536 KBMichael takes the Discrete Mathematics course in this semester. Now it's close to the ... 阅读全文
posted @ 2015-09-05 21:13 JoneZP 阅读(218) 评论(0) 推荐(0)
摘要:转:ACM 进阶学习第一课----同余相关之中国剩余定理:m.blog.csdn.net/blog/hu1020935219/14112149 数论——中国剩余定理(互质与非互质):http://yzmduncan.iteye.com/blog/1323599/ hdu 3579 Hello Ki... 阅读全文
posted @ 2015-08-24 21:27 JoneZP 阅读(226) 评论(0) 推荐(0)
摘要:City PlanningTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 483Accepted Submission(s): 203Problem... 阅读全文
posted @ 2015-08-16 15:13 JoneZP 阅读(271) 评论(0) 推荐(0)
摘要:转:http://blog.csdn.net/gokou_ruri/article/details/7723378方法一: 9 1 0 5 4 与 5 2 1 4 3 的逆序对个数相同。设有4个数:1234567、123456789、12345678、123456排序:123456 1 ... 阅读全文
posted @ 2015-08-09 16:36 JoneZP 阅读(128) 评论(0) 推荐(0)
摘要:Trail WalkTime Limit: 2 Seconds Memory Limit: 65536 KBFatMouse is busy organizing the coming trail walk. After the route for the trail walk has bee... 阅读全文
posted @ 2015-07-22 16:27 JoneZP 阅读(268) 评论(0) 推荐(0)
摘要:DescriptionIn the Fibonacci integer sequence, F_0 = 0, F_1 = 1, and F_n = F_{n-1} + F_{n-2} for n \geq 2. For example, the first ten terms of the Fibo... 阅读全文
posted @ 2015-07-19 18:31 JoneZP 阅读(167) 评论(0) 推荐(0)
摘要:1 long long euler_phi(int n) 2 { 3 int m=(int)sqrt(n+0.5); 4 int ans=n; 5 for(int i=2;i1)ans=ans/n*(n-1);14 return ans;15 }Descriptio... 阅读全文
posted @ 2015-07-19 18:25 JoneZP 阅读(192) 评论(0) 推荐(0)
摘要:1 scanf("%s%d",a,&b);2 int len=strlen(a);3 int ans=0;4 for(int i=st;i 0, b fits into a 32 bit signed integer). Numbers will not contain leading zeroes... 阅读全文
posted @ 2015-07-19 18:22 JoneZP 阅读(696) 评论(0) 推荐(0)
摘要:1 long long x,y,gcd; 2 void extend_gcd(long long a, long long b) 3 { 4 if(b == 0) 5 { 6 x = 1; 7 y = 0; 8 gcd = a; 9... 阅读全文
posted @ 2015-07-19 18:16 JoneZP 阅读(102) 评论(0) 推荐(0)
摘要:线性筛更快。1.埃氏筛法1 int m=sqrt(n+0.5);2 memset(vis,0,sizeof(vis));3 for(int i=2;i 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 in... 阅读全文
posted @ 2015-07-19 18:11 JoneZP 阅读(220) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4565这个博客讲的比较好:http://blog.csdn.net/ljd4305/article/details/8987823题意:给定a,b,,n,m,求Sn 1 #include 2 #incl... 阅读全文
posted @ 2015-07-19 10:53 JoneZP 阅读(187) 评论(0) 推荐(0)
摘要:DescriptionGiven n different objects, you want to take k of them. How many ways to can do it?For example, say there are 4 items; you want to take 2 of... 阅读全文
posted @ 2015-07-18 00:09 JoneZP 阅读(258) 评论(0) 推荐(0)
摘要:Number of ContainersTime Limit: 1 Second Memory Limit: 32768 KBFor two integers m and k, k is said to be a container ofm if k is divisible by m. Given... 阅读全文
posted @ 2015-07-07 23:42 JoneZP 阅读(261) 评论(0) 推荐(0)
摘要:C - Rightmost Digit Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1061Description Gi... 阅读全文
posted @ 2015-07-03 14:56 JoneZP 阅读(374) 评论(0) 推荐(0)
摘要:How many integers can you findTime Limit: 12000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5664Accepted Submis... 阅读全文
posted @ 2015-06-06 22:59 JoneZP 阅读(144) 评论(0) 推荐(0)
摘要:Hdu Girls' DayTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1629Accepted Submission(s): 490Probl... 阅读全文
posted @ 2015-02-04 20:57 JoneZP 阅读(328) 评论(0) 推荐(0)
摘要:Calculate S(n)Time Limit: 10000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9102Accepted Submission(s): 3325Pro... 阅读全文
posted @ 2015-02-02 13:10 JoneZP 阅读(231) 评论(0) 推荐(0)
摘要:求最小公倍数一种办法通过求最大公约数求得再通过公式(最小公倍数=两个数的乘积/最大公约数)最大公约数通过辗转相除法求得。#include int Gcd (int a, int b){ int tmp; while (b != 0){ tmp = a; a... 阅读全文
posted @ 2015-01-23 11:20 JoneZP 阅读(156) 评论(0) 推荐(0)

1