请问poj的1366题是什么意思?

来源:百度知道 编辑:UC知道 时间:2024/06/04 01:10:25
原题如下:
Description
Dr. R. E. Wright's class was studying modified L-Systems. Let us explain necessary details. As a model let us have words of length n over a two letter alphabet {a, b}. The words are cyclic, this means we can write one word in any of n forms we receive by cyclic shift, whereby the first and the last letters in the word are considered to be neighbours.
Rewriting rules rewrite a letter at a position i, depending on letters at the positions i - 2, i, i+1. We rewrite all letters of the word in one step. When we have a given starting word and a set of rewriting rules a natural question is: how does the word look after s rewriting steps?

Help Dr. R. E. Wright and write a program which solves this task.

Input
There are several blocks in the input, each describing one system. There is an integer number n, 2 < n < 16 the length of the input word in the first line. There is a word in the next line. The word contains only lowerc

给你一个长度为n的子串(题目说明其实这个子串是一个环,就是说第一个和最后一个是联接在一起的),求s次改变后的子串变成什么样子?
输入的中间的8行是改变规则。四个字符,c1,c2,c3,c4,表示如果改变前第i-2位是字符c1,第i位是c2,第i+1位是c3,那么i字符就改变成c4~(注意对于第一位,i-2位就是倒数第二个~)
每一次改变,每一位上都要改~

s很大,估计是要找规律的吧~