数学上来先打表
蒟蒻的ACMer
2014界大学新生
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SPOJ 7001. Visible Lattice Points 莫比乌斯反演
A - 莫比乌斯反演Time Limit:1368MS Memory Limit:1572864KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionConsider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is原创 2016-04-19 14:25:43 · 407 阅读 · 0 评论 -
HDU 5976 Detachment 逆元
题意:把一个数分解分解成若干个不相等的数,怎么分解使得这若干个数的积最大,输出这个积mod(1e+9)分析:考虑x=20的情况如果不分解 那么 max ans===》20如果分解成2个数 max ans===》9*11=99如果分解成3个数 max ans===》5*7*8=280如果分解成4个数 max ans===》3*4*6*7=50原创 2017-05-01 15:30:39 · 405 阅读 · 0 评论 -
poj 1019 Number Sequence 打表二分
题意:有这么一个数 112123123412345……问这个数第i个数字是什么分析:我们可以观察到这个数是由 (1)( 1 2)(1 2 3 )……拼接起来我们可以打2个表a【】b【】a【i】表示加上(1 2 3……i)后到达第a【i】位b【i】表示对于(1 2 3……i)这个序列包含几位数然后二分瞎搞就可以了ACcode:#include #include #原创 2017-04-02 12:59:14 · 404 阅读 · 0 评论 -
poj 3292 打表
题意:规定H-number为所有能由4*i+1组成的数给定一个数A,问0-A中所有能2个H-number相乘得到的数有多少个分析:直接打表之ACcode:#include #include #include #include #include #include using namespace std;#define eps 1e-6#define mod 9原创 2017-04-01 21:24:32 · 364 阅读 · 0 评论 -
POJ 2886 反素数+线段树
题意:N个人进行约瑟夫环游戏第i轮的人能获得p(i)个糖果求获得最多糖果的人和糖果数p(i)为数i的因子的个数分析:约瑟夫环可以用线段树模拟下一次出局的人(因为每一次出局一个人所有的人的下标都回改变)知识点:反素数对于任何正整数x,其约数的个数记做g(x).例如g(1)=1,g(6)=4.如果某个正整数x满足:对于任意i(0因为我们要求的是最大的p(i)1ACcode:原创 2017-04-11 16:02:43 · 554 阅读 · 0 评论 -
hdu 5015 233 Matrix 矩阵优化
题意:一个233矩阵的第一行为0,233,2333,23333,……233……3;第一列为 0,a[1],a[2],a[3]……a[k]对于其他位置的值满足matrix[i][j]=matrix[i-1][j]+matrix[i][j-1];给你数组a[] 问matrix[n][m]的值是什么分析:可以知道根据所给的规矩构造一个矩阵10 0 0 0 的m次方的第n行和 矩阵 2原创 2016-09-23 17:33:13 · 458 阅读 · 0 评论 -
HDU 5793 A Boring Question 打表找规律
打个表就会发现这是很有规律的 答案为( m^(n+1)-1)/(m-1)ACcode:#pragma warning(disable:4786)//使命名长度不受限制#pragma comment(linker, "/STACK:102400000,102400000")//手工开栈#include #include #include #include #include #i原创 2016-08-04 21:21:42 · 800 阅读 · 0 评论 -
POJ Reduced ID Numbers 同余 暴力
思路:使m从小到大递增并逐一的验证是否满足集合U中任意两个数m取模相等ACcode:#include #include #include #define maxn 100007using namespace std;int p[maxn];int a[maxn];int main(){ int n,loop,cnt=1; scanf("%d",&loop)原创 2016-07-30 11:52:00 · 380 阅读 · 0 评论 -
湘潭邀请赛 A题 矩阵快速幂
2016Given a 2×2 matrixA=(a11a21a12a22),find An where A1=A,An=A×An−1. As the result may be large, you are going to find only the remainder after division by 7.Special Note: The proble原创 2016-06-13 12:46:34 · 878 阅读 · 0 评论 -
山东省第7届省赛 B题 Fibonacci
FibonacciTime Limit: 2000MS Memory limit: 131072K题目描述Fibonacci numbers are well-known as follow: Now given an integer N, please find out whether N can be represented as the sum of se原创 2016-06-10 19:27:38 · 761 阅读 · 0 评论 -
南京理工校赛 triple
triple Time Limit: 3000MSMemory Limit: 65536KBDescription给出一个整数n,表示1,2,...,n。从这n个数中任意选择3个不同的数字x,y,z,问x,y,z的最大公约数等于m的方案有多少种?(注意:(1,2,3),(1,3,2),(2,1,3),(2,3,1),(3,1,2),(3,2,1)属于同一种方案)原创 2016-04-19 15:49:11 · 478 阅读 · 0 评论 -
sdut 2608 Alice and Bob 二进制
题意:一个多项式:(a0*x^(2^0)+1) * (a1 * x^(2^1)+1)*.......*(an-1 * x^(2^(n-1))+1). 给出ai ,n 问x^q的系数分析:展开多项式会发现q可以表示成二进制那么x^q的系数就是q二进制位为1的ai的连乘ACcode:#include #define maxn 102#define mod 2原创 2017-05-03 15:16:21 · 584 阅读 · 0 评论
分享