![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
文章平均质量分 54
zuhiul
这个作者很懒,什么都没留下…
展开
-
project euler 463 A weird recurrence relation
更好的阅读体验problemsThe function fff is defined for all positive integers as follows:f(1)=1f(1)=1f(1)=1f(3)=3f(3)=3f(3)=3f(2n)=f(n)f(2n)=f(n)f(2n)=f(n)f(4n+1)=2f(2n+1)−f(n)f(4n + 1)=2f(2n + 1) - f(n)f(4n+1)=2f(2n+1)−f(n)f(4n+3)=3f(2n+1)−2f(n)f(4n + 3)=3原创 2021-09-17 17:24:45 · 83 阅读 · 0 评论 -
project euler 323
更好的阅读体验problemsLet y0,y1,y2y_0, y_1, y_2y0,y1,y2,… be a sequence of random unsigned 323232 bit integers(i.e. 0≤yi<2320 \le y_i \lt 2^{32}0≤yi<232, every value equally likely).For the sequence xi the following recursion is given:x0=0x_0 = 0x原创 2021-09-17 16:06:25 · 71 阅读 · 0 评论 -
codeforces 1567 B. MEXor Mixup
本场比赛其他题目的题解A. Domino DisasterB. MEXor MixupC. Carrying ConundrumD. Expression Evaluation ErrorE. Non-Decreasing DilemmaB. MEXor Mixup开启传送门题目描述Alice gave Bob two integers aaa and bbb (a>0a > 0a>0 and b≥0b \ge 0b≥0). Being a curious boy, B原创 2021-09-13 18:53:16 · 313 阅读 · 0 评论 -
欧拉计划部分题解报告(21-25)
021 Amicable numbers (开启传送门)。题意:让你找到所有符合d(d(n))==nd(d(n))==nd(d(n))==n &amp;&amp; d(n)≠nd(n)≠nd(n) \neq n的和。其中d(n)d(n)d(n)为nnn的除本身外所有的因子和。分析:直接求出每个数的因子和,然后判断就行。代码:#include&lt;bits/stdc++.h&gt;...原创 2018-07-16 17:10:27 · 451 阅读 · 0 评论 -
欧拉计划部分题解报告(26-30)
026 Reciprocal cycles (开启传送门)。题意:问你1000以内的ddd,使得1/d1/d1/d的循环节最长。分析:直接模拟所有的数据的循环节,然后输出最长的就行了。代码:#include &amp;amp;amp;amp;amp;amp;lt;bits/stdc++.h&amp;amp;amp;amp;amp;amp;gt;using namespace std;bool ans[1005];int cal(int a){原创 2018-07-16 17:12:39 · 393 阅读 · 0 评论 -
欧拉计划部分解题报告(11-15)
015 Lattice paths (开启传送门)。题意:问你从左上到右下只能向右或者向下的路径条数。分析:显然是个组合数问题,也就是让你求C2040C4020C_{40}^{20}。代码:#include &amp;amp;amp;amp;lt;bits/stdc++.h&amp;amp;amp;amp;gt;using namespace std;long long ans[45][45];void init(){ fo...原创 2018-07-17 11:33:39 · 396 阅读 · 0 评论 -
欧拉计划部分解题报告(31-35)
031 Coin sums(开启传送门)。题意:问你,200200200,由任意多个1,2,5,10,20,50,100,2001,2,5,10,20,50,100,2001,2,5,10,20,50,100,200构成的方案数。分析:简单深搜,注意从大到小深搜,会稍微快一点。代码:#include <bits/stdc++.h>using namespace std...原创 2018-07-18 10:07:52 · 217 阅读 · 0 评论 -
欧拉计划部分解题报告(66-70)
069 Totient maximum (开启传送门)。题意:问你[1,1e6][1,1e6][1,1e6]范围内的所有nnn中哪个的n/φ(n)n/φ(n)n/\varphi(n)最大。分析:第一个做法就是直接弄出所有的φ(n)φ(n)\varphi(n),然后暴力枚举统计答案就行。代码:#include <bits/stdc++.h>using namespace...原创 2018-07-19 10:00:54 · 256 阅读 · 0 评论 -
欧拉计划部分解题报告(71-75)
071 Ordered fractions (开启传送门)。题意:问你xd,(d∈[1,1e6],x∈[1,d])xd,(d∈[1,1e6],x∈[1,d])\frac{x}{d},(d \in [1,1e6],x \in [1,d])中哪个分数小于3737\frac{3}{7}又最接近3737\frac{3}{7}。输出分子。分析:这个题其实可以直接分析出来。显然可以得到4285719...原创 2018-07-19 10:20:41 · 279 阅读 · 0 评论 -
欧拉计划部分解题报告(76-80)
076 Counting summations (开启传送门)。题意:问你100能写成多少种求和方式。分析:记忆化搜索就行。然后稍微注意一下,他要求求和,也就是说100=100100=100100 = 100,这种是不算的。代码:#include <bits/stdc++.h>using namespace std;long long ans[105][105];...原创 2018-07-19 10:31:57 · 277 阅读 · 0 评论 -
欧拉计划部分解题报告(16-20)
018 Maximum path sum I(开启传送门)。题意:找一条从第一层到最后一层的路径,使得路径上权值和最大。分析:简单dp。代码:#include&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;bits/stdc++.h&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;usi原创 2018-07-14 21:02:33 · 389 阅读 · 0 评论 -
codeforces 948B Primal Sport
开启传送门。Alice and Bob begin their day with a quick game. They first choose a starting number X0 ≥ 3 and try to reach one million by the process described below.Alice goes first and then they take al...原创 2018-04-28 16:25:02 · 201 阅读 · 0 评论 -
hdu 1239 Calling Extraterrestrial Intelligence Again
传送门。A message from humans to extraterrestrial intelligence was sent through the Arecibo radio telescope in Puerto Rico on the afternoon of Saturday November 16, 1974. The message consisted of 1679 b...原创 2018-02-15 13:08:55 · 223 阅读 · 0 评论 -
hdu 1568 Fibonacci
2007年到来了。经过2006年一年的修炼,数学神童zouyu终于把0到100000000的Fibonacci数列(f[0]=0,f[1]=1;f[i] = f[i-1]+f[i-2](i>=2))的值全部给背了下来。接下来,CodeStar决定要考考他,于是每问他一个数字,他就要把答案说出来,不过有的数字太长了。所以规定超过4位的只要说出前4位就可以了,可是CodeStar自己又记不住。于是他原创 2017-05-30 17:33:37 · 172 阅读 · 0 评论 -
hdu 1575 Tr A
A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n个数据,每个数据的范围是[0,9],表示方阵A的内容。Output对应每组数据,输出Tr(A^k)%9973。Sample Input2原创 2017-05-30 18:33:15 · 145 阅读 · 0 评论 -
hdu 1568 Fibonacci
2007年到来了。经过2006年一年的修炼,数学神童zouyu终于把0到100000000的Fibonacci数列(f[0]=0,f[1]=1;f[i] = f[i-1]+f[i-2](i>=2))的值全部给背了下来。接下来,CodeStar决定要考考他,于是每问他一个数字,他就要把答案说出来,不过有的数字太长了。所以规定超过4位的只要说出前4位就可以了,可是CodeStar自己又记不住。于是原创 2017-06-02 19:15:29 · 116 阅读 · 0 评论 -
hdu 2036 改革春风吹满地
“ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地。谢谢!(乐队奏乐)”话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,而且,还竟然来这么几句打油诗。好呀,老师的责任就是帮你解决问题,既然想种田,那就分你一块。这块田位于浙江省温州市苍南县灵溪镇林家铺子村,多边形形状的一块地,原本是linle 的,现在就准备送给你了。不过,任何事情都没有那么简单原创 2017-06-12 17:42:08 · 358 阅读 · 0 评论 -
HAUT 1261 地狱飞龙
最近clover迷上了皇室战争,他抽到了一种地狱飞龙,很开心。假设地域飞龙会对距离为d的敌人每秒造成k/d2伤害。假设地域飞龙位于坐标轴原点,以每秒v1的速度向y轴正方向移动,敌人在(x,0)的位置,以每秒v2的速度向x轴负方向移动。问,敌人至少有多少血量永远才不会被地狱飞龙喷死。(伤害是连续造成的,不是一秒一秒间断的)Input第一行为数据组数T(1<=T<=1000)每组数据一行,包含4个实原创 2017-07-06 17:22:53 · 297 阅读 · 0 评论 -
poj 1183 反正切函数的应用
反正切函数可展开成无穷级数,有如下公式 (其中0 <= x <= 1) 公式(1) 使用反正切函数计算PI是一种常用的方法。例如,最简单的计算PI的方法: PI=4arctan(1)=4(1-1/3+1/5-1/7+1/9-1/11+...) 公式(2) 然而,这种方法的效率很低,但我们可以根据角度和的正切函数公式: tan(a+b)=[tan(a)+tan(b)]/[1-tan(a)*tan(b)原创 2017-07-21 20:51:57 · 337 阅读 · 0 评论 -
poj 1265 Area
Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new research and development facility the company has install原创 2017-07-23 14:59:07 · 190 阅读 · 0 评论 -
poj 3070 Fibonacci
In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …An alternative fo原创 2017-08-01 13:04:20 · 138 阅读 · 0 评论 -
hdu 6253 Knightmare
A knight jumps around an infinite chessboard. The chessboard is an unexplored territory. In the spirit of explorers, whoever stands on a square for the first time claims the ownership of this square. T原创 2017-12-11 16:54:33 · 1377 阅读 · 0 评论 -
hdu 1808 Halloween treats
传送门:点这里。Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, so it may hap原创 2018-02-06 11:02:03 · 179 阅读 · 0 评论 -
poj 2369 Permutations
传送门:点这里。We remind that the permutation of some final set is a one-to-one mapping of the set onto itself. Less formally, that is a way to reorder elements of the set. For example, one can define a pe原创 2018-02-06 19:52:24 · 138 阅读 · 0 评论 -
hdu 1210 Eddy's 洗牌问题
传送门。Eddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如果他有2N张牌,编号为1,2,3..n,n+1,..2n。这也是最初的牌的顺序。通过一次洗牌可以把牌的序列变为n+1,1,n+2,2,n+3,3,n+4,4..2n,n。那么可以证明,对于任意自然数N,都可以在经过M次洗牌后第一次重新得到初始的顺序。编程对于小于100000的自然数N,求出M...原创 2018-02-13 17:55:54 · 108 阅读 · 0 评论 -
CF 382B Number Busters
Arthur and Alexander are number busters. Today they've got a competition.Arthur took a group of four integers a, b, w, x (0 ≤ b < w, 0 < x < w) and Alexander took integer с. Arthur and Alexander use di原创 2017-07-28 21:38:29 · 277 阅读 · 0 评论