数学
神探特斯拉
这个作者很懒,什么都没留下…
展开
-
白书练习 Cantor的数表
//// main.cpp// cantor的数表//// Created by 张嘉韬 on 16/1/31.// Copyright © 2016年 张嘉韬. All rights reserved.//#include #include using namespace std;int main(int argc, const char * argv[]) {原创 2016-02-01 10:52:38 · 420 阅读 · 0 评论 -
HDU 5826 physics (数学推导)(规律)
There are n balls on a smooth horizontal straight track. The track can be considered to be a number line. The balls can be considered to be particles with the same mass.At the beginning, ball i is原创 2016-08-11 19:10:30 · 455 阅读 · 0 评论 -
POJ 2891 Strange Way to Express Integers(一元线性同余方程组)
Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 14168 Accepted: 4590DescriptionElina is reading a book written by Ruji原创 2016-08-24 12:19:26 · 247 阅读 · 0 评论 -
同余问题知识整理
一.一元线性同余方称解法1.问题描述:求解满足条件的 ax==b(mod m) 2.问题分析:(1)根据同余定理我们可以把上面的等式化为一个简单的形式ax+my=b,那么我们只要求解这里的x,y或者说x就可以了,那么很明显啊,稍微变形一下就可以用拓展欧几里德算法结解决了,a*( x*gcd(a,m) /b ) + m*( y*gcd(a,m) /b)= gcd(a,m)就可以求解出来原创 2016-08-24 12:21:27 · 4054 阅读 · 0 评论 -
POJ 2115 C Looooops(拓展欧几里德)
C LooooopsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 23914 Accepted: 6613DescriptionA Compiler Mystery: We are given a C-language style for loop of原创 2016-08-24 16:33:27 · 232 阅读 · 0 评论 -
HDOJ 5832 a water problem(大数取模)
Problem DescriptionTwo planets named Haha and Xixi in the universe and they were created with the universe beginning.There is 73 days in Xixi a year and 137 days in Haha a year. Now yo原创 2016-08-14 20:17:51 · 306 阅读 · 0 评论 -
HHU Boxes and Balls(找规律)
问题 C: Boxes and Balls时间限制: 1 Sec 内存限制: 64 MB提交: 9 解决: 7[提交][状态][讨论版]题目描述Tom’s friend Jerry, from KBW, just showed him a gr原创 2016-09-06 20:31:57 · 1024 阅读 · 0 评论 -
HHU LCM and Walk (DFS+数论)
题目描述Jerry has just learned some number theory, and can't wait to show his ability to Tom.Now Jerry is sitting on a grid map of infinite rows and columns. Rows are numbered 1,2,⋯ from the bottom,原创 2016-09-07 18:26:29 · 257 阅读 · 0 评论 -
数三角形Triangel Counting UVa 11401()
题意给定一个整数n,有多少种方法可以从1、2、3、、、n中选择元素构成三角形?分析我们设三角形的三边长度分别为x, y, z,若我们假设x是最长边,,因为我们规定了x是最长边,所以根据加法原理,这些三角形和其他x构成的三角形一定是不一样的,我们设以x为最长边构成三角形的数量为c(x)。 根据三角形的性质我们不难得出x - y < z < x,当y = 1时 z有0个解,当y = 2 时 z有1个解原创 2017-08-19 09:20:58 · 253 阅读 · 0 评论 -
CheerLeaders Uva 11806(容斥原理)
题意给定一个n * m矩阵,和 k 个石子,将 k 个石子全都放到这个矩阵中,使得第一行、第一列、最后一行、最后一列都必须要有石子,请问有多少种放法?分析问题的正面不容易解,我们就从问题的反面开始研究,我们将k个石子没有限制的放到矩阵中的方法定义为全集S,我们所想要求解的集合T也一定在这个全集中,我们分析后发现,如果我们设第一行没有石子的情况为集合A,第一列没有石子为集合B,最后一行没有石子为集合C原创 2017-08-19 09:38:32 · 244 阅读 · 0 评论 -
UVA 10791 Minimum Sum LCM(质因数分解+数学分析)
LCM (Least Common Multiple) of a set of integers is defined as the minimum number, which is a multiple of all integers of that set. It is interesting to note that any positive integer can be expressed原创 2016-08-03 11:34:37 · 830 阅读 · 0 评论 -
UVA 12169 Disgruntled Judge (拓展欧几里德)
Once upon a time, there was an nwerc judge with a tendency to create slightly too hard problems. As a result, his problems were never solved. As you can image, this made our judge somewhat frustrate原创 2016-08-01 11:36:57 · 344 阅读 · 0 评论 -
UVA 11582 巨大数的斐波那契数列 (大数取模,幂取模,模的计算方法)
Problem F: Colossal Fibonacci Numbers!The i'th Fibonacci number f (i) is recursively defined in the following way:f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i) for every i ≥ 0Your ta原创 2016-07-31 21:22:32 · 3094 阅读 · 0 评论 -
HDOJ 1046 gridland
GridlandTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5445 Accepted Submission(s): 2477Problem DescriptionFor years, computer s原创 2016-03-19 17:46:32 · 768 阅读 · 0 评论 -
HDOJ 1021 Fibonacci Again
saProblem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). InputInput consists of a sequence of lines, each containin原创 2016-03-10 00:09:51 · 270 阅读 · 0 评论 -
POJ 1338 Ugly Numbers(丑数)
一.问题分析首先啊。。。。这种题在有了大致的思路了以后就不要再照着书去实现了,真的就没什么意思了》》但就这个问题本身而言还是蛮有意思的嘛,用到了集合法对元素进行判重,其实map也是可以实现的嘛,还有就是一开始我的想法是按照素数分解每个丑数都可以分解成为2^z*3^x*5^y,这种形式,但是一时也没找出好的方案来生成合理有序的xyz序列(其实根本就是没有动脑子吧,下次中午要好好睡觉!),最后发现原创 2016-05-12 15:43:37 · 363 阅读 · 0 评论 -
HDOJ 5734 Acperience (数学推导)
AcperienceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 508 Accepted Submission(s): 271Problem DescriptionDeep neural netwo原创 2016-07-22 21:16:19 · 450 阅读 · 0 评论 -
HDOJ 4497 GCD and LCM
Problem DescriptionGiven two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = L? Note, gcd(x, y, z) mea原创 2016-07-23 13:44:44 · 275 阅读 · 0 评论 -
NEFU 115(斐波那契整除问题)(找寻环节)
Description已知斐波那契数列有如下递归定义,f(1)=1,f(2)=1, 且n>=3,f(n)=f(n-1)+f(n-2),它的前几项可以表示为1, 1,2 ,3 ,5 ,8,13,21,34…,现在的问题是想知道f(n)的值是否能被3和4整除,你知道吗?Input输入数据有若干组,每组数据包含一个整数n(1< n &l原创 2016-07-23 15:17:11 · 393 阅读 · 0 评论 -
HDOJ 5747Aaronson
Recently, Peter saw the equation x0+2x1+4x2+...+2mxm=n. He wants to find a solution (x0,x1,x2,...,xm) in such a manner that ∑i=0mxi is minimum and every xi (0≤i≤m) is non-negative. I原创 2016-07-24 18:24:15 · 239 阅读 · 0 评论 -
HDOJ 5744 Keep On Movin(最大化最短回文串长度)
Professor Zhang has kinds of characters and the quantity of the i-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He also wants to maximize t原创 2016-07-24 18:34:06 · 539 阅读 · 0 评论 -
nefu 117素数个数的位数(位数问题)
小明是一个聪明的孩子,对数论有着很浓烈的兴趣。他发现求1到正整数10n 之间有多少个素数是一个很难的问题,该问题的难以决定于n 值的大小。现在的问题是,告诉你n的值,让你帮助小明计算小于10n的素数的个数值共有多少位?Input输入数据有若干组,每组数据包含1个整数n(1 < n < 1000000000),若遇到EOF则处理结束。原创 2016-07-25 10:00:51 · 412 阅读 · 0 评论 -
Chess Queen Uva 11538(基础计数原理)
题意将黑色皇后和白色皇后两个皇后放到一个 n * m的棋盘当中,使得她们能够相互攻击,请问有多少种放置方法?分析这道题用到了分类讨论的思想,如果两个皇后相互攻击,那么有三种情况,两者同列、两者同行、两者同对角线。同对角线的数量推起来稍微麻烦一点。然后将三种相加即可。代码c++#include <iostream>#include <cstring>#include <algorithm>us原创 2017-08-19 09:48:20 · 208 阅读 · 0 评论