680. Yarra Gnisrever

Let and be two positive integers.

is the -th Fibonacci number: , for all . Let and let .

Start with an array of integers where initially every is equal to . Now perform successive operations on , where the -th operation consists of reversing the order of those elements in with indices between and (both ends inclusive).

Define to be after operations.

For example, , as can be seen from the following procedure: Initial position:

Step 1 - Reverse to : Step 2 - Reverse to : Step 3 - Reverse to : Step 4 - Reverse to :

Also, and . Find giving your answer modulo .

680. 组数转翻1

是两个正整数。

是第 个斐波那契数,其中 ,且对于正整数 。再记

我们给定一个正整数数组 。初始时每个 均等于 现在我们接连对数组 进行 次操作。对于第 次操作,你需要将 中的 这段区间翻转。

然后,记 为经过 次操作后, 的值。

例如 ,计算它的过程如下:

亦已知 之值。


这个链接 回到源站。

这个链接 回到详细版题目目录。


1 分别翻转 yarra 和 gnisrever 后得到 array reversing(数组翻转)。又因为两个词被分别翻转,故将数组、翻转两词分别翻转,译作“组数转翻”。
2 虽然没有说明,但读者应该也能发现这里是翻转了区间 。翻译保留原状的原因是 顺序固定。