QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#79678#3724. Strange PrimePure_FuriesWA 280ms4180kbC++14319b2023-02-20 19:11:462023-02-20 19:11:49

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-20 19:11:49]
  • 评测
  • 测评结果:WA
  • 用时:280ms
  • 内存:4180kb
  • [2023-02-20 19:11:46]
  • 提交

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';
	}
}

Details

Tip: Click on the bar to expand more detailed information

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'