题意:F(n)为斐波那契数列的第n项,问你F(F(n)) mod 20160519的值. 发现有循环节,F(26880696)=0,F(26880697)=1,.... 于是两次矩乘快速幂即可. #include<cstdio> #include<vector> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; mat mul…
题面: Problem I. Increasing or DecreasingInput file: standard inputOutput file: standard outputTime limit: 2 secondsMemory limit: 512 mebibytesWe all like monotonic things, and solved many problems about that like Longest Increasing Subsequence(LIS). H…
2016弱校联盟十一专场10.5 传送门 A. As Easy As Possible 假设固定左端点,那么每次都是贪心的匹配\(easy\)这个单词. 从\(l\)开始匹配的单词,将\(y\)的位置标记成有效位置,用主席树维护. 如果\(s_l\ne e\),那么\(l\)与\(l+1\)的匹配结果一致:否则从\(l\)开始匹配到某个位置\(p\)完成单词匹配,我们从\(p+1\)的有效位置继承过来,然后再将\(p\)标记成有效位置即可. B. Be Friends 在二进制下,从高位开始考虑…
Best Solver The so-called best problem solver can easily solve this problem, with his/her childhood sweetheart. It is known that y=(5+26–√)1+2xy=(5+26)1+2x. For a given integer x (0≤x<232)x (0≤x<232) and a given prime number M (M≤46337)M (M≤46337),…
Mathematician QSC Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description QSC dream of becoming a mathematician, he believes that everything in this world has a mathematical law. Through unremitting e…