当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6426:Problem A.Alkane

题目描述
In organic chemistry, an alkane is an acyclic saturated hydrocarbon. In other words, an alkane consists of hydrogen and carbon atoms arranged in a tree structure in which all the carbon-carbon bonds are single. Alkanes have the general chemical formula CnH2n+2.
In an alkane, each carbon atom has 4 bonds (either C-C or C-H), and each hydrogen atom is joined to one of the carbon atoms (so in a C-H bond). The number of carbon
atoms may be thought of as the size of the alkane.
Alkanes with more than 3 carbon atoms can be arranged in various different ways, forming structural isomers. The simplest isomer of an alkane is the one in which the carbon atoms are arranged in a single chain with no branches. This isomer is sometimes called the n-isomer. However the chain of carbon atoms may also be branched at one or more points. The number of possible isomers increases rapidly with the number of carbon atoms.
Moreover, we define an alkyl is an alkane missing one hydrogen. An acyclic alkyl has the general formula CnH2n+1. The defination of structural isomer of alkyls is similar to alkanes’.
Now you need to count the number of structural isomers of alkanes and alkyls of size n modulo 998244353.
输入解释
The first line of the input contains an integer T , denoting the number of test cases.
In each test case, there is a single integer n in one line, denoting the size of alkanes and alkyls.
1 ≤ T ≤ 100000, 1 ≤ n ≤ 100000
输出解释
For each test case, output one line contains two integers, denoting the number of structural isomers of alkanes and alkyls of size n modulo 998244353.
输入样例
9
1
2
3
4
5
6
7
8
9
输出样例
1 1
1 1
1 2
2 4
3 8
5 17
9 39
18 89
35 211

提示
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6426

最后修改于 2020-10-25T23:31:14+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 524288/524288K(Java/Others)