随笔分类 -  数学

摘要:Codeforces 396B:On Sum of Fractions 题目链接:http://codeforces.com/problemset/problem/396/B 题目大意:共$t$组数据,每组给出一个数$n$,求$sum_{i=2}^n{\frac{1}{v(i) \times u(i 阅读全文
posted @ 2017-02-22 16:30 barriery 阅读(306) 评论(0) 推荐(0)
摘要:Codeforces 768C:Jon Snow and his Favourite Number 题目链接:http://codeforces.com/contest/768/problem/C 题目大意:给定n个数,每次先排序后将奇数位上的数与x异或,求操作k次后的最大值和最小值。 循环节 打表 阅读全文
posted @ 2017-02-21 19:46 barriery 阅读(651) 评论(0) 推荐(0)
摘要:51nod 1836:战忽局的手段 题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1836 矩阵快速幂 从题目所给的数据范围来看复杂度应该为O(1)或者O(lgn),于是定义ƒ(x)为n个事件,x次忽悠下的期望 阅读全文
posted @ 2017-02-20 16:32 barriery 阅读(330) 评论(0) 推荐(0)
摘要:Timofey and rectangles 题目链接:codeforces.com/contest/764/problem/D 数学 刚开始以为是地图染色问题,也就是要将坐标系中的矩形的邻接关系抽象出来再暴力处理。但是无论是抽象邻接关系还是暴力染色,复杂度都远远超过限定范围gg。 然而上述思考没有 阅读全文
posted @ 2017-02-03 17:22 barriery 阅读(229) 评论(0) 推荐(0)
摘要:Finding Lines 题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4967 概率 在听题解前毫无头绪,题解帮我打开了新世界 阅读全文
posted @ 2017-01-01 02:08 barriery 阅读(380) 评论(0) 推荐(0)
摘要:Ray Tracing 题目链接:http://codeforces.com/problemset/problem/724/C 拓展欧几里得 //为什么这次C题这么难啊=。= 可以观察到,光线在矩形中运动的时间为LCM(n,m),所以可以把整个矩阵扩展成LCM(n,m)*LCM(n,m)的矩阵[光线 阅读全文
posted @ 2016-10-09 21:22 barriery 阅读(260) 评论(0) 推荐(0)
摘要:A * B Problem Plus 题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1402 FFT (FFT的详细证明参见算法导论第三十章) 一个多项式有两种表达方式: 1.系数表示法,系数表示的多项式相乘,时间复杂度为O(n^2); 2 阅读全文
posted @ 2016-09-30 00:51 barriery 阅读(813) 评论(0) 推荐(0)
摘要:数一的逆袭 题目链接:http://acm.xidian.edu.cn/problem.php?id=1029 数学题 2^n的末位是一个以4为周期循环的数列, 求2^n的首位: 设m=2^n,两边取对数得, logm=nlog2,化简得, m=10^(nlog2); 设nlog2的整数部分为a,小 阅读全文
posted @ 2016-09-03 16:33 barriery 阅读(187) 评论(0) 推荐(0)
摘要:ZS and The Birthday Paradox 题目链接:http://codeforces.com/contest/711/problem/E 数学题(Legendre's formula) 这题是以生日悖论(如果有23个或23个以上的人,那么至少有两个人的生日相同的概率要大于50%)为背 阅读全文
posted @ 2016-08-31 23:53 barriery 阅读(395) 评论(0) 推荐(0)
摘要:分解 题目链接:http://www.51nod.com/contest/problem.html#!problemId=1537 矩阵快速幂 找规律可知,一定存在m,满足(1+sqrt(2)) ^n=sqrt(m) +sqrt(m-1),但是该如何找到这个m呢?注意到n的范围是1e18,所以只能是 阅读全文
posted @ 2016-08-27 17:47 barriery 阅读(156) 评论(0) 推荐(0)
摘要:Vanya and Field 题目链接:http://www.codeforces.com/problemset/problem/492/E 逆元 刚看到这题的时候一脸懵逼不知道从哪下手好,于是打表找规律。但是打出来的东西完全不能看啊,有个鬼规律(╯‵□′)╯︵┻━┻,是我数据处理不当?按x排序后 阅读全文
posted @ 2016-08-14 10:38 barriery 阅读(236) 评论(0) 推荐(0)