数学
bfcx
这个作者很懒,什么都没留下…
展开
-
【POJ - 2417】Discrete Logging(BSGS)
Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the discrete logarithm of N, base B, modulo P. That is, find an integer L such that...原创 2019-04-05 15:43:07 · 191 阅读 · 0 评论 -
【HDU - 2854】Central Meridian Number (暴力打表)
A Central Meridian (ACM) Number N is a positive integer satisfies that given two positive integers A and B, and among A, B and N, we haveN | ((A^2)*B+1) Then N | (A^2+B)Now, here is a number x, yo...原创 2019-04-27 22:30:17 · 362 阅读 · 0 评论 -
【HDU - 5245 】Joyful(概率dp)
Sakura has a very magical tool to paint walls. One day, kAc asked Sakura to paint a wall that looks like anM×NM×Nmatrix. The wall hasM×NM×Nsquares in all. In the whole problem we denotes(x,y)(x,y...原创 2019-04-23 22:01:54 · 259 阅读 · 0 评论 -
【poj-1006】生理周期(中国剩余定理)
Description人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。因为三个周期的周长不同,所以通常三个周期的高峰不会落在同一天。对于每个人,我们想知道何时三个高峰落在同一天。对于每个周期,我们会给出从当前年份的第一天开始,到出现高...原创 2019-04-28 15:10:05 · 298 阅读 · 0 评论 -
【HDU - 3579】Hello Kiki(拓展中国剩余定理)
One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六七八". And then the cashier put the counted coins ba...原创 2019-04-28 16:37:11 · 318 阅读 · 0 评论 -
【HDU - 1796】How many integers can you find (容斥原理)
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer...原创 2019-04-29 22:11:47 · 191 阅读 · 0 评论 -
【HDU - 5698】瞬间移动(求组合数)
有一个无限大的矩形,初始时你在左上角(即第一行第一列),每次你都可以选择一个右下方格子,并瞬移过去(如从下图中的红色格子能直接瞬移到蓝色格子),求到第nn行第mm列的格子有几种方案,答案对10000000071000000007取模。Input多组测试数据。两个整数n,m(2≤n,m≤100000)n,m(2≤n,m≤100000)Output一个整数表示答案Sam...原创 2019-05-15 16:48:29 · 372 阅读 · 0 评论 -
【HDU - 1792】A New Change Problem(推公式、互质数的最大不能表示数)
Now given two kinds of coins A and B,which satisfy that GCD(A,B)=1.Here you can assume that there are enough coins for both kinds.Please calculate the maximal value that you cannot pay and the total n...原创 2019-04-27 22:02:11 · 300 阅读 · 0 评论 -
【ZOJ - 3286】Very Simple Counting (打表)
Let f(n) be the number of factors of integern.Your task is to count the number of i(1 <= i <n) that makes f(i) = f(n).InputOnenper line (1 <n<= 1000000).There are 10000 lines...原创 2019-04-14 20:56:41 · 222 阅读 · 0 评论 -
【POJ - 1061】青蛙的约会(拓展欧几里得)
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...原创 2019-04-26 12:43:15 · 230 阅读 · 0 评论 -
【HDU - 2197】本原串 (数学)
kuangbin大神的博客由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n<=100000000)的本原串?答案mod2008.例如,100100不是本原串,因为他是由两个100组成,而1101是本原串。Input输入包括多个数据,每个数据一行,包括一个整数n,代表串的长度。Output对于每个测试数据,输出一行,代表...原创 2019-04-02 10:16:53 · 201 阅读 · 0 评论 -
【HDU - 5019 】Revenge of GCD (第K大的因子+暴力)
In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest common measure (gcm), of two or more integers (when at least...原创 2019-04-20 21:08:29 · 350 阅读 · 0 评论 -
【HDU - 3092】Least common multiple(数学+完全背包)
Partychen like to do mathematical problems. One day, when he was doing on a least common multiple(LCM) problem, he suddenly thought of a very interesting question: if given a number of S, and we divid...原创 2019-04-20 22:38:59 · 351 阅读 · 0 评论 -
【HDU - 2620】Ice Rain (数学+分块+取余)
Ice Rain------I was waiting for a girl, or waiting for been addicted to the bitter sea. Love for irrigation in silence. No one considered whether the flowers came out or wither. Love which I am not su...原创 2019-04-21 13:38:48 · 322 阅读 · 0 评论 -
【HDU - 3524】Perfect Squares(找规律,推公式,除法取模)
A number x is called a perfect square if there exists an integer bsatisfying x=b^2. There are many beautiful theorems about perfect squares in mathematics. Among which, Pythagoras Theorem is the mos...原创 2019-04-21 16:26:14 · 307 阅读 · 0 评论 -
【HDU - 2683】TCE-frep number system (完全数)
Number theory is one of the oldest branches of pure mathematics, and one of the largest. Of course, it concerns questions about numbers, usually meaning whole numbers or rational numbers (fractions)...原创 2019-04-21 17:09:32 · 284 阅读 · 0 评论 -
【pell方程学习】
转自该博客POJ-1320 Street Numbers pell方程 题目链接:http://poj.org/problem?id=1320 此题可以打表水过,但这里涉及的一个知识点,那就是pell方程,形如 ax^2-by^2=1(a,b为非完全平方数)。 本题最后化简得公式:x^2-8y^2=1 pell方程的迭代解为: Xn = Xn-1 * X1 +...转载 2019-04-26 10:46:46 · 1137 阅读 · 0 评论 -
【2019hdu多校第一场B题 HDU - 6579 】Operation(线性基)
There is an integer sequenceaaof lengthnand there are two kinds of operations:0 l r: select some numbers fromal...ar so that their xor sum is maximum, and print the maximum value. 1 x: append...原创 2019-07-22 21:25:42 · 287 阅读 · 0 评论