浏览器标题切换
浏览器标题切换end

随笔分类 -  数论

摘要:You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For e 阅读全文
posted @ 2019-08-11 17:11 抓水母的派大星 阅读(153) 评论(0) 推荐(0) 编辑
摘要:Goldbach's conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states: Every even integer, greater than 2 阅读全文
posted @ 2019-08-10 09:32 抓水母的派大星 阅读(149) 评论(0) 推荐(0) 编辑
摘要:埃氏筛法 欧拉筛法 阅读全文
posted @ 2019-08-10 09:07 抓水母的派大星 阅读(127) 评论(0) 推荐(0) 编辑
摘要:It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the fi 阅读全文
posted @ 2019-08-09 19:23 抓水母的派大星 阅读(164) 评论(0) 推荐(0) 编辑
摘要:In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n, you have to fi 阅读全文
posted @ 2019-08-09 14:37 抓水母的派大星 阅读(146) 评论(0) 推荐(0) 编辑
摘要:Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only i 阅读全文
posted @ 2019-08-09 10:28 抓水母的派大星 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Background Binary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the nodes conta 阅读全文
posted @ 2019-07-29 23:33 抓水母的派大星 阅读(216) 评论(0) 推荐(0) 编辑
摘要:原题链接:https://hpuoj.com/contest/24/problem/E/ 思路:一般的尺取法,不断更新左端点的值。 这是直接调用库函数的一种写法(和上面的原理一样): 阅读全文
posted @ 2019-07-28 16:01 抓水母的派大星 阅读(179) 评论(0) 推荐(0) 编辑
摘要:再战斐波那契 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 小z 学会了斐波那契和 gcd 后,老师又给他出了个难题,求第N个和第M个斐波那契数的最大公约数,这可难倒了小z ,不过在小 阅读全文
posted @ 2019-07-28 14:39 抓水母的派大星 阅读(170) 评论(0) 推荐(0) 编辑
摘要:##公式 递推关系式: int f(int n) { if(n==0) return 0; else if (n==1) return 1; else return f(n-1)+f(n-2); } gcd(Fi+1,Fi)=1 gcd(Fi,Fj)=F(gcd(i,j)) Fm+n=Fm−1∗Fn 阅读全文
posted @ 2019-07-28 14:33 抓水母的派大星 阅读(141) 评论(0) 推荐(0) 编辑
摘要:##二分查找概念 二分查找:是一种在有序数组中查找某一特定元素的搜索算法。 这种搜索算法每一次比较都使搜索范围缩小一半。 ##写法一 根据定义: public static int binary(int[] a,int data) { int mi=0,ma=a.length-1,mid; whil 阅读全文
posted @ 2019-07-28 14:02 抓水母的派大星 阅读(467) 评论(0) 推荐(0) 编辑
摘要:In the new year party, everybody will get a "special present".Now it's your turn to get your special present, a lot of presents now putting on the des 阅读全文
posted @ 2019-07-26 20:54 抓水母的派大星 阅读(183) 评论(0) 推荐(0) 编辑
摘要:注意一下控制格式即可,最长公共上升子序列模版题 ##AC代码 #include<stdio.h> #include<iostream> #include<algorithm> #include<cmath> #include<iomanip> #include<string.h> using nam 阅读全文
posted @ 2019-07-24 08:55 抓水母的派大星 阅读(217) 评论(0) 推荐(0) 编辑
摘要:A problem that is simple to solve in one dimension is often much more difficult to solve in more than one dimension. Consider satisfying a boolean exp 阅读全文
posted @ 2019-07-21 16:52 抓水母的派大星 阅读(228) 评论(0) 推荐(0) 编辑
摘要:##题意 给出一列士兵的身高(会有重复),要求求出剔除最少士兵使得每一个士兵往左或者右看可以看到该队列的尽头士兵,原有的位置不得改变。 ##注意 不能直接排序去剔除除去最高士兵以外有重复的元素,因为题目要求原来的队列顺序不变。 A soldier see an extremity if there 阅读全文
posted @ 2019-07-21 13:14 抓水母的派大星 阅读(255) 评论(0) 推荐(0) 编辑
摘要:##思路 简单博弈题,可是我没写出来。 这也算是这周周赛的签到题,基本上所有人都做出来了,但是我没做出来,这题可以去手动模拟一下,比赛结束后看了一下解析,自己考虑的复杂了并且乱,做题目需要有一个全局观念,而且要会找规律啊。 当给对手留下3张牌(或是3的整数倍,由3张牌推到3的整数倍也成立)的时候,对 阅读全文
posted @ 2019-06-03 12:49 抓水母的派大星 阅读(113) 评论(0) 推荐(0) 编辑
摘要:解题思路: 第一遍题意理解正确一半,思路完全错误 一开始ab都用了字符串输入 同余定理,快速幂,错错错 正确思路: 考虑a的负数情况,b不用考虑 a字符串输入,b int 即可 比较特别的处理:( k*10+c[ j ] )%b; #include<stdio.h> #include<algorit 阅读全文
posted @ 2019-05-26 13:07 抓水母的派大星 阅读(116) 评论(0) 推荐(0) 编辑
摘要:希望自己以后能够及时做总结,不要拖,思路和逻辑真的很重要,其次是个人的代码实现能力,还有很长的路要走。 这一题卡了两天,归根到底几种写法的思想是一样的,但也总算写通了。 The SUM problem can be formulated as follows: given four lists A, 阅读全文
posted @ 2019-05-26 12:51 抓水母的派大星 阅读(108) 评论(0) 推荐(0) 编辑
摘要:昨晚上一道博弈题让我又理解了一下博弈,赶紧掏出我的小本子; 1 尼姆博弈我们都是知道的如果是每一个状态的sg值异或完后如果是非零先手必有胜的策略否则没有, 这里再说一下是为什么我们可以这么想,我们就是要判断先手是否是能先把石子取完: 博弈实际上是平衡问题,如果是当前状态是平衡的,那么先手不论怎么取, 阅读全文
posted @ 2019-05-19 13:36 抓水母的派大星 阅读(129) 评论(0) 推荐(0) 编辑
摘要:Integer Inquiry POJ - 1503 解题思路:我是把所有要求的数据全部输入,定义成二维数组,以0结束以记录有几组数据,然后按列计算每列的答案,通过对每位取整取余进行进位及输出。 这题有一个坑,给出的例子最后一行为0,代表输入结束,也就是说,你必须输入0回车之后才能出结果,而不是输入 阅读全文
posted @ 2019-05-07 18:11 抓水母的派大星 阅读(88) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示