QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#79678 | #3724. Strange Prime | Pure_Furies | WA | 280ms | 4180kb | C++14 | 319b | 2023-02-20 19:11:46 | 2023-02-20 19:11:49 |
Judging History
answer
#import<iostream>
using namespace std;
int p=1e9+7,w=p-51,n,m[100003],a[100003];
int main(){
m[0]=1;
while(cin>>n){
for(int i=1;i<=n;i++){
cin>>a[i];
m[i]=1ll*m[i-1]*(w+p-a[i])%p;
}
int ans=0,P=1;
for(int i=n;i;i--)
ans=(ans+P*m[i-1])%p,
P=(p-1ll)*P*a[i]%p;
cout<<ans<<'\n';
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 280ms
memory: 4180kb
input:
10 2357 42596 7212 30898 43465 68984 60783 59520 53767 77560 10 39115 88080 83553 61736 90821 39690 13194 81396 38051 55993 10 95070 81321 71632 21071 10807 46105 66844 63678 47577 75132 10 43898 93215 26791 11849 61857 1423 76971 83489 52044 61325 10 22610 16613 90 53598 80110 42651 64942 67114 242...
output:
-727188765 65693270 897791079 298075656 326041652 601456093 7017689 -195399651 1066241 791588501 -813535922 187698767 -993549926 85164116 299316970 557724324 -252116996 -300586125 322017477 406172568 619296497 -86609857 -146283482 217705052 467721319 -329347451 103808438 -474748163 230009085 -509850...
result:
wrong answer 1st numbers differ - expected: '8747181', found: '-727188765'