
数学
BYSora
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj2527——Polynomial Remains(多项式相除)
DescriptionGiven the polynomial a(x) = an xn + ... + a1 x + a0,compute the remainder r(x) when a(x) is divided by xk+1.InputThe input consists of a number of cases. The first line of e原创 2016-03-31 14:02:31 · 674 阅读 · 0 评论 -
蓝桥杯算法提高——递推求值(矩阵快速幂)
问题描述 已知递推公式: F(n, 1)=F(n-1, 2) + 2F(n-3, 1) + 5, F(n, 2)=F(n-1, 1) + 3F(n-3, 1) + 2F(n-3, 2) + 3. 初始值为:F(1, 1)=2, F(1, 2)=3, F(2, 1)=1, F(2, 2)=4, F(3, 1)=6, F(3, 2)=5。 输入n,输出F(n, 1)和F(n, 2),由原创 2017-03-30 19:18:19 · 1230 阅读 · 0 评论 -
蓝桥杯历届试题——数字游戏
问题描述 栋栋正在和同学们玩一个数字游戏。 游戏的规则是这样的:栋栋和同学们一共n个人围坐在一圈。栋栋首先说出数字1。接下来,坐在栋栋左手边的同学要说下一个数字2。再下面的一个同学要从上一个同学说的数字往下数两个数说出来,也就是说4。下一个同学要往下数三个数,说7。依次类推。 为了使数字不至于太大,栋栋和同学们约定,当在心中数到 k-1 时,下一个数字从0开始数。例如,当k=13时,栋栋和原创 2017-03-14 21:28:12 · 845 阅读 · 1 评论 -
hdu5066——Harry And Physical Teacher(物理)
Problem Description As we all know, Harry Porter learns magic at Hogwarts School. However, learning magical knowledge alone is insufficient to become a great magician. Sometimes, Harry also has to gai原创 2017-04-02 16:28:26 · 810 阅读 · 0 评论 -
hdu5015——233 Matrix(矩阵快速幂)
Problem Description In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 … in the same meaning. And here is the question: Suppose we have a matrix ca原创 2017-04-18 13:05:00 · 858 阅读 · 0 评论 -
hdu4965——Fast Matrix Calculation(快速矩阵幂优化)
Problem Description One day, Alice and Bob felt bored again, Bob knows Alice is a girl who loves math and is just learning something about matrix, so he decided to make a crazy problem for her.Bob has原创 2017-04-18 14:07:42 · 759 阅读 · 0 评论 -
蓝桥杯算法提高——6-17复数四则运算
设计复数库,实现基本的复数加减乘除运算。 输入时只需分别键入实部和虚部,以空格分割,两个复数之间用运算符分隔;输出时按a+bi的格式在屏幕上打印结果。参加样例输入和样例输出。 注意考虑特殊情况,无法计算时输出字符串”error”。 样例输入 2 4 * -3 2 样例输出 -14-8i 样例输入 3 -2 + -1 3 样例输出 2+1i算是比较全面了,先存着防止以后再去原创 2017-04-05 16:47:25 · 685 阅读 · 0 评论 -
poj3318——Matrix Multiplication(随机化算法)
DescriptionYou are given three n × n matrices A, B and C. Does the equation A × B = C hold true?InputThe first line of input contains a positive integer n (n ≤ 500) followed by the the three matrices A原创 2017-04-28 21:08:41 · 1428 阅读 · 0 评论 -
hdu4549——M斐波那契数列(费马小定理+矩阵快速幂)
Problem Description M斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = a F[1] = b F[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗?Input 输入包含多组测试数据; 每组数据占一行,包含3个整数a, b, n( 0 <= a, b, n <= 10^9 )Output 对每组测试原创 2017-04-18 21:27:30 · 882 阅读 · 0 评论 -
蓝桥杯算法提高——最大乘积
问题描述 对于n个数,从中取出m个数,如何取使得这m个数的乘积最大呢? 输入格式 第一行一个数表示数据组数 每组输入数据共2行: 第1行给出总共的数字的个数n和要取的数的个数m,1<=n<=m<=15, 第2行依次给出这n个数,其中每个数字的范围满足:a[i]的绝对值小于等于4。 输出格式 每组数据输出1行,为最大的乘积。 样例输入 1 5 5 1 2原创 2017-04-06 17:12:38 · 871 阅读 · 0 评论 -
csu1781——阶乘除法
Description 输入两个正整数 n, m,输出 n!/m!,其中阶乘定义为 n!= 1*2*3*…*n (n>=1)。 比如,若 n=6, m=3,则 n!/m!=6!/3!=720/6=120。是不是很简单?现在让我们把问题反过来:输入 k=n!/m!,找到这样的整数二元组(n,m) (n>m>=1)。如果答案不唯一,n 应该尽量小。比如,若 k=120,输出应该是 n=5, m=1,而原创 2017-04-19 21:32:33 · 764 阅读 · 0 评论 -
csu1803——2016(数学)
Description给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数。 Input输入包含不超过 30 组数据。 每组数据包含两个整数 n,m (1≤n,m≤109). Output 对于每组数据,输出一个整数表示满足条件的数量。 Sample Input 32 63 20原创 2017-05-02 14:16:36 · 1456 阅读 · 0 评论 -
poj1552——Doubles
DescriptionAs part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list原创 2017-05-03 14:42:10 · 2041 阅读 · 0 评论 -
hdu4990——Reading comprehension(矩阵快速幂)
Read the program below carefully then answer the question. #pragma comment(linker, “/STACK:1024000000,1024000000”) #include < cstdio> #include < iostream> #include < cstring> #include < cmath原创 2017-03-30 18:19:19 · 635 阅读 · 0 评论 -
lightoj1311——Unlucky Bird(数学)
A bird was flying on a train line, singing and passing lazy times. After a while it saw a train coming from its behind, so, it speeded up a bit, but remained calm. After a while it saw another train co原创 2017-03-29 19:36:47 · 746 阅读 · 0 评论 -
poj3070——Fibonacci(矩阵快速幂)
DescriptionIn 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 alt原创 2017-03-29 16:52:23 · 977 阅读 · 0 评论 -
hdu5734——Acperience(数学推导)
Problem Description Deep neural networks (DNN) have shown significant improvements in several application domains including computer vision and speech recognition. In computer vision, a particular typ原创 2016-08-08 13:08:31 · 589 阅读 · 0 评论 -
hdu5776——sum(抽屉原理)
Problem Description Given a sequence, you’re asked whether there exists a consecutive subsequence whose sum is divisible by m. output YES, otherwise output NOInput The first line of the input has an原创 2016-08-08 17:21:45 · 543 阅读 · 0 评论 -
hdu5752——Sqrt Bo(水)
Problem Description Let’s define the function .Bo wanted to know the minimum number which satisfies .note:It is a pity that Bo can only use 1 unit of time to calculate this function each time.And Bo原创 2016-08-08 18:59:51 · 411 阅读 · 0 评论 -
hdu5810——Balls and Boxes(数学推导)
Problem Description Mr. Chopsticks is interested in random phenomena, and he conducts an experiment to study randomness. In the experiment, he throws n balls into m boxes in such a manner that each ba原创 2016-08-09 20:11:58 · 664 阅读 · 0 评论 -
Lightoj1189——Sum of Factorials(阶乘的和+贪心)
Given an integer n, you have to find whether it can be expressed as summation of factorials. For given n, you have to report a solution such thatn = x1! + x2! + … + xn! (xi < xj for all i < j)Input In原创 2016-09-05 19:35:06 · 461 阅读 · 0 评论 -
hdu1002——A + B Problem II(大数加)
Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.Input The first line of the input contains an integer T(1<=T<=20) which原创 2016-11-18 19:54:43 · 390 阅读 · 0 评论 -
hdu5984——Pocky(数学期望)
Problem Description Let’s talking about something of eating a pocky. Here is a Decorer Pocky, with colorful decorative stripes in the coating, of length L. While the length of remaining pocky is long原创 2016-11-21 19:08:00 · 4283 阅读 · 0 评论 -
poj1019——Number Sequence(数学)
DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2…Sk. Each group Sk consists of a sequence of positive i原创 2017-02-10 23:20:16 · 963 阅读 · 0 评论 -
poj3273——Monthly Expense(二分)
DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,0原创 2017-02-12 15:50:05 · 629 阅读 · 0 评论 -
蓝桥杯算法训练——矩阵乘法
问题描述 输入两个矩阵,分别是m*s,s*n大小。输出两个矩阵相乘的结果。 输入格式 第一行,空格隔开的三个正整数m,s,n(均不超过200)。 接下来m行,每行s个空格隔开的整数,表示矩阵A(i,j)。 接下来s行,每行n个空格隔开的整数,表示矩阵B(i,j)。 输出格式 m行,每行n个空格隔开的整数,输出相乘後的矩阵C(i,j)的值。 样例输入 2 3 2原创 2017-03-01 16:40:49 · 625 阅读 · 0 评论 -
蓝桥杯算法训练——最小乘积(基本型)
问题描述 给两组数,各n个。 请调整每组数的排列顺序,使得两组数据相同下标元素对应相乘,然后相加的和最小。要求程序输出这个最小值。 例如两组数分别为:1 3 -5和-2 4 1 那么对应乘积取和的最小值应为: (-5) * 4 + 3 * (-2) + 1 * 1 = -25 输入格式 第一个行一个数T表示数据组数。后面每组数据,先读入一个n,接下来两行每行n个数原创 2017-03-01 19:06:06 · 848 阅读 · 0 评论 -
poj1942——Paths on a Grid(求阶乘)
DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he’s explaining that (a+b)2=a原创 2017-03-01 20:47:06 · 962 阅读 · 0 评论 -
poj1658——Eva's Problem
DescriptionEva的家庭作业里有很多数列填空练习。填空练习的要求是:已知数列的前四项,填出第五项。因为已经知道这些数列只可能是等差或等比数列,她决定写一个程序来完成这些练习。 Input第一行是数列的数目t(0 <= t <= 20)。以下每行均包含四个整数,表示数列的前四项。约定数列的前五项均为不大于10^5的自然数,等比数列的比值也是自然数。 Output对输入的每个数列,输出它的原创 2017-05-03 15:11:06 · 1576 阅读 · 0 评论