QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#79676 | #3724. Strange Prime | DerekFeng | WA | 100ms | 3764kb | C++ | 294b | 2023-02-20 19:11:33 | 2023-02-20 19:11:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M=1e9+7,P=999999956,I=215686276;
int main(){
int n;while(~scanf("%d",&n)){
int f=1,g=1;while(n--){
int x;scanf("%d",&x);
g=(ll)g*(M-x)%M,f=(ll)f*(P+M-x)%M;
}
printf("%d\n",(ll)(f+g)*I%M);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 100ms
memory: 3764kb
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:
446708194 257946991 952382868 642849497 760203822 33805049 854203884 122780598 407706010 698568081 611328155 899275177 459084585 996702073 559906792 819581438 414160914 161400672 627462905 321996311 254841532 154152614 421988955 89216912 917350548 517172588 860935867 410207144 334759605 19494324 805...
result:
wrong answer 1st numbers differ - expected: '8747181', found: '446708194'