
基础数学
文章平均质量分 81
wust_cyl
在非洲,瞪羚每天早上醒来时,他知道自己必须跑的比最快的狮子还快,否则就会被吃掉.狮子每天早上醒来时,他知道自己必须追上跑得最慢的瞪羚,否则就会被饿死.不管你是狮子还是瞪羚,当太阳升起时,你最好开始奔跑
展开
-
FZU - 1683(矩阵快速幂)
问题描述:已知 F(n)=3 * F(n-1)+2 * F(n-2)+7 * F(n-3),n>=3,其中F(0)=1,F(1)=3,F(2)=5,对于给定的每个n,输出F(0)+ F(1)+ …… + F(n) mod 2009。Input第一行是一整数m,代表总共有m个cases。Output对于每个case,输出一行。格式见样例,冒号后有一个空格。原创 2017-08-23 16:49:34 · 268 阅读 · 0 评论 -
Codeforces Round #226 (Div. 2) E(矩阵快速幂)
问题描述:Our bear's forest has a checkered field. The checkered field is an n × n table, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right原创 2017-11-07 12:55:03 · 266 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online(1005)
问题描述:We define a sequence F⋅ F0=0,F1=1;⋅ Fn=Fn−1+Fn−2 (n≥2).Give you an integer k, if a positive number n can be expressed byn=Fa1+Fa2+...+Fak where 0≤a1≤a2≤⋯≤ak this positive numbe原创 2017-09-11 08:22:10 · 386 阅读 · 0 评论 -
hdu-4565(矩阵快速幂+推导)
问题描述:A sequence S n is defined as:Sn=[(a+sqrt(b))^(n)] % m,其中[ ] 表示向下取整.Input There are several test cases, each test case in one line contains four positive integers: a, b, n, m. Where 015,原创 2017-08-29 08:39:16 · 703 阅读 · 0 评论 -
hdu-2842(矩阵快速幂+推导)
问题描述:Dumbear likes to play the Chinese Rings (Baguenaudier). It’s a game played with nine rings on a bar. The rules of this game are very simple: At first, the nine rings are all on the bar. The f原创 2017-08-28 19:14:55 · 901 阅读 · 0 评论 -
hdu-4549(矩阵快速幂+欧拉定理)
问题描述: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 Output对每组测试数据请输出一个整原创 2017-08-28 14:36:17 · 420 阅读 · 0 评论 -
hdu-2256(矩阵快速幂+推导)
问题描述:一句话题目:让你求(sqrt(2)+sqrt(3))^(2*n) mod 1024.InputThe first line of input gives the number of cases, T. T test cases follow, each on a separate line. Each test case contains one positive int原创 2017-08-28 10:46:23 · 571 阅读 · 0 评论 -
poj-3734(矩阵快速幂+推导)
问题描述:Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks in a line and原创 2017-08-27 18:43:26 · 352 阅读 · 0 评论 -
poj-3982(矩阵快速幂+大数模板)
问题描述:数列A满足An = An-1 + An-2 + An-3, n >= 3 ,编写程序,给定A0, A1 和 A2, 计算A99Input输入包含多行数据 每行数据包含3个整数A0, A1, A2 (0 数据以EOF结束Output对于输入的每一行输出A99的值Sample Input1 1 1Sample Output原创 2017-08-27 18:32:20 · 369 阅读 · 0 评论 -
UVA 11551(矩阵快速幂)
题目来源:点击打开链接题目题意:题目给我们n个数和r次操作。接在输入n行,表示每次将第i个数变成它后面几个位置的和。重复r次。题目分析:我们按照题目的输入构造01矩阵,0表示不加上这个数,1表示加上。然后矩阵快速幂加速。代码如下:#include#include#include#includeusing namespace std;const int mod=1000;原创 2017-12-05 14:32:26 · 289 阅读 · 0 评论