首先不难得出递推式f[i]=(f[i-1]*10^k+i) mod m;f[i]表示接到第i个数时的余数,k表示i的位数不难想到先按位数穷举位数,然后对于确定的位数,构造矩阵解决易得出:f[i]    10^k  1   1      f[i-1]  i   =   0    1   1   *    i-1 1       0    0   1         1矩阵乘法优化的特点就是有一维特别
转载 2014-12-31 21:41:00
57阅读
2评论
题意:y题解:#include #include #include using namespace std;const int N = 205;struct P {
原创 2023-06-29 00:03:42
14阅读
矩阵快速幂。
转载 2016-09-26 20:13:00
56阅读
2评论
[HNOI2011]数学作业 Description 思路:令f[n]表示Concatenate(1,n)。那么有: f[i]=f[i-1]*10+(i-1)+1 1<=i<=9 f[i]=f[i-1]*100+(i-1)+1 10<=i<=99 …… 因此可用矩阵加速: 但是,这个矩阵是分段的。
转载 2017-12-19 18:34:00
75阅读
2评论
Network Working Group                            &
转载 精选 2015-06-02 21:24:48
645阅读
Schulzrinne, et. al.        Standards Track                 
转载 精选 2015-06-02 21:28:10
3687阅读
思路:矩阵快速幂搞一搞。
转载 2018-09-28 18:59:00
47阅读
2评论
题目大意:有400个箱子,奇数的箱子在北边,偶数的箱子在南边,每个箱子的大小都一样。北边和南边之间有一条走廊,走廊的宽度刚好是一个箱子的宽度。 现在有M个移动操作,工人每次移动箱子需要10分钟(你有无限个工人,因为有走廊的约束,不能有两个箱子公用一段走廊)。问需要多少分钟能把这些操作做完解题思路:先将奇数的箱子和偶数的箱子做一下处理,避免1 3和4 6操作只需要10分钟这种情况。输入的时候要注意
原创 2023-04-07 10:51:32
36阅读
Schulzrinne, et. al.        Standards Track                 
转载 精选 2015-06-02 21:26:57
1054阅读
把房间号映射在一条坐标上,然后排序,最后找从左到右找一次可行的计划,最后找从左到右找一次可行的计划,最后找从左到右找一次可行的计划,最后找从左到右找一次可行的计划, ............ 次数*10就
转载 2017-06-14 18:52:00
38阅读
2评论
nchapi...
VS2013编译程序时出现错误:fatal error C1189: #error : "No Target Architecture"。解决方案如下
原创 2018-06-05 16:09:28
10000+阅读
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2326设f[i]表示i的答案,那么f[i] = f[i - 1] * 10 + i (i >1)#define mem(a,b) memset(a,b,sizeof(a))using...
转载 2013-04-02 12:40:00
71阅读
2评论
2326: [HNOI2011]数学作业Time Limit:10 Sec  Memory Limit: 128 MBSubmit: 2067  Solved: 1205[Su
原创 2023-07-07 13:28:20
22阅读
The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan to reform its system. The reform includes moving a lot of tables
转载 2013-08-24 20:19:00
59阅读
2评论
The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan to reform its system. The reform includes moving a lot of tables
转载 2013-08-23 18:45:00
37阅读
2评论
题目连接:2326 - Moving Tables 题目大意:在一个走廊上有400个教室, 先在有一些桌子要移动, 每次移动需要十分钟, 但是不同房间的桌子可以在同一个十分钟内移动,只要走廊没有被占用就可以, 注意教室序号1 和 2 是在对面。 注意:给出的区间没有分左边或者是右边比较大。解题思路:区间覆盖问题, 将所有给出的区间处理一下, 去除对面房间这样的情况。 让后将区间按照l 和 r 的值进行排序, 然后看进行几次区间覆盖可以使得所有区间均被用上。 #include #include #include using namespace std;const int N = 205;stru
转载 2013-09-01 00:29:00
122阅读
2评论
2326: 大数的乘法【1 = 1111111111111111...
原创 2022-07-26 16:41:36
164阅读
题目描述 小 C 数学成绩优异,于是老师给小 C 留了一道非常难的数学作业题: 给定正整数 N 和 M,要求计算 Concatenate (1 .. N) Mod M 的值,其中 Concatenate (1 ..N)是将所有正整数 1, 2, …, N 顺序连接起来得到的数。例如,N = 13,
转载 2017-09-12 08:52:00
35阅读
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2326设f[i]表示i的答案,那么f[i] = f[i - 1] * 10 + i (i >1)#define mem(a,b) memset(a,b,sizeof(a))using...
转载 2013-04-02 12:40:00
41阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5