ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#213788 | #2157. 数列 | zhangxinyang111 | 0 | 311ms | 8940kb | C++ | 316b | 2024-11-13 19:39:49 | 2024-11-13 23:02:38 |
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+7;
int f[N];
int n,p;
signed main()
{
// cin.tie(nullptr) -> ios::sync_with_stdio(false);
cin>>n>>p;
f[1]=1;
for(int i=2;i<=n;i++) f[i]=f[i-1]*(4*n-2)/(n+1)%p;
cout<<f[n]%p;
return 0;
}
//f[n]=f[n-1]*(4*n-2)/(n+1)
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1200kb
input:
921 998054347
output:
735900464
result:
wrong answer 1st lines differ - expected: '345389219', found: '735900464'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1196kb
input:
926 998064329
output:
132150349
result:
wrong answer 1st lines differ - expected: '458756691', found: '132150349'
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 1200kb
input:
1000 998074327
output:
282409326
result:
wrong answer 1st lines differ - expected: '457273797', found: '282409326'
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 1204kb
input:
952 998084303
output:
271223308
result:
wrong answer 1st lines differ - expected: '329700115', found: '271223308'
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 1204kb
input:
989 998094347
output:
426352692
result:
wrong answer 1st lines differ - expected: '94788253', found: '426352692'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1200kb
input:
902 998104313
output:
284797889
result:
wrong answer 1st lines differ - expected: '911969455', found: '284797889'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 1200kb
input:
914 998114333
output:
532230696
result:
wrong answer 1st lines differ - expected: '827812986', found: '532230696'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 1200kb
input:
986 998124313
output:
151652494
result:
wrong answer 1st lines differ - expected: '169699253', found: '151652494'
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 1204kb
input:
947 998134339
output:
843822513
result:
wrong answer 1st lines differ - expected: '761932751', found: '843822513'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 1200kb
input:
934 998144339
output:
655166523
result:
wrong answer 1st lines differ - expected: '42889072', found: '655166523'
Test #11:
score: 0
Wrong Answer
time: 32ms
memory: 8940kb
input:
991572 998154343
output:
92803366
result:
wrong answer 1st lines differ - expected: '277089318', found: '92803366'
Test #12:
score: 0
Wrong Answer
time: 29ms
memory: 8484kb
input:
932800 998164337
output:
712866607
result:
wrong answer 1st lines differ - expected: '945072504', found: '712866607'
Test #13:
score: 0
Wrong Answer
time: 28ms
memory: 8252kb
input:
903603 998174341
output:
232265252
result:
wrong answer 1st lines differ - expected: '29916736', found: '232265252'
Test #14:
score: 0
Wrong Answer
time: 34ms
memory: 8684kb
input:
958646 998184331
output:
327650455
result:
wrong answer 1st lines differ - expected: '802903490', found: '327650455'
Test #15:
score: 0
Wrong Answer
time: 32ms
memory: 8872kb
input:
983016 998194349
output:
763059071
result:
wrong answer 1st lines differ - expected: '802900579', found: '763059071'
Test #16:
score: 0
Wrong Answer
time: 34ms
memory: 8396kb
input:
922347 998204353
output:
294727372
result:
wrong answer 1st lines differ - expected: '228575331', found: '294727372'
Test #17:
score: 0
Wrong Answer
time: 34ms
memory: 8820kb
input:
976053 998214317
output:
450896000
result:
wrong answer 1st lines differ - expected: '982618317', found: '450896000'
Test #18:
score: 0
Wrong Answer
time: 34ms
memory: 8668kb
input:
957300 998224351
output:
928812912
result:
wrong answer 1st lines differ - expected: '514549818', found: '928812912'
Test #19:
score: 0
Wrong Answer
time: 27ms
memory: 8392kb
input:
921760 998234353
output:
911992722
result:
wrong answer 1st lines differ - expected: '470386410', found: '911992722'
Test #20:
score: 0
Wrong Answer
time: 27ms
memory: 8328kb
input:
912948 998244353
output:
419923218
result:
wrong answer 1st lines differ - expected: '129235345', found: '419923218'