QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#79649#3724. Strange Primeni_mingWA 2ms3420kbC++14459b2023-02-20 18:34:442023-02-20 18:34:46

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 18:34:46]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3420kb
  • [2023-02-20 18:34:44]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const long long P=1e10+19,md=1e9+7;
long long n,a[101010];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	if(a[0]==0)
	{
		long long ans=1;
		for(int i=2;i<=n;i++)
		{
			ans*=(P-a[i])%md;
			ans%=md;
		}
		cout<<ans<<endl;
		return 0;
	}
	long long ans=1;
	for(int i=3;i<=n;i++)
	{
		ans*=(P-a[i])%md;
		ans%=md;
	}
	cout<<ans<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3420kb

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:

417821478

result:

wrong answer 1st numbers differ - expected: '8747181', found: '417821478'