QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#79725 | #3724. Strange Prime | YangHHao | WA | 68ms | 3384kb | C++14 | 1.4kb | 2023-02-20 19:51:04 | 2023-02-20 19:51:06 |
Judging History
answer
#include<bits/stdc++.h>
//#pragma GCC optimize(2)
using namespace std;
#define pii pair<int,int>
#define ll long long
#define il inline
#define fst first
#define scd second
#define reg register
#define err() cout<<"err "<<__LINE__<<endl,exit(0)
#define pot(args...) \
GPT(#args),cout<<" Line "<<__LINE__<<"\t: ", \
PPT(args),cout<<"\n\n"
#define rep(i,s,t) for(int i=(s);i<=(t);++i)
#define irep(i,t,s) for(int i=(t);i>=(s);--i)
void PPT(){}
template<typename TYPE,typename... TYPES>
void PPT(const TYPE& x,const TYPES&... y){cout<<x<<' ',PPT(y...);}
void GPT(string nam){cout<<setw(29)<<nam;}
il int read(int x=0,int f=1){
char ch=getchar();
while(ch<'0'||ch>'9')f=(ch=='-'?-1:1),ch=getchar();
while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
return x*f;
}
il void write(int x){
char F[200];
int tmp=x>0?x:-x;
if(x<0)putchar('-');
if(x==0)putchar('0');
int cnt=0;
while(tmp>0){
F[cnt++]=tmp%10+'0';
tmp/=10;
}
while(cnt>0)putchar(F[--cnt]);
}
const int P=999999956,mod=1e9+7;
int qp(int a,int b){
int r=1;
while(b){
if(b&1)r=1ll*r*a%mod;
a=1ll*a*a%mod;b>>=1;
}
return r;
}
int n;
void work(){
int ans=1;
rep(i,1,n){
int a;cin>>a;
ans=1ll*ans*(P-a)%mod;
}
ans=1ll*ans*qp(P,mod-2)%mod;
cout<<ans<<'\n';
}
signed main(){
ios::sync_with_stdio(false);
while(cin>>n){
work();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 68ms
memory: 3384kb
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:
727727691 683585005 904077179 92412963 675132488 198397323 420771304 219644293 989499920 254915073 791503333 687510611 948848003 668971968 857706894 497039365 442123253 3160035 370980935 30683365 646714319 184080650 964399900 171895707 198895626 155009881 82426857 744604334 822505143 427228667 91226...
result:
wrong answer 1st numbers differ - expected: '8747181', found: '727727691'