# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9293 | cki86201 | Uniting (kriii2_U) | C++98 | 12 ms | 1088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define ll long long
const int MOD = 1e9 + 7;
int main()
{
int n;
ll a = 0, b = 1, c = 1;
scanf("%d%lld",&n,&b);--n;
while(n--){
int x;
scanf("%d",&x);
a += b*x;
b += x;
c *= (n+2);
c %= MOD;
c *= (n+1);
c %= MOD;
}
printf("%lld\n%lld",a,c);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |