
数学题
文章平均质量分 62
蘑菇小哲
在通往梦想的道路上奋力潜行
展开
-
SGU 403
题目大意: 给出一个数X,求n ,原创 2014-06-25 22:03:51 · 571 阅读 · 0 评论 -
计算几何题目总结
打算转下来好好做计算几何了。原文地址:http://blog.sina.com.cn/s/blog_49c5866c0100f3om.html 其实也谈不上推荐,只是自己做过的题目而已,甚至有的题目尚未AC,让在挣扎中。之所以推荐计算几何题,是因为,本人感觉ACM各种算法中计算几何算是比较实际的算法,在很多领域有着重要的用途计算几何题的特点与做题要领:1.转载 2015-03-23 17:53:44 · 606 阅读 · 0 评论 -
POJ 1142 Simith Numbers(质因数分解)
解题思路:质因数分解,判断是否满足要求。有几个需要注意的地方,一是Simith数不能为素数,二是必须要找严格大于给定n的数。#include #include #include #include #include #include #include #include #include #include #include #define LL long long原创 2014-08-08 09:49:07 · 720 阅读 · 0 评论 -
HDU 4586 Play the dice(概率题,推公式)
Problem Description:There is a dice with n sides, which are numbered from 1,2,...,n and have the equal possibility to show up when one rolls a dice. Each side has an integer ai on it. Now here is a原创 2015-04-14 16:23:41 · 834 阅读 · 0 评论 -
高精度模版
还算可以的模版#include #include #include #include #include #define ll long long#define MAXN 9999#define MAXSIZE 10#define DLEN 4using namespace std;class BigNum{private: int a[500]; //可以控制大原创 2015-04-28 23:31:14 · 543 阅读 · 0 评论 -
BZOJ 3997: [TJOI2015]组合数学
3997: [TJOI2015]组合数学Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 428 Solved: 302[Submit][Status][Discuss]Description 给出一个网格图,其中某些格子有财宝,每次从左上角出发,只能向下或右走。问至少走多少次才能将财宝捡完。此对此问题变形,假设每个格子中有好原创 2015-09-25 19:58:24 · 401 阅读 · 0 评论 -
BZOJ 4001[TJOI2015]概率论
4001: [TJOI2015]概率论Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 583 Solved: 294[Submit][Status][Discuss]DescriptionInput输入一个正整数N,代表有根树的结点数Output 输出这棵树期望的叶子节点数。要求误差小原创 2015-09-28 11:11:54 · 765 阅读 · 0 评论 -
BZOJ 2257: [Jsoi2009]瓶子和燃料
2257: [Jsoi2009]瓶子和燃料Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 895 Solved: 525[Submit][Status][Discuss]Descriptionjyy就一直想着尽快回地球,可惜他飞船的燃料不够了。 有一天他又去向火星人要燃料,这次火星人答应了,要jyy用飞船上的瓶子来换。j原创 2015-09-28 13:46:34 · 762 阅读 · 0 评论 -
BZOJ 3170: [Tjoi 2013]松鼠聚会(切比雪夫距离)
3170: [Tjoi 2013]松鼠聚会Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 837 Solved: 396[Submit][Status][Discuss]Description有N个小松鼠,它们的家用一个点x,y表示,两个点的距离定义为:点(x,y)和它周围的8个点即上下左右四个点和对角的四个点,距离为1。现原创 2015-09-28 12:37:13 · 616 阅读 · 0 评论 -
BZOJ 2705: [SDOI2012]Longge的问题(euler函数)
2705: [SDOI2012]Longge的问题Time Limit: 3 Sec Memory Limit: 128 MBSubmit: 1638 Solved: 1030[Submit][Status][Discuss]DescriptionLongge的数学成绩非常好,并且他非常乐于挑战高难度的数学问题。现在问题来了:给定一个整数N,你需要求出∑gcd(i,原创 2015-10-05 09:59:24 · 492 阅读 · 0 评论 -
BZOJ 4318 OSU!(期望DP )
4318: OSU!Time Limit: 2 Sec Memory Limit: 128 MBSubmit: 88 Solved: 64[Submit][Status][Discuss]Descriptionosu 是一款群众喜闻乐见的休闲软件。 我们可以把osu的规则简化与改编成以下的样子: 一共有n次操作,每次操作只有成功与失败之分,成功对应1,失败对原创 2015-11-08 20:40:51 · 709 阅读 · 0 评论 -
BZOJ 4292: [PA2015]Równanie(转换枚举)
4292: [PA2015]RównanieTime Limit: 1 Sec Memory Limit: 256 MBSubmit: 224 Solved: 122[Submit][Status][Discuss]Description对于一个正整数n,定义f(n)为它十进制下每一位数字的平方的和。现在给定三个正整数k,a,b,请求出满足aInput原创 2015-11-08 21:00:42 · 813 阅读 · 0 评论 -
HDU 1085 Holding Bin-Laden Captive!(母函数)
#include #include #include #include using namespace std;const int MAXN = 8000 + 10;int c1[MAXN], c2[MAXN];int a[5], b[5];void solve(){ memset(c1, 0, sizeof(c1)); memset(c2, 0, sizeof(c2));原创 2015-03-11 16:39:37 · 417 阅读 · 0 评论 -
HDU 2082 找单词(母函数)
#include #include #include #include #include #include #include #include #include #include #define LL long longusing namespace std;const int MAXN = 50 + 10;int c1[MAXN], c2[MAXN];int a[MA原创 2015-03-11 16:57:08 · 492 阅读 · 0 评论 -
HDU1576 A/B(求逆元)
对于正整数和,如果有,那么把这个同余方程中的最小正整数解叫做模的逆元。逆元一般用扩展欧几里得算法来求得,如果为素数,那么还可以根据费马小定理得到逆元为。推导过程如下 #include #include #include #include #include #include #include #include #include #include原创 2015-03-10 21:35:37 · 632 阅读 · 0 评论 -
POJ 1061 青蛙的约会(扩展欧几里德)
#include #include #include #include #include #include #define LL long longusing namespace std;const int maxn = 10000 + 10;LL gcd(LL a , LL b){ return b == 0 ? a : gcd(b,a%b);}void extern_原创 2014-07-30 14:14:00 · 654 阅读 · 0 评论 -
HDOJ 4946 Area of Mushroom(凸包)
解题思路: 选出速度最大的若干个人,做一次凸包,凸包上的点能够控制无穷大的区域。几个需要注意原创 2014-08-15 10:20:53 · 733 阅读 · 0 评论 -
HDU 5050 高精度二进制数的最大公约数(C++ && Java)
C++版:#include #include #include #include #include #include #include #include #include #include #include #define LL long long#define FOR(i,x,y) for(int i=x;i<=y;i++)#define rFOR(i,x,y) f原创 2014-09-28 22:40:02 · 1580 阅读 · 0 评论 -
HDU 3037 Saving Beans(Lucas定理的直接应用)
解题思路:直接求C(n+m , m) % p , 因为n , m ,p都很大,所以要用Lucas定理来解决大组合数取模的问题。#include #include #include #include #include #include #include #include #include #include #include #include #include #de原创 2014-10-17 11:35:15 · 703 阅读 · 0 评论 -
HDU 5175 Misaki's Kiss again(数学,暴力枚举)
题目大意:After the Ferries Wheel, many friends hope to receive the Misaki's kiss again,so Misaki numbers them1,2...N−1,N,if someone's number is M and satisfied the GCD(N,M) equals to N XOR M,he原创 2015-02-17 11:57:16 · 1214 阅读 · 0 评论 -
欧拉四面体公式
欧拉四面体公式,求四面体体积。原创 2015-02-17 13:18:29 · 1069 阅读 · 0 评论 -
HDU 4349 Xiao Ming's Hope(数学题,Lucas定理)
解题思路:深入理解lucas定理.Lucas定理:把n写成p进制a[n]a[n-1]a[n-2]...a[0],把m写成p进制b[n]b[n-1]b[n-2]...b[0],则C(n,m)与C(a[n],b[n])*C(a[n-1],b[n-1])*C(a[n-2],b[-2])*....*C(a[0],b[0])模p同余。这题p为2,所以a[i]和b[i]为0或者1。又因为C(1原创 2015-02-18 11:41:28 · 772 阅读 · 0 评论 -
HDU 4279 Number(数学题,找规律)
题目大意:Here are two numbers A and B (0 For each x, f(x) equals to the amount of x’s special numbers. For example, f(6)=1, because 6 only have one special number which is 4. And f(12)=3, its spe原创 2015-02-18 12:17:20 · 1065 阅读 · 0 评论 -
HDU 1023 Train Problem II
解题思路:高精度求卡塔兰数模版#include #include #include #include #include #include #include #include #define LL long longusing namespace std;const int maxn = 100 + 10;int a[maxn][maxn];void solve()原创 2015-02-17 12:20:47 · 390 阅读 · 0 评论 -
HDU 4762 Cut the Cakes(数学题,推公式)
解题思路:推出的公式为 N / (M ^ (N-1) )。要用到高精度import java.util.*;import java.io.*;import java.math.*;public class Main{ static BigInteger gcd(BigInteger a, BigInteger b) { if(b.equals(BigInt原创 2015-02-17 15:38:08 · 605 阅读 · 0 评论 -
HDU 5187 zh's contest(快速幂 + 快速乘)
题目大意:As one of the most powerful brushes, zhx is required to give his juniors n problems.zhx thinks the ith problem's difficulty is i. He wants to arrange these problems in a beautiful way.z原创 2015-03-16 11:36:42 · 674 阅读 · 0 评论 -
BZOJ 1853 [Scoi2010]幸运数字 (容斥原理)
1853: [Scoi2010]幸运数字Time Limit: 2 Sec Memory Limit: 64 MBSubmit: 1591 Solved: 568[Submit][Status][Discuss]Description在中国,很多人都把6和8视为是幸运数字!lxhgww也这样认为,于是他定义自己的“幸运号码”是十进制表示中只包含数字6和8的那些号码,比如原创 2015-10-28 15:45:49 · 580 阅读 · 0 评论