76937985
18501391
77486751
9532112
55733118
62747223
84747485
49457684
55674861
76397937
用户输出
76937985
18501391
77486751
9532112
55733118
62747223
84747485
49457684
55674861
76397937
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#4925 | #1026. 贝尔数 | Time Limit Exceeded | 50 | 14688 ms | 11556 K | Python 3 / 491 B | t330034045 | 2024-02-20 22:28:46 |
maxn = 2000 + 5
mod=95041567
bell = [[0 for i in range(maxn + 1)] for j in range(2)]
from functools import lru_cache
@lru_cache(maxsize=None)
def f(n):
bell[0][0] = 1
for i in range(1, n + 1):
bell[i%2][0] = bell[(i - 1)%2][i - 1]
for j in range(1, i + 1):
bell[i%2][j] = bell[(i - 1)%2][j - 1] + bell[i%2][j - 1]
return bell[n%2][0]%mod
n=int(input())
for i in range(n):
ans=f(int(input()))
ans=int(ans%mod)
print(ans)
76937985
18501391
77486751
9532112
55733118
62747223
84747485
49457684
55674861
76397937
用户输出
76937985
18501391
77486751
9532112
55733118
62747223
84747485
49457684
55674861
76397937
系统信息
Exited with return code 0
4140
92794804
38625612
19057663
71972345
34967372
59500598
16567322
55032137
29342953
用户输出
4140
92794804
38625612
19057663
71972345
34967372
59500598
16567322
55032137
29342953
系统信息
Exited with return code 0
6462275
92670570
72700804
94459081
14309496
49546786
78283755
51508015
22241779
55613196
用户输出
6462275
92670570
72700804
94459081
14309496
49546786
78283755
51508015
22241779
55613196
系统信息
Exited with return code 0
38251537
91945689
1463368
948382
32482410
42555409
87104867
62466879
60132395
42747870
用户输出
38251537
91945689
1463368
948382
32482410
42555409
87104867
62466879
60132395
42747870
系统信息
Exited with return code 0
71523183
54072612
86815930
68316232
65232219
65773902
66165609
37946748
12774328
67173499
用户输出
71523183
54072612
86815930
68316232
65232219
65773902
66165609
37946748
12774328
67173499
系统信息
Exited with return code 0
标准错误流
Traceback (most recent call last):
File "/sandbox/2/a.py", line 16, in <module>
ans=f(int(input()))
File "/sandbox/2/a.py", line 11, in f
bell[i%2][j] = bell[(i - 1)%2][j - 1] + bell[i%2][j - 1]
IndexError: list assignment index out of range
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 1
标准错误流
Traceback (most recent call last):
File "/sandbox/2/a.py", line 16, in <module>
ans=f(int(input()))
File "/sandbox/2/a.py", line 11, in f
bell[i%2][j] = bell[(i - 1)%2][j - 1] + bell[i%2][j - 1]
IndexError: list assignment index out of range
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 1