ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#187609 | #3347. 映射 | darksoul | 100 | 364ms | 76776kb | C++11 | 250b | 2023-10-02 11:20:10 | 2023-10-02 12:17:05 |
answer
#include <bits/stdc++.h>
using namespace std;
long long n,dp[10000005];
int main()
{
cin >> n;
dp[1] = 1,dp[2] = 2;
for (int i = 3; i <= n; i++)
dp[i] = dp[i - 1] + dp[i - 2] * (i - 1),dp[i] %= 998244353;
cout << dp[n];
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 5
Accepted
time: 0ms
memory: 1196kb
input:
7
output:
232
result:
ok single line: '232'
Test #2:
score: 5
Accepted
time: 0ms
memory: 1196kb
input:
4
output:
10
result:
ok single line: '10'
Test #3:
score: 5
Accepted
time: 0ms
memory: 1196kb
input:
9
output:
2620
result:
ok single line: '2620'
Test #4:
score: 5
Accepted
time: 0ms
memory: 1200kb
input:
7
output:
232
result:
ok single line: '232'
Test #5:
score: 5
Accepted
time: 0ms
memory: 1196kb
input:
199
output:
946214672
result:
ok single line: '946214672'
Test #6:
score: 5
Accepted
time: 0ms
memory: 1200kb
input:
351
output:
68529600
result:
ok single line: '68529600'
Test #7:
score: 5
Accepted
time: 0ms
memory: 1200kb
input:
511
output:
903273780
result:
ok single line: '903273780'
Test #8:
score: 5
Accepted
time: 0ms
memory: 1204kb
input:
669
output:
859250862
result:
ok single line: '859250862'
Test #9:
score: 5
Accepted
time: 0ms
memory: 1364kb
input:
21429
output:
24969958
result:
ok single line: '24969958'
Test #10:
score: 5
Accepted
time: 0ms
memory: 1404kb
input:
26208
output:
299979917
result:
ok single line: '299979917'
Test #11:
score: 5
Accepted
time: 0ms
memory: 1496kb
input:
38557
output:
507040672
result:
ok single line: '507040672'
Test #12:
score: 5
Accepted
time: 0ms
memory: 1940kb
input:
95011
output:
523339279
result:
ok single line: '523339279'
Test #13:
score: 5
Accepted
time: 41ms
memory: 41864kb
input:
5205179
output:
190452637
result:
ok single line: '190452637'
Test #14:
score: 5
Accepted
time: 36ms
memory: 43412kb
input:
5403285
output:
170502051
result:
ok single line: '170502051'
Test #15:
score: 5
Accepted
time: 42ms
memory: 74944kb
input:
9439303
output:
345786811
result:
ok single line: '345786811'
Test #16:
score: 5
Accepted
time: 36ms
memory: 47200kb
input:
5888901
output:
652728214
result:
ok single line: '652728214'
Test #17:
score: 5
Accepted
time: 56ms
memory: 76776kb
input:
9673673
output:
894429326
result:
ok single line: '894429326'
Test #18:
score: 5
Accepted
time: 33ms
memory: 49088kb
input:
6130085
output:
607781600
result:
ok single line: '607781600'
Test #19:
score: 5
Accepted
time: 54ms
memory: 56328kb
input:
7056601
output:
440814698
result:
ok single line: '440814698'
Test #20:
score: 5
Accepted
time: 66ms
memory: 68244kb
input:
8582001
output:
681544526
result:
ok single line: '681544526'