Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Automaton optimization
Description Linear cellular automaton is an infinite sequence of cells, each holding either 0 or 1. Cells are indexed with integers, extending from some chosen "zero" cell in both positive and negative directions. In the initial (first) state all except the finite number of cells contain 0. Next state is computed from previous one by a simple rule: new cell value is 1 if the cell had exactly one neighbour with value 1, otherwise 0. Although computing states is easy and fast, researchers are often interested in states after very many steps. Because these states may occupy large amount of memory, only parts of them are usually printed. Your program must, given the initial state, quickly find values for S-th state for cells with indexes Input Input file contains number of non-zero cells in the initial state S F L. All indexes are different.## Constraints1 ≤ Output Output file must contain Sample Input
Sample Output
Hint Bold texts appearing in the sample sections are informative and do not form part of the actual data. Source Northeastern Europe 2006, Far-Eastern Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator