ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#187571 | #3347. 映射 | xyl | 100 | 485ms | 303484kb | C++ | 227b | 2023-10-02 10:49:57 | 2023-10-02 12:15:00 |
answer
#include <bits/stdc++.h>
using namespace std;
long long a,b[2]={2,1};
void ss(long long x){
if(x<3)return;
ss(x-1),b[x%2]=(b[x%2]*(x-1)+b[(x+1)%2])%998244353;
}
int main(){scanf("%lld",&a),ss(a),printf("%lld",b[a%2]);}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 5
Accepted
time: 0ms
memory: 1188kb
input:
7
output:
232
result:
ok single line: '232'
Test #2:
score: 5
Accepted
time: 0ms
memory: 1188kb
input:
4
output:
10
result:
ok single line: '10'
Test #3:
score: 5
Accepted
time: 0ms
memory: 1188kb
input:
9
output:
2620
result:
ok single line: '2620'
Test #4:
score: 5
Accepted
time: 0ms
memory: 1188kb
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: 1192kb
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: 1212kb
input:
669
output:
859250862
result:
ok single line: '859250862'
Test #9:
score: 5
Accepted
time: 0ms
memory: 1856kb
input:
21429
output:
24969958
result:
ok single line: '24969958'
Test #10:
score: 5
Accepted
time: 0ms
memory: 2008kb
input:
26208
output:
299979917
result:
ok single line: '299979917'
Test #11:
score: 5
Accepted
time: 0ms
memory: 2392kb
input:
38557
output:
507040672
result:
ok single line: '507040672'
Test #12:
score: 5
Accepted
time: 0ms
memory: 4152kb
input:
95011
output:
523339279
result:
ok single line: '523339279'
Test #13:
score: 5
Accepted
time: 40ms
memory: 163852kb
input:
5205179
output:
190452637
result:
ok single line: '190452637'
Test #14:
score: 5
Accepted
time: 56ms
memory: 170040kb
input:
5403285
output:
170502051
result:
ok single line: '170502051'
Test #15:
score: 5
Accepted
time: 79ms
memory: 296160kb
input:
9439303
output:
345786811
result:
ok single line: '345786811'
Test #16:
score: 5
Accepted
time: 48ms
memory: 185220kb
input:
5888901
output:
652728214
result:
ok single line: '652728214'
Test #17:
score: 5
Accepted
time: 87ms
memory: 303484kb
input:
9673673
output:
894429326
result:
ok single line: '894429326'
Test #18:
score: 5
Accepted
time: 51ms
memory: 192752kb
input:
6130085
output:
607781600
result:
ok single line: '607781600'
Test #19:
score: 5
Accepted
time: 64ms
memory: 221708kb
input:
7056601
output:
440814698
result:
ok single line: '440814698'
Test #20:
score: 5
Accepted
time: 60ms
memory: 269372kb
input:
8582001
output:
681544526
result:
ok single line: '681544526'