QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#79710#3724. Strange PrimexzzduangWA 27ms5084kbC++141.1kb2023-02-20 19:29:292023-02-20 19:29:33

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:29:33]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:5084kb
  • [2023-02-20 19:29:29]
  • 提交

answer

#include<iostream>
#include<stdio.h>
#include<ctype.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pii pair<int,int>
#define lowbit(x) ((x)&-(x))
#define popcount(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define umap unordered_map
#define all(x) x.begin(),x.end()
#define mk make_pair
#define pb push_back
#define ckmax(x,y) x=max(x,y)
#define ckmin(x,y) x=min(x,y)
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define N 100005
#define int long long
using namespace std;
inline int read(){
	int x=0,f=0; char ch=getchar();
	while(!isdigit(ch)) f|=(ch==45),ch=getchar();
	while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return f?-x:x;
}
const int mo=1e9+7,P=1e10+19;
inline void red(int &x){x>=mo?x-=mo:0;}
int n,a[N],ans,pre[N];
signed main(){
	while(scanf("%lld",&n)!=EOF){
		ans=0;
		pre[0]=1;
		for(int i=1;i<=n;++i) a[i]=read(),pre[i]=pre[i-1]*a[i]%mo;
		int mul=1;
		for(int i=n;i>=1;--i){
			red(ans+=mul*pre[i-1]%mo);
			mul=(P-a[i])%mo*mul%mo;
		}
		printf("%lld\n",ans);
	}
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 27ms
memory: 5084kb

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:

276401514
528736719
55645786
692739712
729536373
236372323
601105518
309268671
457244178
786462261
90450986
90480167
109428708
944184730
435219909
14890958
279437288
487848867
785869925
153762111
507868257
249387649
843820333
91930607
699270414
951698441
611414215
759725062
690092296
265618089
65639...

result:

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