HDU 5895 Mathematician QSC(逆元应用+矩阵快速幂+数论知识)—
传送门 Mathematician QSCTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 208 Accepted Submission(s): 101 Problem Description QSC dream of becoming a mathematician,he believes that everything in this world has a mathematical law. Through unremitting efforts,one day he finally found the QSC sequence,it is a very magical sequence,can be calculated by a series of calculations to predict the results of a course of a semester of a student. This sequence is such like that,first of all, QSC sequence published caused a sensation,after a number of students to find out the results of the prediction is very accurate,the shortcoming is the complex calculation. As clever as you are,can you write a program to predict the mark? Input First line is an integer T(1≤T≤1000). The next T lines were given n,y,x,s,respectively. n、x is 8 bits decimal integer,for example,00001234. y is 4 bits decimal integer,1234. n、x、y are not negetive. 1≤s≤100000000 Output For each test case the output is only one integer number ans in a line. Sample Input
Sample Output
题目大意: 首先定义了1个 最后让你求的是 解题思路: 能够通过矩阵快速幂得到,具体怎样得到的呢,我现在来讲1下: 首先,我们设1个矩阵 1定是1个 然后再来分析我们要求的式子: 然后快速幂就ok了,关键是解决上面 与 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |