zoj 2185 || poj 1969 Count on Canton

来源:互联网 发布:网上订电影票软件 编辑:程序博客网 时间:2024/06/05 18:46
1/1 1/2 1/3 1/4 1/5 ...
2/1 2/2 2/3 2/4
3/1 3/2 3/3
4/1 4/2
5/1
In the above diagram, the first term is 1/1, the second term is 1/2, the third term is 2/1, the fourth term is 3/1, the fifth term is 2/2, and so on.
也就是
按 1/1 1/2 2/1 3/1 2/2 1/3。。。排序。。。规律很明显。
分子都是 1  1  2  1  2  3   1  2  3  4  1.。。。
分母都是 1  2  1  3  2  1   4  3  2  1  5.。。。。
很明显了吧。不过呢 是s型排列。。。所以呢这么求出来之后需要看在斜行的奇偶性,如果在偶行,需要把分子分母颠倒下。
 
原创粉丝点击