NOI2011 Day1 兔农 题目描述:\(fib[1]=fib[2]=1, fib[i]=fib[i-2]+fib[i-1] (i\geq 3)\),若\(fib[i] \equiv 1(mod k)(i \geq 3)\),则\(fib[i]=fib[i]-1\),已知\(k, P\),求\(fib[n] mod P\) solution: 先看一下当\(k=7\)时,\(fib[i] mod k\):(每行的最后一个数变为0) 1, 1, 2, 3, 5, 1 5, 5, 3, 1 3,…