QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#79674#3724. Strange PrimePure_FuriesCompile Error//C++14321b2023-02-20 19:11:242023-02-20 19:11:28

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:28]
  • 评测
  • [2023-02-20 19:11:24]
  • 提交

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=(mod-1ll)*P*a[i]%p;
		cout<<ans<<'\n';
	}
}

詳細信息

answer.code:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<iostream>
      |  ^~~~~~
answer.code: In function ‘int main()’:
answer.code:14:28: error: ‘mod’ was not declared in this scope
   14 |                         P=(mod-1ll)*P*a[i]%p;
      |                            ^~~