Type: Default 3000ms 256MiB

3G大厦

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

Ciafang 建了一个巨大无比的 3G 大厦

题目描述

Ciafang 建了一个巨大无比的 3G 大厦,但是他装错电梯了!新装的电梯每次只能上升一层或者两层。现在Ciafang在第 00 层,他想要坐电梯到第 nn 层,请你帮Ciafang计算一下有多少种方式可以乘坐电梯到第 nn 层。

形式化地说:每一次乘电梯等于向上走 11 或 22 层,求从第 0 层走到第 n 层的不同"乘梯顺序"的个数(先后顺序不同算两种方案),答案对 998244353998244353 取模。

格式

输入

一行,一个正整数 n (1≤n≤100001 \le n \le 10000).

输出

一行,即Ciafang坐电梯到第n层的方案数。由于答案可能很大,你需要在输出答案时对998244353取模。

测试样例

4
5
100
246748276

样例解释

在样例一中,Ciafang可以选择的方案有上升(1,1,1,1),(1,1,2),(1,2,1),(2,1,1),(2,2)层共五种

限制

每个测试点的时间限制为 3000 毫秒,内存限制为 256MB

第十二届重庆邮电大学萌新赛

Not Attended
Status
Done
Rule
XCPC
Problem
9
Start at
2026-10-25 14:00
End at
2026-10-25 17:00
Duration
3 hour(s)
Host
Partic.
498