UVA251 Nondeterministic Trellis Automata

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=187 [PDF](https://uva.onlinejudge.org/external/2/p251.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA251/07cc88f841ee7e21c5b315a42054a2ca9bd5e6ce.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA251/1a0af07c36a84bbec23e3e0bebd7f4d198866a51.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA251/30f162f6c2c8a672ae710ac351645535447cce1d.png)